From fd1f6810e144ebd5568cd18234bc1139ef57602a Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Thu, 30 Nov 2023 14:41:00 +0100 Subject: [PATCH 1/3] Updated the existing cluster according to the latest Matter 1.3 spec. The existing clusters that have been updated are: Account Login, Channel, Content Launcher, Media Playback and Target Navigator. I have also added 2 new Clusters: Content Control and Content app observer --- .github/workflows/tests.yaml | 2 + build/chip/java/kotlinc_runner.py | 2 + data_model/clusters/AccountLogin.xml | 97 +- data_model/clusters/Channel.xml | 366 ++- data_model/clusters/ContentLauncher.xml | 186 +- data_model/clusters/MediaPlayback.xml | 311 ++- data_model/clusters/TargetNavigator.xml | 127 +- examples/tv-app/android/BUILD.gn | 4 + .../account-login/AccountLoginManager.cpp | 5 +- .../account-login/AccountLoginManager.h | 5 +- .../ContentAppObserver.cpp | 36 + .../content-app-observer/ContentAppObserver.h | 40 + .../content-control/ContentController.cpp | 106 + .../content-control/ContentController.h | 63 + .../AppContentLauncherManager.cpp | 4 +- .../AppContentLauncherManager.h | 5 +- .../AppMediaPlaybackManager.cpp | 65 +- .../media-playback/AppMediaPlaybackManager.h | 56 +- examples/tv-app/android/java/AppImpl.h | 18 + .../tv-app/android/java/ChannelManager.cpp | 34 + examples/tv-app/android/java/ChannelManager.h | 21 + .../android/java/ContentLauncherManager.cpp | 4 +- .../android/java/ContentLauncherManager.h | 4 +- .../android/java/MediaPlaybackManager.cpp | 65 +- .../android/java/MediaPlaybackManager.h | 56 +- examples/tv-app/tv-common/BUILD.gn | 4 + .../account-login/AccountLoginManager.cpp | 5 +- .../account-login/AccountLoginManager.h | 5 +- .../clusters/channel/ChannelManager.cpp | 34 + .../clusters/channel/ChannelManager.h | 19 + .../ContentAppObserver.cpp | 36 + .../content-app-observer/ContentAppObserver.h | 37 + .../content-control/ContentController.cpp | 106 + .../content-control/ContentController.h | 61 + .../ContentLauncherManager.cpp | 7 +- .../content-launcher/ContentLauncherManager.h | 4 +- .../media-playback/MediaPlaybackManager.cpp | 90 +- .../media-playback/MediaPlaybackManager.h | 59 +- examples/tv-app/tv-common/include/AppTv.h | 8 + .../tv-app/tv-common/src/ZCLCallbacks.cpp | 2 + examples/tv-app/tv-common/tv-app.cmake | 2 + examples/tv-app/tv-common/tv-app.zap | 2446 +++++++++++++---- scripts/rules.matterlint | 2 + src/app/app-platform/ContentApp.h | 6 + .../account-login-delegate.h | 9 +- .../account-login-server.cpp | 52 +- .../channel-server/channel-delegate.h | 19 + .../channel-server/channel-server.cpp | 109 + .../content-app-observer-delegate.h | 46 + .../content-app-observer.cpp | 153 ++ .../content-app-observer.h | 39 + .../content-control-delegate.h | 69 + .../content-control-server.cpp | 417 +++ .../content-control-server.h | 39 + .../content-launch-delegate.h | 4 +- .../content-launch-server.cpp | 6 +- .../media-playback-delegate.h | 47 +- .../media-playback-server.cpp | 207 +- .../target-navigator-server.cpp | 46 + .../tests/suites/TV_AccountLoginCluster.yaml | 6 + .../suites/TV_ContentLauncherCluster.yaml | 21 + .../certification/Test_TC_ALOGIN_12_1.yaml | 8 +- .../Test_TC_CONTENTLAUNCHER_10_3.yaml | 42 + .../Test_TC_CONTENTLAUNCHER_10_7.yaml | 247 ++ .../data-model/chip/account-login-cluster.xml | 9 +- .../zcl/data-model/chip/channel-cluster.xml | 111 + .../chip/content-app-observer-cluster.xml | 49 + .../chip/content-control-cluster.xml | 108 + .../chip/content-launch-cluster.xml | 47 + .../chip/media-playback-cluster.xml | 72 + .../chip/target-navigator-cluster.xml | 9 +- .../zcl/zcl-with-test-extensions.json | 8 +- src/app/zap-templates/zcl/zcl.json | 8 +- src/app/zap_cluster_list.json | 4 + 74 files changed, 5659 insertions(+), 967 deletions(-) create mode 100644 examples/tv-app/android/include/content-app-observer/ContentAppObserver.cpp create mode 100644 examples/tv-app/android/include/content-app-observer/ContentAppObserver.h create mode 100644 examples/tv-app/android/include/content-control/ContentController.cpp create mode 100644 examples/tv-app/android/include/content-control/ContentController.h create mode 100644 examples/tv-app/tv-common/clusters/content-app-observer/ContentAppObserver.cpp create mode 100644 examples/tv-app/tv-common/clusters/content-app-observer/ContentAppObserver.h create mode 100644 examples/tv-app/tv-common/clusters/content-control/ContentController.cpp create mode 100644 examples/tv-app/tv-common/clusters/content-control/ContentController.h create mode 100644 src/app/clusters/content-app-observer/content-app-observer-delegate.h create mode 100644 src/app/clusters/content-app-observer/content-app-observer.cpp create mode 100644 src/app/clusters/content-app-observer/content-app-observer.h create mode 100644 src/app/clusters/content-control-server/content-control-delegate.h create mode 100644 src/app/clusters/content-control-server/content-control-server.cpp create mode 100644 src/app/clusters/content-control-server/content-control-server.h create mode 100644 src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml create mode 100644 src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e289d9823ed0b5..02eba95d9188a9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -110,6 +110,8 @@ jobs: src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml \ diff --git a/build/chip/java/kotlinc_runner.py b/build/chip/java/kotlinc_runner.py index 07d4aabe79a880..083df07e382a2e 100755 --- a/build/chip/java/kotlinc_runner.py +++ b/build/chip/java/kotlinc_runner.py @@ -127,6 +127,8 @@ def main(): if classpath: kotlin_args += ["-classpath", classpath] + kotlin_args += ["-J-Xms256m", "-J-Xmx4096m", "-J-XX:MaxPermSize=350m", "-J-XX:ReservedCodeCacheSize=225m", "-J-XX:+UseCompressedOops"] + retcode = subprocess.check_call(kotlin_args + args.rest) if retcode != EXIT_SUCCESS: return retcode diff --git a/data_model/clusters/AccountLogin.xml b/data_model/clusters/AccountLogin.xml index 3cd5c02590ea0a..cc7e74bf2256fd 100644 --- a/data_model/clusters/AccountLogin.xml +++ b/data_model/clusters/AccountLogin.xml @@ -1,4 +1,4 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Channel.xml b/data_model/clusters/Channel.xml index b75540d94a6baf..0f9d546fef27fa 100644 --- a/data_model/clusters/Channel.xml +++ b/data_model/clusters/Channel.xml @@ -1,59 +1,59 @@ - @@ -67,6 +67,12 @@ Davis, CA 95616, USA + + + + + + @@ -85,6 +91,161 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -101,6 +262,12 @@ Davis, CA 95616, USA + + + + + + @@ -190,5 +357,94 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ContentLauncher.xml b/data_model/clusters/ContentLauncher.xml index 32b47a77c233a3..114c2e4d6e10b7 100644 --- a/data_model/clusters/ContentLauncher.xml +++ b/data_model/clusters/ContentLauncher.xml @@ -1,59 +1,59 @@ - @@ -67,6 +67,15 @@ Davis, CA 95616, USA + + + + + + + + + @@ -125,6 +134,15 @@ Davis, CA 95616, USA + + + + + + + + + @@ -136,6 +154,16 @@ Davis, CA 95616, USA + + + + + + + + + + @@ -144,6 +172,9 @@ Davis, CA 95616, USA + + + @@ -182,6 +213,42 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,6 +329,12 @@ Davis, CA 95616, USA + + + + + + @@ -277,6 +350,9 @@ Davis, CA 95616, USA + + + diff --git a/data_model/clusters/MediaPlayback.xml b/data_model/clusters/MediaPlayback.xml index c53dc862808c12..94987fbcfdb449 100644 --- a/data_model/clusters/MediaPlayback.xml +++ b/data_model/clusters/MediaPlayback.xml @@ -1,59 +1,59 @@ - @@ -67,6 +67,12 @@ Davis, CA 95616, USA + + + + + + @@ -118,6 +124,86 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -172,6 +258,38 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -254,5 +372,88 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/TargetNavigator.xml b/data_model/clusters/TargetNavigator.xml index ffb6955d27bf3c..d93a7de1fc011c 100644 --- a/data_model/clusters/TargetNavigator.xml +++ b/data_model/clusters/TargetNavigator.xml @@ -1,59 +1,59 @@ - @@ -115,4 +115,21 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/tv-app/android/BUILD.gn b/examples/tv-app/android/BUILD.gn index 115d5dfb2a4cf0..0793b7d2993ef8 100644 --- a/examples/tv-app/android/BUILD.gn +++ b/examples/tv-app/android/BUILD.gn @@ -33,6 +33,10 @@ shared_library("jni") { "include/audio-output/AudioOutputManager.cpp", "include/audio-output/AudioOutputManager.h", "include/cluster-init.cpp", + "include/content-app-observer/ContentAppObserver.cpp", + "include/content-app-observer/ContentAppObserver.h", + "include/content-control/ContentController.cpp", + "include/content-control/ContentController.h", "include/content-launcher/AppContentLauncherManager.cpp", "include/content-launcher/AppContentLauncherManager.h", "include/media-playback/AppMediaPlaybackManager.cpp", diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp index 0f2e77e06be53f..2fbc0aa5899004 100644 --- a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp +++ b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp @@ -32,7 +32,8 @@ AccountLoginManager::AccountLoginManager(ContentAppCommandDelegate * commandDele CopyString(mSetupPin, sizeof(mSetupPin), setupPin); } -bool AccountLoginManager::HandleLogin(const CharSpan & tempAccountIdentifier, const CharSpan & setupPin) +bool AccountLoginManager::HandleLogin(const CharSpan & tempAccountIdentifier, const CharSpan & setupPin, + const chip::Optional & nodeId) { ChipLogProgress(DeviceLayer, "AccountLoginManager::HandleLogin called for endpoint %d", mEndpointId); string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size()); @@ -50,7 +51,7 @@ bool AccountLoginManager::HandleLogin(const CharSpan & tempAccountIdentifier, co } } -bool AccountLoginManager::HandleLogout() +bool AccountLoginManager::HandleLogout(const chip::Optional & nodeId) { // TODO: Insert your code here to send logout request return true; diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.h b/examples/tv-app/android/include/account-login/AccountLoginManager.h index aa229d8bb9d88b..a02a029f307eee 100644 --- a/examples/tv-app/android/include/account-login/AccountLoginManager.h +++ b/examples/tv-app/android/include/account-login/AccountLoginManager.h @@ -39,8 +39,9 @@ class AccountLoginManager : public AccountLoginDelegate inline void SetSetupPin(char * setupPin) override { CopyString(mSetupPin, sizeof(mSetupPin), setupPin); }; - bool HandleLogin(const CharSpan & tempAccountIdentifierString, const CharSpan & setupPinString) override; - bool HandleLogout() override; + bool HandleLogin(const CharSpan & tempAccountIdentifierString, const CharSpan & setupPinString, + const chip::Optional & nodeId) override; + bool HandleLogout(const chip::Optional & nodeId) override; void HandleGetSetupPin(CommandResponseHelper & helper, const CharSpan & tempAccountIdentifierString) override; void GetSetupPin(char * setupPin, size_t setupPinSize, const CharSpan & tempAccountIdentifierString) override; diff --git a/examples/tv-app/android/include/content-app-observer/ContentAppObserver.cpp b/examples/tv-app/android/include/content-app-observer/ContentAppObserver.cpp new file mode 100644 index 00000000000000..7145ba24305f21 --- /dev/null +++ b/examples/tv-app/android/include/content-app-observer/ContentAppObserver.cpp @@ -0,0 +1,36 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ContentAppObserver.h" + +#include +#include + +using namespace std; +using namespace chip; +using namespace chip::app::Clusters::ContentAppObserver; + +ContentAppObserver::ContentAppObserver() +{ + // Create Test Data +} + +void ContentAppObserver::HandleContentAppMessage(chip::app::CommandResponseHelper & helper, + const chip::Optional & data, const chip::CharSpan & encodingHint) +{ + ChipLogProgress(Zcl, "ContentAppObserver::HandleContentAppMessage"); +} diff --git a/examples/tv-app/android/include/content-app-observer/ContentAppObserver.h b/examples/tv-app/android/include/content-app-observer/ContentAppObserver.h new file mode 100644 index 00000000000000..d866362191b880 --- /dev/null +++ b/examples/tv-app/android/include/content-app-observer/ContentAppObserver.h @@ -0,0 +1,40 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +using ContentAppObserverDelegate = chip::app::Clusters::ContentAppObserver::Delegate; +using ContentAppMessageResponse = chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::Type; + +class ContentAppObserver : public ContentAppObserverDelegate +{ +public: + ContentAppObserver(); + + void HandleContentAppMessage(chip::app::CommandResponseHelper & helper, + const chip::Optional & data, const chip::CharSpan & encodingHint) override; + void SetEndpointId(chip::EndpointId epId) { mEndpointId = epId; }; + +protected: +private: + chip::EndpointId mEndpointId; +}; diff --git a/examples/tv-app/android/include/content-control/ContentController.cpp b/examples/tv-app/android/include/content-control/ContentController.cpp new file mode 100644 index 00000000000000..c4eee0355f4552 --- /dev/null +++ b/examples/tv-app/android/include/content-control/ContentController.cpp @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ContentController.h" +#include +#include + +using namespace std; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters::ContentControl; + +ContentController::ContentController() +{ + // Create Test Data +} + +// Attribute Delegates +bool ContentController::HandleGetEnabled() +{ + return false; +} + +CHIP_ERROR ContentController::HandleGetOnDemandRatings(chip::app::AttributeValueEncoder & aEncoder) +{ + return aEncoder.Encode(chip::CharSpan()); +} + +chip::CharSpan ContentController::HandleGetOnDemandRatingThreshold() +{ + return chip::CharSpan(); +} + +CHIP_ERROR ContentController::HandleGetScheduledContentRatings(chip::app::AttributeValueEncoder & aEncoder) +{ + return aEncoder.Encode(chip::CharSpan()); +} + +chip::CharSpan ContentController::HandleGetScheduledContentRatingThreshold() +{ + return chip::CharSpan(); +} + +uint32_t ContentController::HandleGetScreenDailyTime() +{ + return (uint32_t) 0xFFFFFFFF; +} + +uint32_t ContentController::HandleGetRemainingScreenTime() +{ + return (uint32_t) 0xFFFFFFFF; +} + +bool ContentController::HandleGetBlockUnrated() +{ + return false; +} + +// Command Delegates +void ContentController::HandleUpdatePIN(chip::Optional oldPIN, chip::CharSpan newPIN) {} + +void ContentController::HandleResetPIN(chip::app::CommandResponseHelper & helper) {} + +void ContentController::HandleEnable() {} + +void ContentController::HandleDisable() {} + +void ContentController::HandleAddBonusTime(chip::Optional PINCode, chip::Optional bonusTime) {} + +void ContentController::HandleSetScreenDailyTime(uint32_t screenDailyTime) {} + +void ContentController::HandleBlockUnratedContent() {} + +void ContentController::HandleUnblockUnratedContent() {} + +void ContentController::HandleSetOnDemandRatingThreshold(chip::CharSpan rating) {} + +void ContentController::HandleSetScheduledContentRatingThreshold(chip::CharSpan rating) {} + +uint32_t ContentController::GetFeatureMap(chip::EndpointId endpoint) +{ + if (endpoint >= EMBER_AF_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicEndpointFeatureMap; + } + + uint32_t featureMap = 0; + // TODO: ReEnable the code bellow + // Attributes::FeatureMap::Get(endpoint, &featureMap); + return featureMap; +} diff --git a/examples/tv-app/android/include/content-control/ContentController.h b/examples/tv-app/android/include/content-control/ContentController.h new file mode 100644 index 00000000000000..eaafef098f65c0 --- /dev/null +++ b/examples/tv-app/android/include/content-control/ContentController.h @@ -0,0 +1,63 @@ +/* + * + * 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 + +using ContentControlDelegate = chip::app::Clusters::ContentControl::Delegate; +using ResetPINResponseType = chip::app::Clusters::ContentControl::Commands::ResetPINResponse::Type; + +class ContentController : public ContentControlDelegate +{ +public: + ContentController(); + + // Attribute Delegates + bool HandleGetEnabled() override; + CHIP_ERROR HandleGetOnDemandRatings(chip::app::AttributeValueEncoder & aEncoder) override; + chip::CharSpan HandleGetOnDemandRatingThreshold() override; + CHIP_ERROR HandleGetScheduledContentRatings(chip::app::AttributeValueEncoder & aEncoder) override; + chip::CharSpan HandleGetScheduledContentRatingThreshold() override; + uint32_t HandleGetScreenDailyTime() override; + uint32_t HandleGetRemainingScreenTime() override; + bool HandleGetBlockUnrated() override; + + // Command Delegates + void HandleUpdatePIN(chip::Optional oldPIN, chip::CharSpan newPIN) override; + void HandleResetPIN(chip::app::CommandResponseHelper & helper) override; + void HandleEnable() override; + void HandleDisable() override; + void HandleAddBonusTime(chip::Optional PINCode, chip::Optional bonusTime) override; + void HandleSetScreenDailyTime(uint32_t screenDailyTime) override; + void HandleBlockUnratedContent() override; + void HandleUnblockUnratedContent() override; + void HandleSetOnDemandRatingThreshold(chip::CharSpan rating) override; + void HandleSetScheduledContentRatingThreshold(chip::CharSpan rating) override; + + uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + void SetEndpointId(chip::EndpointId epId) { mEndpointId = epId; }; + +protected: +private: + // TODO: set this based upon meta data from app + uint32_t mDynamicEndpointFeatureMap = 3; + chip::EndpointId mEndpointId; +}; diff --git a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp index 61e8af0193fa9e..329df8cd802299 100644 --- a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp +++ b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp @@ -38,7 +38,9 @@ AppContentLauncherManager::AppContentLauncherManager(ContentAppAttributeDelegate void AppContentLauncherManager::HandleLaunchContent(CommandResponseHelper & helper, const DecodableList & parameterList, bool autoplay, - const CharSpan & data) + const CharSpan & data, + const chip::Optional playbackPreferences, + bool useCurrentContext) { ChipLogProgress(Zcl, "AppContentLauncherManager::HandleLaunchContent for endpoint %d", mEndpointId); string dataString(data.data(), data.size()); diff --git a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h index 2843486a037363..67812744ce0d36 100644 --- a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h +++ b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h @@ -29,6 +29,7 @@ using chip::app::CommandResponseHelper; using ContentLauncherDelegate = chip::app::Clusters::ContentLauncher::Delegate; using LaunchResponseType = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Type; using ParameterType = chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::DecodableType; +using PlaybackPreferencesType = chip::app::Clusters::ContentLauncher::Structs::PlaybackPreferencesStruct::DecodableType; using BrandingInformationType = chip::app::Clusters::ContentLauncher::Structs::BrandingInformationStruct::Type; using ContentAppAttributeDelegate = chip::AppPlatform::ContentAppAttributeDelegate; @@ -40,7 +41,9 @@ class AppContentLauncherManager : public ContentLauncherDelegate void HandleLaunchContent(CommandResponseHelper & helper, const chip::app::DataModel::DecodableList & parameterList, bool autoplay, - const CharSpan & data) override; + const CharSpan & data, const chip::Optional playbackPreferences, + bool useCurrentContext) override; + void HandleLaunchUrl(CommandResponseHelper & helper, const CharSpan & contentUrl, const CharSpan & displayString, const BrandingInformationType & brandingInformation) override; CHIP_ERROR HandleGetAcceptHeaderList(AttributeValueEncoder & aEncoder) override; diff --git a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp index 0fe5e9d63d4f6f..e7d8100e9e5ce0 100644 --- a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp +++ b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp @@ -69,6 +69,44 @@ uint64_t AppMediaPlaybackManager::HandleGetSeekRangeEnd() return HandleMediaRequestGetAttribute(MEDIA_PLAYBACK_ATTRIBUTE_SEEK_RANGE_END); } +CHIP_ERROR AppMediaPlaybackManager::HandleGetActiveAudioTrack(AttributeValueEncoder & aEncoder) +{ + TrackType mActiveAudioTrack; + return aEncoder.Encode(mActiveAudioTrack); +} + +CHIP_ERROR AppMediaPlaybackManager::HandleGetAvailableAudioTracks(AttributeValueEncoder & aEncoder) +{ + std::vector mAvailableAudioTracks; + // TODO: Insert code here + return aEncoder.EncodeList([mAvailableAudioTracks](const auto & encoder) -> CHIP_ERROR { + for (auto const & audioTrack : mAvailableAudioTracks) + { + ReturnErrorOnFailure(encoder.Encode(audioTrack)); + } + return CHIP_NO_ERROR; + }); +} + +CHIP_ERROR AppMediaPlaybackManager::HandleGetActiveTextTrack(AttributeValueEncoder & aEncoder) +{ + TrackType mActiveTextTrack; + return aEncoder.Encode(mActiveTextTrack); +} + +CHIP_ERROR AppMediaPlaybackManager::HandleGetAvailableTextTracks(AttributeValueEncoder & aEncoder) +{ + std::vector mAvailableTextTracks; + // TODO: Insert code here + return aEncoder.EncodeList([mAvailableTextTracks](const auto & encoder) -> CHIP_ERROR { + for (auto const & textTrack : mAvailableTextTracks) + { + ReturnErrorOnFailure(encoder.Encode(textTrack)); + } + return CHIP_NO_ERROR; + }); +} + void AppMediaPlaybackManager::HandlePlay(CommandResponseHelper & helper) { helper.Success(HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_PLAY, 0)); @@ -84,7 +122,8 @@ void AppMediaPlaybackManager::HandleStop(CommandResponseHelper & helper) +void AppMediaPlaybackManager::HandleFastForward(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) { helper.Success(HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_FAST_FORWARD, 0)); } @@ -94,7 +133,8 @@ void AppMediaPlaybackManager::HandlePrevious(CommandResponseHelper & helper) +void AppMediaPlaybackManager::HandleRewind(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) { helper.Success(HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_REWIND, 0)); } @@ -127,6 +167,27 @@ void AppMediaPlaybackManager::HandleStartOver(CommandResponseHelper #include #include +#include enum MediaPlaybackRequestAttribute : chip::AttributeId { - MEDIA_PLAYBACK_ATTRIBUTE_PLAYBACK_STATE = chip::app::Clusters::MediaPlayback::Attributes::CurrentState::Id, - MEDIA_PLAYBACK_ATTRIBUTE_START_TIME = chip::app::Clusters::MediaPlayback::Attributes::StartTime::Id, - MEDIA_PLAYBACK_ATTRIBUTE_DURATION = chip::app::Clusters::MediaPlayback::Attributes::Duration::Id, - MEDIA_PLAYBACK_ATTRIBUTE_SPEED = chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::Id, - MEDIA_PLAYBACK_ATTRIBUTE_SEEK_RANGE_END = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id, - MEDIA_PLAYBACK_ATTRIBUTE_SEEK_RANGE_START = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::Id, + MEDIA_PLAYBACK_ATTRIBUTE_PLAYBACK_STATE = chip::app::Clusters::MediaPlayback::Attributes::CurrentState::Id, + MEDIA_PLAYBACK_ATTRIBUTE_START_TIME = chip::app::Clusters::MediaPlayback::Attributes::StartTime::Id, + MEDIA_PLAYBACK_ATTRIBUTE_DURATION = chip::app::Clusters::MediaPlayback::Attributes::Duration::Id, + MEDIA_PLAYBACK_ATTRIBUTE_SPEED = chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::Id, + MEDIA_PLAYBACK_ATTRIBUTE_SEEK_RANGE_END = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id, + MEDIA_PLAYBACK_ATTRIBUTE_SEEK_RANGE_START = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::Id, + MEDIA_PLAYBACK_ATTRIBUTE_ACTIVE_AUDIO_TRACK = chip::app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::Id, + MEDIA_PLAYBACK_ATTRIBUTE_AVAILABLE_AUDIO_TRACKS = chip::app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::Id, + MEDIA_PLAYBACK_ATTRIBUTE_ACTIVE_TEXT_TRACK = chip::app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::Id, + MEDIA_PLAYBACK_ATTRIBUTE_AVAILABLE_TEXT_TRACKS = chip::app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::Id, }; enum MediaPlaybackRequest : uint8_t { - MEDIA_PLAYBACK_REQUEST_PLAY = 0, - MEDIA_PLAYBACK_REQUEST_PAUSE = 1, - MEDIA_PLAYBACK_REQUEST_STOP = 2, - MEDIA_PLAYBACK_REQUEST_START_OVER = 3, - MEDIA_PLAYBACK_REQUEST_PREVIOUS = 4, - MEDIA_PLAYBACK_REQUEST_NEXT = 5, - MEDIA_PLAYBACK_REQUEST_REWIND = 6, - MEDIA_PLAYBACK_REQUEST_FAST_FORWARD = 7, - MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD = 8, - MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD = 9, - MEDIA_PLAYBACK_REQUEST_SEEK = 10, + MEDIA_PLAYBACK_REQUEST_PLAY = 0, + MEDIA_PLAYBACK_REQUEST_PAUSE = 1, + MEDIA_PLAYBACK_REQUEST_STOP = 2, + MEDIA_PLAYBACK_REQUEST_START_OVER = 3, + MEDIA_PLAYBACK_REQUEST_PREVIOUS = 4, + MEDIA_PLAYBACK_REQUEST_NEXT = 5, + MEDIA_PLAYBACK_REQUEST_REWIND = 6, + MEDIA_PLAYBACK_REQUEST_FAST_FORWARD = 7, + MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD = 8, + MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD = 9, + MEDIA_PLAYBACK_REQUEST_SEEK = 10, + MEDIA_PLAYBACK_REQUEST_ACTIVATE_AUDIO_TRACK = 11, + MEDIA_PLAYBACK_REQUEST_ACTIVATE_TEXT_TRACK = 12, + MEDIA_PLAYBACK_REQUEST_DEACTIVATE_TEXT_TRACK = 13, }; using chip::EndpointId; @@ -55,6 +63,7 @@ using chip::app::CommandResponseHelper; using MediaPlaybackDelegate = chip::app::Clusters::MediaPlayback::Delegate; using PlaybackResponseType = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type; using ContentAppAttributeDelegate = chip::AppPlatform::ContentAppAttributeDelegate; +using TrackType = chip::app::Clusters::MediaPlayback::Structs::TrackStruct::Type; class AppMediaPlaybackManager : public MediaPlaybackDelegate { @@ -68,13 +77,19 @@ class AppMediaPlaybackManager : public MediaPlaybackDelegate float HandleGetPlaybackSpeed() override; uint64_t HandleGetSeekRangeStart() override; uint64_t HandleGetSeekRangeEnd() override; + CHIP_ERROR HandleGetActiveAudioTrack(AttributeValueEncoder & aEncoder) override; + CHIP_ERROR HandleGetAvailableAudioTracks(AttributeValueEncoder & aEncoder) override; + CHIP_ERROR HandleGetActiveTextTrack(AttributeValueEncoder & aEncoder) override; + CHIP_ERROR HandleGetAvailableTextTracks(AttributeValueEncoder & aEncoder) override; void HandlePlay(CommandResponseHelper & helper) override; void HandlePause(CommandResponseHelper & helper) override; void HandleStop(CommandResponseHelper & helper) override; - void HandleFastForward(CommandResponseHelper & helper) override; + void HandleFastForward(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) override; void HandlePrevious(CommandResponseHelper & helper) override; - void HandleRewind(CommandResponseHelper & helper) override; + void HandleRewind(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) override; void HandleSkipBackward(CommandResponseHelper & helper, const uint64_t & deltaPositionMilliseconds) override; void HandleSkipForward(CommandResponseHelper & helper, @@ -82,6 +97,9 @@ class AppMediaPlaybackManager : public MediaPlaybackDelegate void HandleSeek(CommandResponseHelper & helper, const uint64_t & positionMilliseconds) override; void HandleNext(CommandResponseHelper & helper) override; void HandleStartOver(CommandResponseHelper & helper) override; + bool HandleActivateAudioTrack(const chip::CharSpan & trackId, const uint8_t & audioOutputIndex) override; + bool HandleActivateTextTrack(const chip::CharSpan & trackId) override; + bool HandleDeactivateTextTrack() override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; diff --git a/examples/tv-app/android/java/AppImpl.h b/examples/tv-app/android/java/AppImpl.h index 657d7e92c0299a..7d6bf20c7bb37c 100644 --- a/examples/tv-app/android/java/AppImpl.h +++ b/examples/tv-app/android/java/AppImpl.h @@ -35,6 +35,8 @@ #include "../include/account-login/AccountLoginManager.h" #include "../include/application-basic/ApplicationBasicManager.h" #include "../include/application-launcher/ApplicationLauncherManager.h" +#include "../include/content-app-observer/ContentAppObserver.h" +#include "../include/content-control/ContentController.h" #include "../include/content-launcher/AppContentLauncherManager.h" #include "../include/media-playback/AppMediaPlaybackManager.h" #include "../include/target-navigator/TargetNavigatorManager.h" @@ -47,6 +49,8 @@ #include #include #include +#include +#include #include #include #include @@ -72,6 +76,8 @@ using ApplicationBasicDelegate = app::Clusters::ApplicationBasic::Delegate; using ApplicationLauncherDelegate = app::Clusters::ApplicationLauncher::Delegate; using ChannelDelegate = app::Clusters::Channel::Delegate; using ContentLauncherDelegate = app::Clusters::ContentLauncher::Delegate; +using ContentAppObserverDelegate = app::Clusters::ContentAppObserver::Delegate; +using ContentControlDelegate = app::Clusters::ContentControl::Delegate; using KeypadInputDelegate = app::Clusters::KeypadInput::Delegate; using MediaPlaybackDelegate = app::Clusters::MediaPlayback::Delegate; using TargetNavigatorDelegate = app::Clusters::TargetNavigator::Delegate; @@ -112,6 +118,16 @@ class DLL_EXPORT ContentAppImpl : public ContentApp mContentLauncherDelegate.SetEndpointId(GetEndpointId()); return &mContentLauncherDelegate; }; + ContentAppObserverDelegate * GetContentAppObserverDelegate() override + { + mContentAppObserverDelegate.SetEndpointId(GetEndpointId()); + return &mContentAppObserverDelegate; + }; + ContentControlDelegate * GetContentControlDelegate() override + { + mContentControlDelegate.SetEndpointId(GetEndpointId()); + return &mContentControlDelegate; + }; KeypadInputDelegate * GetKeypadInputDelegate() override { return &mKeypadInputDelegate; }; MediaPlaybackDelegate * GetMediaPlaybackDelegate() override { @@ -129,6 +145,8 @@ class DLL_EXPORT ContentAppImpl : public ContentApp AccountLoginManager mAccountLoginDelegate; ApplicationLauncherManager mApplicationLauncherDelegate; ChannelManager mChannelDelegate; + ContentController mContentControlDelegate; + ContentAppObserver mContentAppObserverDelegate; AppContentLauncherManager mContentLauncherDelegate; KeypadInputManager mKeypadInputDelegate; AppMediaPlaybackManager mMediaPlaybackDelegate; diff --git a/examples/tv-app/android/java/ChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp index 098b9af180c7a7..586e56bf99b27f 100644 --- a/examples/tv-app/android/java/ChannelManager.cpp +++ b/examples/tv-app/android/java/ChannelManager.cpp @@ -355,6 +355,40 @@ bool ChannelManager::HandleSkipChannel(const int16_t & count) return static_cast(ret); } +void ChannelManager::HandleGetProgramGuide( + CommandResponseHelper & helper, const chip::Optional & startTime, + const chip::Optional & endTime, + const chip::Optional> & channelList, + const chip::Optional & pageToken, const chip::Optional> & recordingFlag, + const chip::Optional> & externalIdList, + const chip::Optional & data) +{ + + // 1. Decode received parameters + // 2. Perform search + // 3. Return results + ProgramGuideResponseType response; + // response.channelPagingStruct; + // response.programList; + helper.Success(response); +} + +bool ChannelManager::HandleRecordProgram(const chip::CharSpan & programIdentifier, bool shouldRecordSeries, + const DataModel::DecodableList & externalIdList, + const chip::ByteSpan & data) +{ + // Start recording + return true; +} + +bool ChannelManager::HandleCancelRecordProgram(const chip::CharSpan & programIdentifier, bool shouldRecordSeries, + const DataModel::DecodableList & externalIdList, + const chip::ByteSpan & data) +{ + // Cancel recording + return true; +} + void ChannelManager::InitializeWithObjects(jobject managerObject) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); diff --git a/examples/tv-app/android/java/ChannelManager.h b/examples/tv-app/android/java/ChannelManager.h index 77221069c30fc1..fca3d03056f0fe 100644 --- a/examples/tv-app/android/java/ChannelManager.h +++ b/examples/tv-app/android/java/ChannelManager.h @@ -25,6 +25,12 @@ using chip::app::AttributeValueEncoder; using chip::app::CommandResponseHelper; using ChannelDelegate = chip::app::Clusters::Channel::Delegate; using ChangeChannelResponseType = chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Type; +using RecordingFlagBitmap = chip::app::Clusters::Channel::RecordingFlagBitmap; +using ProgramGuideResponseType = chip::app::Clusters::Channel::Commands::ProgramGuideResponse::Type; +using ChannelInfoType = chip::app::Clusters::Channel::Structs::ChannelInfoStruct::Type; +using AdditionalInfoType = chip::app::Clusters::Channel::Structs::AdditionalInfoStruct::Type; +using LineupInfoType = chip::app::Clusters::Channel::Structs::LineupInfoStruct::Type; +using PageTokenType = chip::app::Clusters::Channel::Structs::PageTokenStruct::Type; class ChannelManager : public ChannelDelegate { @@ -39,6 +45,21 @@ class ChannelManager : public ChannelDelegate void HandleChangeChannel(CommandResponseHelper & helper, const CharSpan & match) override; bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) override; bool HandleSkipChannel(const int16_t & count) override; + void HandleGetProgramGuide(CommandResponseHelper & helper, const chip::Optional & startTime, + const chip::Optional & endTime, + const chip::Optional> & channelList, + const chip::Optional & pageToken, + const chip::Optional> & recordingFlag, + const chip::Optional> & externalIdList, + const chip::Optional & data) override; + + bool HandleRecordProgram(const chip::CharSpan & programIdentifier, bool shouldRecordSeries, + const chip::app::DataModel::DecodableList & externalIdList, + const chip::ByteSpan & data) override; + + bool HandleCancelRecordProgram(const chip::CharSpan & programIdentifier, bool shouldRecordSeries, + const chip::app::DataModel::DecodableList & externalIdList, + const chip::ByteSpan & data) override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; diff --git a/examples/tv-app/android/java/ContentLauncherManager.cpp b/examples/tv-app/android/java/ContentLauncherManager.cpp index e57ad4c3a76270..ee2f36c1667666 100644 --- a/examples/tv-app/android/java/ContentLauncherManager.cpp +++ b/examples/tv-app/android/java/ContentLauncherManager.cpp @@ -47,7 +47,9 @@ void ContentLauncherManager::NewManager(jint endpoint, jobject manager) void ContentLauncherManager::HandleLaunchContent(CommandResponseHelper & helper, const DecodableList & parameterList, bool autoplay, - const chip::CharSpan & data) + const chip::CharSpan & data, + const chip::Optional playbackPreferences, + bool useCurrentContext) { Commands::LauncherResponse::Type response; CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/examples/tv-app/android/java/ContentLauncherManager.h b/examples/tv-app/android/java/ContentLauncherManager.h index ba978500c2e3e5..ac65dcaac0dc71 100644 --- a/examples/tv-app/android/java/ContentLauncherManager.h +++ b/examples/tv-app/android/java/ContentLauncherManager.h @@ -30,6 +30,7 @@ using ContentLauncherDelegate = chip::app::Clusters::ContentLauncher::Delegate; using LaunchResponseType = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Type; using ParameterType = chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::DecodableType; using BrandingInformationType = chip::app::Clusters::ContentLauncher::Structs::BrandingInformationStruct::Type; +using PlaybackPreferencesType = chip::app::Clusters::ContentLauncher::Structs::PlaybackPreferencesStruct::DecodableType; class ContentLauncherManager : public ContentLauncherDelegate { @@ -39,7 +40,8 @@ class ContentLauncherManager : public ContentLauncherDelegate void HandleLaunchContent(CommandResponseHelper & helper, const chip::app::DataModel::DecodableList & parameterList, bool autoplay, - const CharSpan & data) override; + const CharSpan & data, const chip::Optional playbackPreferences, + bool useCurrentContext) override; void HandleLaunchUrl(CommandResponseHelper & helper, const CharSpan & contentUrl, const CharSpan & displayString, const BrandingInformationType & brandingInformation) override; CHIP_ERROR HandleGetAcceptHeaderList(AttributeValueEncoder & aEncoder) override; diff --git a/examples/tv-app/android/java/MediaPlaybackManager.cpp b/examples/tv-app/android/java/MediaPlaybackManager.cpp index 53a7066551cd22..30931a48709a0f 100644 --- a/examples/tv-app/android/java/MediaPlaybackManager.cpp +++ b/examples/tv-app/android/java/MediaPlaybackManager.cpp @@ -90,6 +90,44 @@ uint64_t MediaPlaybackManager::HandleGetSeekRangeEnd() return HandleMediaRequestGetAttribute(MEDIA_PLAYBACK_ATTRIBUTE_SEEK_RANGE_END); } +CHIP_ERROR MediaPlaybackManager::HandleGetActiveAudioTrack(AttributeValueEncoder & aEncoder) +{ + TrackType mActiveAudioTrack; + return aEncoder.Encode(mActiveAudioTrack); +} + +CHIP_ERROR MediaPlaybackManager::HandleGetAvailableAudioTracks(AttributeValueEncoder & aEncoder) +{ + std::vector mAvailableAudioTracks; + // TODO: Insert code here + return aEncoder.EncodeList([mAvailableAudioTracks](const auto & encoder) -> CHIP_ERROR { + for (auto const & audioTrack : mAvailableAudioTracks) + { + ReturnErrorOnFailure(encoder.Encode(audioTrack)); + } + return CHIP_NO_ERROR; + }); +} + +CHIP_ERROR MediaPlaybackManager::HandleGetActiveTextTrack(AttributeValueEncoder & aEncoder) +{ + TrackType mActiveTextTrack; + return aEncoder.Encode(mActiveTextTrack); +} + +CHIP_ERROR MediaPlaybackManager::HandleGetAvailableTextTracks(AttributeValueEncoder & aEncoder) +{ + std::vector mAvailableTextTracks; + // TODO: Insert code here + return aEncoder.EncodeList([mAvailableTextTracks](const auto & encoder) -> CHIP_ERROR { + for (auto const & textTrack : mAvailableTextTracks) + { + ReturnErrorOnFailure(encoder.Encode(textTrack)); + } + return CHIP_NO_ERROR; + }); +} + void MediaPlaybackManager::HandlePlay(CommandResponseHelper & helper) { helper.Success(HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_PLAY, 0)); @@ -105,7 +143,8 @@ void MediaPlaybackManager::HandleStop(CommandResponseHelper & helper) +void MediaPlaybackManager::HandleFastForward(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) { helper.Success(HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_FAST_FORWARD, 0)); } @@ -115,7 +154,8 @@ void MediaPlaybackManager::HandlePrevious(CommandResponseHelper & helper) +void MediaPlaybackManager::HandleRewind(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) { helper.Success(HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_REWIND, 0)); } @@ -148,6 +188,27 @@ void MediaPlaybackManager::HandleStartOver(CommandResponseHelper #include #include +#include enum MediaPlaybackRequestAttribute : uint8_t { - MEDIA_PLAYBACK_ATTRIBUTE_PLAYBACK_STATE = 0, - MEDIA_PLAYBACK_ATTRIBUTE_START_TIME = 1, - MEDIA_PLAYBACK_ATTRIBUTE_DURATION = 2, - MEDIA_PLAYBACK_ATTRIBUTE_SPEED = 3, - MEDIA_PLAYBACK_ATTRIBUTE_SEEK_RANGE_END = 4, - MEDIA_PLAYBACK_ATTRIBUTE_SEEK_RANGE_START = 5, + MEDIA_PLAYBACK_ATTRIBUTE_PLAYBACK_STATE = 0, + MEDIA_PLAYBACK_ATTRIBUTE_START_TIME = 1, + MEDIA_PLAYBACK_ATTRIBUTE_DURATION = 2, + MEDIA_PLAYBACK_ATTRIBUTE_SPEED = 3, + MEDIA_PLAYBACK_ATTRIBUTE_SEEK_RANGE_END = 4, + MEDIA_PLAYBACK_ATTRIBUTE_SEEK_RANGE_START = 5, + MEDIA_PLAYBACK_ATTRIBUTE_ACTIVE_AUDIO_TRACK = 6, + MEDIA_PLAYBACK_ATTRIBUTE_AVAILABLE_AUDIO_TRACKS = 7, + MEDIA_PLAYBACK_ATTRIBUTE_ACTIVE_TEXT_TRACK = 8, + MEDIA_PLAYBACK_ATTRIBUTE_AVAILABLE_TEXT_TRACKS = 9, MEDIA_PLAYBACK_ATTRIBUTE_COUNT, }; enum MediaPlaybackRequest : uint8_t { - MEDIA_PLAYBACK_REQUEST_PLAY = 0, - MEDIA_PLAYBACK_REQUEST_PAUSE = 1, - MEDIA_PLAYBACK_REQUEST_STOP = 2, - MEDIA_PLAYBACK_REQUEST_START_OVER = 3, - MEDIA_PLAYBACK_REQUEST_PREVIOUS = 4, - MEDIA_PLAYBACK_REQUEST_NEXT = 5, - MEDIA_PLAYBACK_REQUEST_REWIND = 6, - MEDIA_PLAYBACK_REQUEST_FAST_FORWARD = 7, - MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD = 8, - MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD = 9, - MEDIA_PLAYBACK_REQUEST_SEEK = 10, + MEDIA_PLAYBACK_REQUEST_PLAY = 0, + MEDIA_PLAYBACK_REQUEST_PAUSE = 1, + MEDIA_PLAYBACK_REQUEST_STOP = 2, + MEDIA_PLAYBACK_REQUEST_START_OVER = 3, + MEDIA_PLAYBACK_REQUEST_PREVIOUS = 4, + MEDIA_PLAYBACK_REQUEST_NEXT = 5, + MEDIA_PLAYBACK_REQUEST_REWIND = 6, + MEDIA_PLAYBACK_REQUEST_FAST_FORWARD = 7, + MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD = 8, + MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD = 9, + MEDIA_PLAYBACK_REQUEST_SEEK = 10, + MEDIA_PLAYBACK_REQUEST_ACTIVATE_AUDIO_TRACK = 11, + MEDIA_PLAYBACK_REQUEST_ACTIVATE_TEXT_TRACK = 12, + MEDIA_PLAYBACK_REQUEST_DEACTIVATE_TEXT_TRACK = 13, }; using chip::app::AttributeValueEncoder; using chip::app::CommandResponseHelper; using MediaPlaybackDelegate = chip::app::Clusters::MediaPlayback::Delegate; using PlaybackResponseType = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type; +using TrackType = chip::app::Clusters::MediaPlayback::Structs::TrackStruct::Type; class MediaPlaybackManager : public MediaPlaybackDelegate { @@ -66,13 +75,19 @@ class MediaPlaybackManager : public MediaPlaybackDelegate float HandleGetPlaybackSpeed() override; uint64_t HandleGetSeekRangeStart() override; uint64_t HandleGetSeekRangeEnd() override; + CHIP_ERROR HandleGetActiveAudioTrack(AttributeValueEncoder & aEncoder) override; + CHIP_ERROR HandleGetAvailableAudioTracks(AttributeValueEncoder & aEncoder) override; + CHIP_ERROR HandleGetActiveTextTrack(AttributeValueEncoder & aEncoder) override; + CHIP_ERROR HandleGetAvailableTextTracks(AttributeValueEncoder & aEncoder) override; void HandlePlay(CommandResponseHelper & helper) override; void HandlePause(CommandResponseHelper & helper) override; void HandleStop(CommandResponseHelper & helper) override; - void HandleFastForward(CommandResponseHelper & helper) override; + void HandleFastForward(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) override; void HandlePrevious(CommandResponseHelper & helper) override; - void HandleRewind(CommandResponseHelper & helper) override; + void HandleRewind(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) override; void HandleSkipBackward(CommandResponseHelper & helper, const uint64_t & deltaPositionMilliseconds) override; void HandleSkipForward(CommandResponseHelper & helper, @@ -80,6 +95,9 @@ class MediaPlaybackManager : public MediaPlaybackDelegate void HandleSeek(CommandResponseHelper & helper, const uint64_t & positionMilliseconds) override; void HandleNext(CommandResponseHelper & helper) override; void HandleStartOver(CommandResponseHelper & helper) override; + bool HandleActivateAudioTrack(const chip::CharSpan & trackId, const uint8_t & audioOutputIndex) override; + bool HandleActivateTextTrack(const chip::CharSpan & trackId) override; + bool HandleDeactivateTextTrack() override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; diff --git a/examples/tv-app/tv-common/BUILD.gn b/examples/tv-app/tv-common/BUILD.gn index 03d98b3227c82d..b24fd24839bdb3 100644 --- a/examples/tv-app/tv-common/BUILD.gn +++ b/examples/tv-app/tv-common/BUILD.gn @@ -52,6 +52,10 @@ source_set("tv-common-sources") { "clusters/audio-output/AudioOutputManager.h", "clusters/channel/ChannelManager.cpp", "clusters/channel/ChannelManager.h", + "clusters/content-app-observer/ContentAppObserver.cpp", + "clusters/content-app-observer/ContentAppObserver.h", + "clusters/content-control/ContentController.cpp", + "clusters/content-control/ContentController.h", "clusters/content-launcher/ContentLauncherManager.cpp", "clusters/content-launcher/ContentLauncherManager.h", "clusters/keypad-input/KeypadInputManager.cpp", diff --git a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp index d5f70305716d29..1127d3a8aea35c 100644 --- a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp +++ b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp @@ -28,7 +28,8 @@ AccountLoginManager::AccountLoginManager(const char * setupPin) CopyString(mSetupPin, sizeof(mSetupPin), setupPin); } -bool AccountLoginManager::HandleLogin(const CharSpan & tempAccountIdentifier, const CharSpan & setupPin) +bool AccountLoginManager::HandleLogin(const CharSpan & tempAccountIdentifier, const CharSpan & setupPin, + const chip::Optional & nodeId) { string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size()); string setupPinString(setupPin.data(), setupPin.size()); @@ -45,7 +46,7 @@ bool AccountLoginManager::HandleLogin(const CharSpan & tempAccountIdentifier, co return false; } -bool AccountLoginManager::HandleLogout() +bool AccountLoginManager::HandleLogout(const chip::Optional & nodeId) { // TODO: Insert your code here to send logout request ChipLogProgress(Zcl, "AccountLoginManager::HandleLogout success"); diff --git a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.h b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.h index 86326f9440a610..4d6f53759b56d3 100644 --- a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.h +++ b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.h @@ -36,8 +36,9 @@ class AccountLoginManager : public AccountLoginDelegate inline void SetSetupPin(char * setupPin) override { CopyString(mSetupPin, sizeof(mSetupPin), setupPin); }; - bool HandleLogin(const CharSpan & tempAccountIdentifierString, const CharSpan & setupPinString) override; - bool HandleLogout() override; + bool HandleLogin(const CharSpan & tempAccountIdentifierString, const CharSpan & setupPinString, + const chip::Optional & nodeId) override; + bool HandleLogout(const chip::Optional & nodeId) override; void HandleGetSetupPin(CommandResponseHelper & helper, const CharSpan & tempAccountIdentifierString) override; inline void GetSetupPin(char * setupPin, size_t setupPinSize, const CharSpan & tempAccountIdentifierString) override diff --git a/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp b/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp index d057a631ea372d..59b00e828aff26 100644 --- a/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp +++ b/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp @@ -191,6 +191,40 @@ bool ChannelManager::HandleSkipChannel(const int16_t & count) return true; } +void ChannelManager::HandleGetProgramGuide( + CommandResponseHelper & helper, const chip::Optional & startTime, + const chip::Optional & endTime, + const chip::Optional> & channelList, + const chip::Optional & pageToken, const chip::Optional> & recordingFlag, + const chip::Optional> & externalIdList, + const chip::Optional & data) +{ + + // 1. Decode received parameters + // 2. Perform search + // 3. Return results + ProgramGuideResponseType response; + // response.channelPagingStruct; + // response.programList; + helper.Success(response); +} + +bool ChannelManager::HandleRecordProgram(const chip::CharSpan & programIdentifier, bool shouldRecordSeries, + const DataModel::DecodableList & externalIdList, + const chip::ByteSpan & data) +{ + // Start recording + return true; +} + +bool ChannelManager::HandleCancelRecordProgram(const chip::CharSpan & programIdentifier, bool shouldRecordSeries, + const DataModel::DecodableList & externalIdList, + const chip::ByteSpan & data) +{ + // Cancel recording + return true; +} + uint32_t ChannelManager::GetFeatureMap(chip::EndpointId endpoint) { if (endpoint >= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) diff --git a/examples/tv-app/tv-common/clusters/channel/ChannelManager.h b/examples/tv-app/tv-common/clusters/channel/ChannelManager.h index 326edddc53cc77..68c473e74dc70d 100644 --- a/examples/tv-app/tv-common/clusters/channel/ChannelManager.h +++ b/examples/tv-app/tv-common/clusters/channel/ChannelManager.h @@ -23,10 +23,14 @@ using chip::CharSpan; using chip::app::AttributeValueEncoder; using chip::app::CommandResponseHelper; +using RecordingFlagBitmap = chip::app::Clusters::Channel::RecordingFlagBitmap; using ChannelDelegate = chip::app::Clusters::Channel::Delegate; using ChangeChannelResponseType = chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Type; +using ProgramGuideResponseType = chip::app::Clusters::Channel::Commands::ProgramGuideResponse::Type; using ChannelInfoType = chip::app::Clusters::Channel::Structs::ChannelInfoStruct::Type; +using AdditionalInfoType = chip::app::Clusters::Channel::Structs::AdditionalInfoStruct::Type; using LineupInfoType = chip::app::Clusters::Channel::Structs::LineupInfoStruct::Type; +using PageTokenType = chip::app::Clusters::Channel::Structs::PageTokenStruct::Type; class ChannelManager : public ChannelDelegate { @@ -40,6 +44,21 @@ class ChannelManager : public ChannelDelegate void HandleChangeChannel(CommandResponseHelper & helper, const CharSpan & match) override; bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) override; bool HandleSkipChannel(const int16_t & count) override; + void HandleGetProgramGuide(CommandResponseHelper & helper, const chip::Optional & startTime, + const chip::Optional & endTime, + const chip::Optional> & channelList, + const chip::Optional & pageToken, + const chip::Optional> & recordingFlag, + const chip::Optional> & externalIdList, + const chip::Optional & data) override; + + bool HandleRecordProgram(const chip::CharSpan & programIdentifier, bool shouldRecordSeries, + const chip::app::DataModel::DecodableList & externalIdList, + const chip::ByteSpan & data) override; + + bool HandleCancelRecordProgram(const chip::CharSpan & programIdentifier, bool shouldRecordSeries, + const chip::app::DataModel::DecodableList & externalIdList, + const chip::ByteSpan & data) override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; diff --git a/examples/tv-app/tv-common/clusters/content-app-observer/ContentAppObserver.cpp b/examples/tv-app/tv-common/clusters/content-app-observer/ContentAppObserver.cpp new file mode 100644 index 00000000000000..7145ba24305f21 --- /dev/null +++ b/examples/tv-app/tv-common/clusters/content-app-observer/ContentAppObserver.cpp @@ -0,0 +1,36 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ContentAppObserver.h" + +#include +#include + +using namespace std; +using namespace chip; +using namespace chip::app::Clusters::ContentAppObserver; + +ContentAppObserver::ContentAppObserver() +{ + // Create Test Data +} + +void ContentAppObserver::HandleContentAppMessage(chip::app::CommandResponseHelper & helper, + const chip::Optional & data, const chip::CharSpan & encodingHint) +{ + ChipLogProgress(Zcl, "ContentAppObserver::HandleContentAppMessage"); +} diff --git a/examples/tv-app/tv-common/clusters/content-app-observer/ContentAppObserver.h b/examples/tv-app/tv-common/clusters/content-app-observer/ContentAppObserver.h new file mode 100644 index 00000000000000..07ba89b2de3a1a --- /dev/null +++ b/examples/tv-app/tv-common/clusters/content-app-observer/ContentAppObserver.h @@ -0,0 +1,37 @@ +/* + * + * 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 + +using ContentAppObserverDelegate = chip::app::Clusters::ContentAppObserver::Delegate; +using ContentAppMessageResponse = chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::Type; + +class ContentAppObserver : public ContentAppObserverDelegate +{ +public: + ContentAppObserver(); + + void HandleContentAppMessage(chip::app::CommandResponseHelper & helper, + const chip::Optional & data, const chip::CharSpan & encodingHint) override; + +protected: +}; diff --git a/examples/tv-app/tv-common/clusters/content-control/ContentController.cpp b/examples/tv-app/tv-common/clusters/content-control/ContentController.cpp new file mode 100644 index 00000000000000..c4eee0355f4552 --- /dev/null +++ b/examples/tv-app/tv-common/clusters/content-control/ContentController.cpp @@ -0,0 +1,106 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ContentController.h" +#include +#include + +using namespace std; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters::ContentControl; + +ContentController::ContentController() +{ + // Create Test Data +} + +// Attribute Delegates +bool ContentController::HandleGetEnabled() +{ + return false; +} + +CHIP_ERROR ContentController::HandleGetOnDemandRatings(chip::app::AttributeValueEncoder & aEncoder) +{ + return aEncoder.Encode(chip::CharSpan()); +} + +chip::CharSpan ContentController::HandleGetOnDemandRatingThreshold() +{ + return chip::CharSpan(); +} + +CHIP_ERROR ContentController::HandleGetScheduledContentRatings(chip::app::AttributeValueEncoder & aEncoder) +{ + return aEncoder.Encode(chip::CharSpan()); +} + +chip::CharSpan ContentController::HandleGetScheduledContentRatingThreshold() +{ + return chip::CharSpan(); +} + +uint32_t ContentController::HandleGetScreenDailyTime() +{ + return (uint32_t) 0xFFFFFFFF; +} + +uint32_t ContentController::HandleGetRemainingScreenTime() +{ + return (uint32_t) 0xFFFFFFFF; +} + +bool ContentController::HandleGetBlockUnrated() +{ + return false; +} + +// Command Delegates +void ContentController::HandleUpdatePIN(chip::Optional oldPIN, chip::CharSpan newPIN) {} + +void ContentController::HandleResetPIN(chip::app::CommandResponseHelper & helper) {} + +void ContentController::HandleEnable() {} + +void ContentController::HandleDisable() {} + +void ContentController::HandleAddBonusTime(chip::Optional PINCode, chip::Optional bonusTime) {} + +void ContentController::HandleSetScreenDailyTime(uint32_t screenDailyTime) {} + +void ContentController::HandleBlockUnratedContent() {} + +void ContentController::HandleUnblockUnratedContent() {} + +void ContentController::HandleSetOnDemandRatingThreshold(chip::CharSpan rating) {} + +void ContentController::HandleSetScheduledContentRatingThreshold(chip::CharSpan rating) {} + +uint32_t ContentController::GetFeatureMap(chip::EndpointId endpoint) +{ + if (endpoint >= EMBER_AF_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT) + { + return mDynamicEndpointFeatureMap; + } + + uint32_t featureMap = 0; + // TODO: ReEnable the code bellow + // Attributes::FeatureMap::Get(endpoint, &featureMap); + return featureMap; +} diff --git a/examples/tv-app/tv-common/clusters/content-control/ContentController.h b/examples/tv-app/tv-common/clusters/content-control/ContentController.h new file mode 100644 index 00000000000000..01636f37fcb772 --- /dev/null +++ b/examples/tv-app/tv-common/clusters/content-control/ContentController.h @@ -0,0 +1,61 @@ +/* + * + * 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 + +using ContentControlDelegate = chip::app::Clusters::ContentControl::Delegate; +using ResetPINResponseType = chip::app::Clusters::ContentControl::Commands::ResetPINResponse::Type; + +class ContentController : public ContentControlDelegate +{ +public: + ContentController(); + + // Attribute Delegates + bool HandleGetEnabled() override; + CHIP_ERROR HandleGetOnDemandRatings(chip::app::AttributeValueEncoder & aEncoder) override; + chip::CharSpan HandleGetOnDemandRatingThreshold() override; + CHIP_ERROR HandleGetScheduledContentRatings(chip::app::AttributeValueEncoder & aEncoder) override; + chip::CharSpan HandleGetScheduledContentRatingThreshold() override; + uint32_t HandleGetScreenDailyTime() override; + uint32_t HandleGetRemainingScreenTime() override; + bool HandleGetBlockUnrated() override; + + // Command Delegates + void HandleUpdatePIN(chip::Optional oldPIN, chip::CharSpan newPIN) override; + void HandleResetPIN(chip::app::CommandResponseHelper & helper) override; + void HandleEnable() override; + void HandleDisable() override; + void HandleAddBonusTime(chip::Optional PINCode, chip::Optional bonusTime) override; + void HandleSetScreenDailyTime(uint32_t screenDailyTime) override; + void HandleBlockUnratedContent() override; + void HandleUnblockUnratedContent() override; + void HandleSetOnDemandRatingThreshold(chip::CharSpan rating) override; + void HandleSetScheduledContentRatingThreshold(chip::CharSpan rating) override; + + uint32_t GetFeatureMap(chip::EndpointId endpoint) override; + +protected: +private: + // TODO: set this based upon meta data from app + uint32_t mDynamicEndpointFeatureMap = 3; +}; diff --git a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp index 5ad2dfa0c11f2b..ff2da45d7db461 100644 --- a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp +++ b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp @@ -95,7 +95,9 @@ ContentLauncherManager::ContentLauncherManager(list acceptHeaderLis void ContentLauncherManager::HandleLaunchContent(CommandResponseHelper & helper, const DecodableList & parameterList, bool autoplay, - const CharSpan & data) + const CharSpan & data, + const chip::Optional playbackPreferences, + bool useCurrentContext) { ChipLogProgress(Zcl, "ContentLauncherManager::HandleLaunchContent"); string dataString(data.data(), data.size()); @@ -103,6 +105,9 @@ void ContentLauncherManager::HandleLaunchContent(CommandResponseHelpermContentList) { diff --git a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h index d08e708a4158da..51c5b1ab4b765e 100644 --- a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h +++ b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h @@ -29,6 +29,7 @@ using ContentLauncherDelegate = chip::app::Clusters::ContentLauncher::Delegate; using LaunchResponseType = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Type; using ParameterType = chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::DecodableType; using BrandingInformationType = chip::app::Clusters::ContentLauncher::Structs::BrandingInformationStruct::Type; +using PlaybackPreferencesType = chip::app::Clusters::ContentLauncher::Structs::PlaybackPreferencesStruct::DecodableType; class ContentEntry { @@ -45,7 +46,8 @@ class ContentLauncherManager : public ContentLauncherDelegate void HandleLaunchContent(CommandResponseHelper & helper, const chip::app::DataModel::DecodableList & parameterList, bool autoplay, - const CharSpan & data) override; + const CharSpan & data, const chip::Optional playbackPreferences, + bool useCurrentContext) override; void HandleLaunchUrl(CommandResponseHelper & helper, const CharSpan & contentUrl, const CharSpan & displayString, const BrandingInformationType & brandingInformation) override; CHIP_ERROR HandleGetAcceptHeaderList(AttributeValueEncoder & aEncoder) override; diff --git a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp index 6d018d6522ede8..6eb71bd53a96bd 100644 --- a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp +++ b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp @@ -60,6 +60,40 @@ uint64_t MediaPlaybackManager::HandleGetSeekRangeEnd() return mDuration; } +CHIP_ERROR MediaPlaybackManager::HandleGetActiveAudioTrack(AttributeValueEncoder & aEncoder) +{ + return aEncoder.Encode(mActiveAudioTrack); +} + +CHIP_ERROR MediaPlaybackManager::HandleGetAvailableAudioTracks(AttributeValueEncoder & aEncoder) +{ + // TODO: Insert code here + return aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { + for (auto const & audioTrack : mAvailableAudioTracks) + { + ReturnErrorOnFailure(encoder.Encode(audioTrack)); + } + return CHIP_NO_ERROR; + }); +} + +CHIP_ERROR MediaPlaybackManager::HandleGetActiveTextTrack(AttributeValueEncoder & aEncoder) +{ + return aEncoder.Encode(mActiveTextTrack); +} + +CHIP_ERROR MediaPlaybackManager::HandleGetAvailableTextTracks(AttributeValueEncoder & aEncoder) +{ + // TODO: Insert code here + return aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { + for (auto const & textTrack : mAvailableTextTracks) + { + ReturnErrorOnFailure(encoder.Encode(textTrack)); + } + return CHIP_NO_ERROR; + }); +} + void MediaPlaybackManager::HandlePlay(CommandResponseHelper & helper) { // TODO: Insert code here @@ -97,7 +131,8 @@ void MediaPlaybackManager::HandleStop(CommandResponseHelper & helper) +void MediaPlaybackManager::HandleFastForward(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) { // TODO: Insert code here if (mPlaybackSpeed == kPlaybackMaxForwardSpeed) @@ -137,7 +172,8 @@ void MediaPlaybackManager::HandlePrevious(CommandResponseHelper & helper) +void MediaPlaybackManager::HandleRewind(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) { // TODO: Insert code here if (mPlaybackSpeed == kPlaybackMaxRewindSpeed) @@ -239,6 +275,56 @@ void MediaPlaybackManager::HandleStartOver(CommandResponseHelper= EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT) diff --git a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.h b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.h index 9c0f8ce52f80e7..54fc9de5b67e87 100644 --- a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.h +++ b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.h @@ -19,12 +19,15 @@ #pragma once #include +#include using chip::app::AttributeValueEncoder; using chip::app::CommandResponseHelper; using MediaPlaybackDelegate = chip::app::Clusters::MediaPlayback::Delegate; using PlaybackResponseType = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type; using PlaybackPositionType = chip::app::Clusters::MediaPlayback::Structs::PlaybackPositionStruct::Type; +using TrackType = chip::app::Clusters::MediaPlayback::Structs::TrackStruct::Type; +using TrackAttributesType = chip::app::Clusters::MediaPlayback::Structs::TrackAttributesStruct::Type; class MediaPlaybackManager : public MediaPlaybackDelegate { @@ -36,13 +39,19 @@ class MediaPlaybackManager : public MediaPlaybackDelegate float HandleGetPlaybackSpeed() override; uint64_t HandleGetSeekRangeStart() override; uint64_t HandleGetSeekRangeEnd() override; + CHIP_ERROR HandleGetActiveAudioTrack(AttributeValueEncoder & aEncoder) override; + CHIP_ERROR HandleGetAvailableAudioTracks(AttributeValueEncoder & aEncoder) override; + CHIP_ERROR HandleGetActiveTextTrack(AttributeValueEncoder & aEncoder) override; + CHIP_ERROR HandleGetAvailableTextTracks(AttributeValueEncoder & aEncoder) override; void HandlePlay(CommandResponseHelper & helper) override; void HandlePause(CommandResponseHelper & helper) override; void HandleStop(CommandResponseHelper & helper) override; - void HandleFastForward(CommandResponseHelper & helper) override; + void HandleFastForward(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) override; void HandlePrevious(CommandResponseHelper & helper) override; - void HandleRewind(CommandResponseHelper & helper) override; + void HandleRewind(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) override; void HandleSkipBackward(CommandResponseHelper & helper, const uint64_t & deltaPositionMilliseconds) override; void HandleSkipForward(CommandResponseHelper & helper, @@ -50,6 +59,9 @@ class MediaPlaybackManager : public MediaPlaybackDelegate void HandleSeek(CommandResponseHelper & helper, const uint64_t & positionMilliseconds) override; void HandleNext(CommandResponseHelper & helper) override; void HandleStartOver(CommandResponseHelper & helper) override; + bool HandleActivateAudioTrack(const chip::CharSpan & trackId, const uint8_t & audioOutputIndex) override; + bool HandleActivateTextTrack(const chip::CharSpan & trackId) override; + bool HandleDeactivateTextTrack() override; uint32_t GetFeatureMap(chip::EndpointId endpoint) override; @@ -58,11 +70,46 @@ class MediaPlaybackManager : public MediaPlaybackDelegate // the CI test cases expect these values, and need to be fixed. chip::app::Clusters::MediaPlayback::PlaybackStateEnum mCurrentState = chip::app::Clusters::MediaPlayback::PlaybackStateEnum::kPlaying; - PlaybackPositionType mPlaybackPosition = { 0, chip::app::DataModel::Nullable(0) }; - float mPlaybackSpeed = 0; - uint64_t mStartTime = 0; + PlaybackPositionType mPlaybackPosition = { 0, chip::app::DataModel::Nullable(0) }; + TrackType mActiveAudioTrack = { chip::CharSpan("activeAudioTrackId_0", 20), + chip::app::DataModel::Nullable( + { chip::CharSpan("languageCode", 12), + chip::Optional>( + { chip::app::DataModel::MakeNullable(chip::CharSpan("displayName", 11)) }) }) }; + std::vector mAvailableAudioTracks = { + { chip::CharSpan("activeAudioTrackId_0", 20), + chip::app::DataModel::Nullable( + { chip::CharSpan("languageCode", 12), + chip::Optional>( + { chip::app::DataModel::MakeNullable(chip::CharSpan("displayName", 11)) }) }) }, + { chip::CharSpan("activeAudioTrackId_1", 20), + chip::app::DataModel::Nullable( + { chip::CharSpan("languageCode", 12), + chip::Optional>( + { chip::app::DataModel::MakeNullable(chip::CharSpan("displayName", 11)) }) }) } + }; + TrackType mActiveTextTrack = { chip::CharSpan("activeTextTrackId_0", 20), + chip::app::DataModel::Nullable( + { chip::CharSpan("languageCode", 12), + chip::Optional>( + { chip::app::DataModel::MakeNullable(chip::CharSpan("displayName", 11)) }) }) }; + std::vector mAvailableTextTracks = { + { chip::CharSpan("activeTextTrackId_0", 20), + chip::app::DataModel::Nullable( + { chip::CharSpan("languageCode", 12), + chip::Optional>( + { chip::app::DataModel::MakeNullable(chip::CharSpan("displayName", 11)) }) }) }, + { chip::CharSpan("activeTextTrackId_1", 20), + chip::app::DataModel::Nullable( + { chip::CharSpan("languageCode", 12), + chip::Optional>( + { chip::app::DataModel::MakeNullable(chip::CharSpan("displayName", 11)) }) }) } + }; + float mPlaybackSpeed = 0; + uint64_t mStartTime = 0; // Magic number for testing. - uint64_t mDuration = 80000; + uint64_t mDuration = 80000; + bool mAudioAdvanceMuted = false; static const int kPlaybackMaxForwardSpeed = 10; static const int kPlaybackMaxRewindSpeed = -10; diff --git a/examples/tv-app/tv-common/include/AppTv.h b/examples/tv-app/tv-common/include/AppTv.h index 5f02536b3b86d0..8bfdf558dd1465 100644 --- a/examples/tv-app/tv-common/include/AppTv.h +++ b/examples/tv-app/tv-common/include/AppTv.h @@ -33,6 +33,8 @@ #include "application-basic/ApplicationBasicManager.h" #include "application-launcher/ApplicationLauncherManager.h" #include "channel/ChannelManager.h" +#include "content-app-observer/ContentAppObserver.h" +#include "content-control/ContentController.h" #include "content-launcher/ContentLauncherManager.h" #include "keypad-input/KeypadInputManager.h" #include "media-playback/MediaPlaybackManager.h" @@ -57,6 +59,8 @@ using ApplicationBasicDelegate = app::Clusters::ApplicationBasic::Delegate; using ApplicationLauncherDelegate = app::Clusters::ApplicationLauncher::Delegate; using ChannelDelegate = app::Clusters::Channel::Delegate; using ContentLauncherDelegate = app::Clusters::ContentLauncher::Delegate; +using ContentControllerDelegate = app::Clusters::ContentControl::Delegate; +using ContentAppObserverDelegate = app::Clusters::ContentAppObserver::Delegate; using KeypadInputDelegate = app::Clusters::KeypadInput::Delegate; using MediaPlaybackDelegate = app::Clusters::MediaPlayback::Delegate; using TargetNavigatorDelegate = app::Clusters::TargetNavigator::Delegate; @@ -85,6 +89,8 @@ class DLL_EXPORT ContentAppImpl : public ContentApp ApplicationLauncherDelegate * GetApplicationLauncherDelegate() override { return &mApplicationLauncherDelegate; }; ChannelDelegate * GetChannelDelegate() override { return &mChannelDelegate; }; ContentLauncherDelegate * GetContentLauncherDelegate() override { return &mContentLauncherDelegate; }; + ContentControllerDelegate * GetContentControlDelegate() override { return &mContentControlDelegate; }; + ContentAppObserverDelegate * GetContentAppObserverDelegate() override { return &mContentAppObserverDelegate; }; KeypadInputDelegate * GetKeypadInputDelegate() override { return &mKeypadInputDelegate; }; MediaPlaybackDelegate * GetMediaPlaybackDelegate() override { return &mMediaPlaybackDelegate; }; TargetNavigatorDelegate * GetTargetNavigatorDelegate() override { return &mTargetNavigatorDelegate; }; @@ -95,6 +101,8 @@ class DLL_EXPORT ContentAppImpl : public ContentApp ApplicationLauncherManager mApplicationLauncherDelegate; ChannelManager mChannelDelegate; ContentLauncherManager mContentLauncherDelegate; + ContentAppObserver mContentAppObserverDelegate; + ContentController mContentControlDelegate; KeypadInputManager mKeypadInputDelegate; MediaPlaybackManager mMediaPlaybackDelegate; TargetNavigatorManager mTargetNavigatorDelegate; diff --git a/examples/tv-app/tv-common/src/ZCLCallbacks.cpp b/examples/tv-app/tv-common/src/ZCLCallbacks.cpp index 8522f1f3d71f5a..8a5416ff3569b4 100644 --- a/examples/tv-app/tv-common/src/ZCLCallbacks.cpp +++ b/examples/tv-app/tv-common/src/ZCLCallbacks.cpp @@ -31,6 +31,8 @@ #include "application-launcher/ApplicationLauncherManager.h" #include "audio-output/AudioOutputManager.h" #include "channel/ChannelManager.h" +#include "content-app-observer/ContentAppObserver.h" +#include "content-control/ContentController.h" #include "content-launcher/ContentLauncherManager.h" #include "keypad-input/KeypadInputManager.h" #include "low-power/LowPowerManager.h" diff --git a/examples/tv-app/tv-common/tv-app.cmake b/examples/tv-app/tv-common/tv-app.cmake index cf257b8073fd1b..bfa554d0e77ec5 100644 --- a/examples/tv-app/tv-common/tv-app.cmake +++ b/examples/tv-app/tv-common/tv-app.cmake @@ -56,6 +56,8 @@ macro(chip_add_tv_app_common target) ${CHIP_TV_COMMON_BASE_DIR}/clusters/audio-output/AudioOutputManager.cpp ${CHIP_TV_COMMON_BASE_DIR}/clusters/channel/ChannelManager.cpp ${CHIP_TV_COMMON_BASE_DIR}/clusters/content-launcher/ContentLauncherManager.cpp + ${CHIP_TV_COMMON_BASE_DIR}/clusters/content-control/ContentController.cpp + ${CHIP_TV_COMMON_BASE_DIR}/clusters/content-app-observer/ContentAppObserver.cpp ${CHIP_TV_COMMON_BASE_DIR}/clusters/keypad-input/KeypadInputManager.cpp ${CHIP_TV_COMMON_BASE_DIR}/clusters/low-power/LowPowerManager.cpp ${CHIP_TV_COMMON_BASE_DIR}/clusters/media-input/MediaInputManager.cpp diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index e8f086310fd08c..ee3c171287a754 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -4788,6 +4788,38 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "GetProgramGuide", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ProgramGuideResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RecordProgram", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelRecordProgram", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 } ], "attributes": [ @@ -4963,6 +4995,15 @@ "maxInterval": 65344, "reportableChange": 0 } + ], + "events": [ + { + "name": "TargetUpdated", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { @@ -5068,6 +5109,30 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "ActivateAudioTrack", + "code": 12, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ActivateTextTrack", + "code": 13, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "DeactivateTextTrack", + "code": 14, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 } ], "attributes": [ @@ -5183,6 +5248,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "ActiveAudioTrack", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "TrackStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AvailableAudioTracks", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveTextTrack", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "TrackStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AvailableTextTracks", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -5263,6 +5392,15 @@ "maxInterval": 65534, "reportableChange": 0 } + ], + "events": [ + { + "name": "StateChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { @@ -5824,46 +5962,17 @@ "reportableChange": 0 } ] - } - ] - }, - { - "id": 3, - "name": "MA-speaker", - "deviceTypeRef": { - "code": 34, - "profileId": 259, - "label": "MA-speaker", - "name": "MA-speaker" - }, - "deviceTypes": [ - { - "code": 34, - "profileId": 259, - "label": "MA-speaker", - "name": "MA-speaker" - } - ], - "deviceVersions": [ - 1 - ], - "deviceIdentifiers": [ - 34 - ], - "deviceTypeName": "MA-speaker", - "deviceTypeCode": 34, - "deviceTypeProfileId": 259, - "clusters": [ + }, { - "name": "On/Off", - "code": 6, + "name": "Content Control", + "code": 1295, "mfgCode": null, - "define": "ON_OFF_CLUSTER", + "define": "CONTENT_CONTROL_CLUSTER", "side": "server", "enabled": 1, "commands": [ { - "name": "Off", + "name": "UpdatePIN", "code": 0, "mfgCode": null, "source": "client", @@ -5871,7 +5980,7 @@ "isEnabled": 1 }, { - "name": "On", + "name": "ResetPIN", "code": 1, "mfgCode": null, "source": "client", @@ -5879,132 +5988,72 @@ "isEnabled": 1 }, { - "name": "Toggle", + "name": "ResetPINResponse", "code": 2, "mfgCode": null, - "source": "client", - "isIncoming": 1, + "source": "server", + "isIncoming": 0, "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "OnOff", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 }, { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Level Control", - "code": 8, - "mfgCode": null, - "define": "LEVEL_CONTROL_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "MoveToLevel", - "code": 0, + "name": "Enable", + "code": 3, "mfgCode": null, "source": "client", "isIncoming": 1, "isEnabled": 1 }, { - "name": "Move", - "code": 1, + "name": "Disable", + "code": 4, "mfgCode": null, "source": "client", "isIncoming": 1, "isEnabled": 1 }, { - "name": "Step", - "code": 2, + "name": "AddBonusTime", + "code": 5, "mfgCode": null, "source": "client", "isIncoming": 1, "isEnabled": 1 }, { - "name": "Stop", - "code": 3, + "name": "SetScreenDailyTime", + "code": 6, "mfgCode": null, "source": "client", "isIncoming": 1, "isEnabled": 1 }, { - "name": "MoveToLevelWithOnOff", - "code": 4, + "name": "BlockUnratedContent", + "code": 7, "mfgCode": null, "source": "client", "isIncoming": 1, "isEnabled": 1 }, { - "name": "MoveWithOnOff", - "code": 5, + "name": "UnblockUnratedContent", + "code": 8, "mfgCode": null, "source": "client", "isIncoming": 1, "isEnabled": 1 }, { - "name": "StepWithOnOff", - "code": 6, + "name": "SetOnDemandRatingThreshold", + "code": 9, "mfgCode": null, "source": "client", "isIncoming": 1, "isEnabled": 1 }, { - "name": "StopWithOnOff", - "code": 7, + "name": "SetScheduledContentRatingThreshold", + "code": 10, "mfgCode": null, "source": "client", "isIncoming": 1, @@ -6013,224 +6062,192 @@ ], "attributes": [ { - "name": "CurrentLevel", + "name": "Enabled", "code": 0, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "boolean", "included": 1, - "storageOption": "NVM", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "RemainingTime", + "name": "OnDemandRatings", "code": 1, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "MinLevel", + "name": "OnDemandRatingThreshold", "code": 2, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "MaxLevel", + "name": "ScheduledContentRatings", "code": 3, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0xFF", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "CurrentFrequency", + "name": "ScheduledContentRatingThreshold", "code": 4, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "MinFrequency", + "name": "ScreenDailyTime", "code": 5, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "elapsed_s", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "MaxFrequency", + "name": "RemainingScreenTime", "code": 6, "mfgCode": null, "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Options", - "code": 15, - "mfgCode": null, - "side": "server", - "type": "OptionsBitmap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "OnOffTransitionTime", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "int16u", + "type": "elapsed_s", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "OnLevel", - "code": 17, + "name": "BlockUnrated", + "code": 7, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xFE", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "OnTransitionTime", - "code": 18, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "OffTransitionTime", - "code": 19, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "DefaultMoveRate", - "code": 20, + "name": "EventList", + "code": 65530, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "StartUpCurrentLevel", - "code": 16384, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "array", "included": 1, - "storageOption": "NVM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "255", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6246,7 +6263,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6262,26 +6279,53 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } + ], + "events": [ + { + "name": "RemainingScreenTimeExpired", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { - "name": "Descriptor", - "code": 29, + "name": "Content App Observer", + "code": 1296, "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", + "define": "CONTENT_APP_OBSERVER_CLUSTER", "side": "server", "enabled": 1, - "attributes": [ + "commands": [ { - "name": "DeviceTypeList", + "name": "ContentAppMessage", "code": 0, "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ContentAppMessageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, "side": "server", "type": "array", "included": 1, @@ -6295,8 +6339,8 @@ "reportableChange": 0 }, { - "name": "ServerList", - "code": 1, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", "type": "array", @@ -6311,8 +6355,8 @@ "reportableChange": 0 }, { - "name": "ClientList", - "code": 2, + "name": "EventList", + "code": 65530, "mfgCode": null, "side": "server", "type": "array", @@ -6327,8 +6371,8 @@ "reportableChange": 0 }, { - "name": "PartsList", - "code": 3, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", "type": "array", @@ -6365,10 +6409,10 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6379,91 +6423,970 @@ ] }, { - "id": 4, - "name": "MA-contentapplication", + "id": 3, + "name": "MA-speaker", "deviceTypeRef": { - "code": 36, + "code": 34, "profileId": 259, - "label": "MA-contentapp", - "name": "MA-contentapp" + "label": "MA-speaker", + "name": "MA-speaker" }, "deviceTypes": [ { - "code": 36, + "code": 34, "profileId": 259, - "label": "MA-contentapp", - "name": "MA-contentapp" + "label": "MA-speaker", + "name": "MA-speaker" } ], "deviceVersions": [ 1 ], "deviceIdentifiers": [ - 36 + 34 ], - "deviceTypeName": "MA-contentapp", - "deviceTypeCode": 36, + "deviceTypeName": "MA-speaker", + "deviceTypeCode": 34, "deviceTypeProfileId": 259, "clusters": [ { - "name": "Descriptor", - "code": 29, + "name": "On/Off", + "code": 6, "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", + "define": "ON_OFF_CLUSTER", "side": "server", "enabled": 1, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], "attributes": [ { - "name": "DeviceTypeList", + "name": "OnOff", "code": 0, "mfgCode": null, "side": "server", - "type": "array", + "type": "boolean", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0x00", "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, + "minInterval": 0, + "maxInterval": 65344, "reportableChange": 0 }, { - "name": "ServerList", - "code": 1, + "name": "FeatureMap", + "code": 65532, "mfgCode": null, "side": "server", - "type": "array", + "type": "bitmap32", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ClientList", - "code": 2, + "name": "ClusterRevision", + "code": 65533, "mfgCode": null, "side": "server", - "type": "array", + "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "5", "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, + "minInterval": 0, + "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinLevel", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxLevel", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentFrequency", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinFrequency", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxFrequency", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "OptionsBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnOffTransitionTime", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnLevel", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTransitionTime", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffTransitionTime", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultMoveRate", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpCurrentLevel", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "255", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 4, + "name": "MA-contentapplication", + "deviceTypeRef": { + "code": 36, + "profileId": 259, + "label": "MA-contentapp", + "name": "MA-contentapp" + }, + "deviceTypes": [ + { + "code": 36, + "profileId": 259, + "label": "MA-contentapp", + "name": "MA-contentapp" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 36 + ], + "deviceTypeName": "MA-contentapp", + "deviceTypeCode": 36, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Channel", + "code": 1284, + "mfgCode": null, + "define": "CHANNEL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeChannel", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeChannelResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ChangeChannelByNumber", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SkipChannel", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetProgramGuide", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ProgramGuideResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RecordProgram", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelRecordProgram", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ChannelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Lineup", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "LineupInfoStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentChannel", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "ChannelInfoStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Target Navigator", + "code": 1285, + "mfgCode": null, + "define": "TARGET_NAVIGATOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "NavigateTarget", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NavigateTargetResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TargetList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { - "name": "PartsList", - "code": 3, + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", "type": "array", @@ -6500,10 +7423,10 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6512,15 +7435,15 @@ ] }, { - "name": "Channel", - "code": 1284, + "name": "Media Playback", + "code": 1286, "mfgCode": null, - "define": "CHANNEL_CLUSTER", + "define": "MEDIA_PLAYBACK_CLUSTER", "side": "server", "enabled": 1, "commands": [ { - "name": "ChangeChannel", + "name": "Play", "code": 0, "mfgCode": null, "source": "client", @@ -6528,34 +7451,250 @@ "isEnabled": 1 }, { - "name": "ChangeChannelResponse", + "name": "Pause", "code": 1, "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Stop", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StartOver", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Previous", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Next", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Rewind", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "FastForward", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SkipForward", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SkipBackward", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "PlaybackResponse", + "code": 10, + "mfgCode": null, "source": "server", "isIncoming": 0, "isEnabled": 1 }, { - "name": "ChangeChannelByNumber", - "code": 2, + "name": "Seek", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ActivateAudioTrack", + "code": 12, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ActivateTextTrack", + "code": 13, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "DeactivateTextTrack", + "code": 14, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "CurrentState", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PlaybackStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StartTime", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "epoch_us", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Duration", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SampledPosition", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "PlaybackPositionStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PlaybackSpeed", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SeekRangeEnd", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SeekRangeStart", + "code": 6, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "SkipChannel", - "code": 3, + "name": "ActiveAudioTrack", + "code": 7, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ + "side": "server", + "type": "TrackStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { - "name": "GeneratedCommandList", - "code": 65528, + "name": "AvailableAudioTracks", + "code": 8, "mfgCode": null, "side": "server", "type": "array", @@ -6570,11 +7709,11 @@ "reportableChange": 0 }, { - "name": "AcceptedCommandList", - "code": 65529, + "name": "ActiveTextTrack", + "code": 9, "mfgCode": null, "side": "server", - "type": "array", + "type": "TrackStruct", "included": 1, "storageOption": "External", "singleton": 0, @@ -6586,8 +7725,8 @@ "reportableChange": 0 }, { - "name": "AttributeList", - "code": 65531, + "name": "AvailableTextTracks", + "code": 10, "mfgCode": null, "side": "server", "type": "array", @@ -6611,7 +7750,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "0x0003", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6629,22 +7768,31 @@ "bounded": 0, "defaultValue": "1", "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, + "minInterval": 0, + "maxInterval": 65344, "reportableChange": 0 } + ], + "events": [ + { + "name": "StateChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { - "name": "Target Navigator", - "code": 1285, + "name": "Keypad Input", + "code": 1289, "mfgCode": null, - "define": "TARGET_NAVIGATOR_CLUSTER", + "define": "KEYPAD_INPUT_CLUSTER", "side": "server", "enabled": 1, "commands": [ { - "name": "NavigateTarget", + "name": "SendKey", "code": 0, "mfgCode": null, "source": "client", @@ -6652,7 +7800,7 @@ "isEnabled": 1 }, { - "name": "NavigateTargetResponse", + "name": "SendKeyResponse", "code": 1, "mfgCode": null, "source": "server", @@ -6661,22 +7809,6 @@ } ], "attributes": [ - { - "name": "TargetList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "GeneratedCommandList", "code": 65528, @@ -6760,15 +7892,15 @@ ] }, { - "name": "Media Playback", - "code": 1286, + "name": "Content Launcher", + "code": 1290, "mfgCode": null, - "define": "MEDIA_PLAYBACK_CLUSTER", + "define": "CONTENT_LAUNCHER_CLUSTER", "side": "server", "enabled": 1, "commands": [ { - "name": "Play", + "name": "LaunchContent", "code": 0, "mfgCode": null, "source": "client", @@ -6776,7 +7908,7 @@ "isEnabled": 1 }, { - "name": "Pause", + "name": "LaunchURL", "code": 1, "mfgCode": null, "source": "client", @@ -6784,141 +7916,21 @@ "isEnabled": 1 }, { - "name": "Stop", + "name": "LauncherResponse", "code": 2, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "StartOver", - "code": 3, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "Previous", - "code": 4, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "Next", - "code": 5, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "Rewind", - "code": 6, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "FastForward", - "code": 7, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "SkipForward", - "code": 8, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "SkipBackward", - "code": 9, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "PlaybackResponse", - "code": 10, - "mfgCode": null, "source": "server", "isIncoming": 0, "isEnabled": 1 - }, - { - "name": "Seek", - "code": 11, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 } ], "attributes": [ { - "name": "CurrentState", + "name": "AcceptHeader", "code": 0, "mfgCode": null, "side": "server", - "type": "PlaybackStateEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "StartTime", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "epoch_us", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xFF", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Duration", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SampledPosition", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "PlaybackPositionStruct", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6930,43 +7942,11 @@ "reportableChange": 0 }, { - "name": "PlaybackSpeed", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "single", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SeekRangeEnd", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "int64u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SeekRangeStart", - "code": 6, + "name": "SupportedStreamingProtocols", + "code": 1, "mfgCode": null, "side": "server", - "type": "int64u", + "type": "SupportedProtocolsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7012,15 +7992,15 @@ ] }, { - "name": "Keypad Input", - "code": 1289, + "name": "Application Launcher", + "code": 1292, "mfgCode": null, - "define": "KEYPAD_INPUT_CLUSTER", + "define": "APPLICATION_LAUNCHER_CLUSTER", "side": "server", "enabled": 1, "commands": [ { - "name": "SendKey", + "name": "LaunchApp", "code": 0, "mfgCode": null, "source": "client", @@ -7028,9 +8008,25 @@ "isEnabled": 1 }, { - "name": "SendKeyResponse", + "name": "StopApp", "code": 1, "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "HideApp", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "LauncherResponse", + "code": 3, + "mfgCode": null, "source": "server", "isIncoming": 0, "isEnabled": 1 @@ -7120,147 +8116,141 @@ ] }, { - "name": "Content Launcher", - "code": 1290, + "name": "Application Basic", + "code": 1293, "mfgCode": null, - "define": "CONTENT_LAUNCHER_CLUSTER", + "define": "APPLICATION_BASIC_CLUSTER", "side": "server", "enabled": 1, - "commands": [ + "attributes": [ { - "name": "LaunchContent", + "name": "VendorName", "code": 0, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "LaunchURL", + "name": "VendorID", "code": 1, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "LauncherResponse", + "name": "ApplicationName", "code": 2, "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "AcceptHeader", - "code": 0, - "mfgCode": null, "side": "server", - "type": "array", + "type": "long_char_string", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "SupportedStreamingProtocols", - "code": 1, + "name": "ProductID", + "code": 3, "mfgCode": null, "side": "server", - "type": "SupportedProtocolsBitmap", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x00", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "FeatureMap", - "code": 65532, + "name": "Application", + "code": 4, "mfgCode": null, "side": "server", - "type": "bitmap32", + "type": "ApplicationStruct", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0003", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ClusterRevision", - "code": 65533, + "name": "Status", + "code": 5, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "ApplicationStatusEnum", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Application Launcher", - "code": 1292, - "mfgCode": null, - "define": "APPLICATION_LAUNCHER_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "LaunchApp", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 }, { - "name": "StopApp", - "code": 1, + "name": "ApplicationVersion", + "code": 6, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "HideApp", - "code": 2, + "name": "AllowedVendorList", + "code": 7, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, - { - "name": "LauncherResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - } - ], - "attributes": [ { "name": "GeneratedCommandList", "code": 65528, @@ -7337,143 +8327,309 @@ "bounded": 0, "defaultValue": "1", "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Account Login", + "code": 1294, + "mfgCode": null, + "define": "ACCOUNT_LOGIN_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "GetSetupPIN", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetSetupPINResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "Login", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Logout", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, "reportableChange": 0 } ] }, { - "name": "Application Basic", - "code": 1293, + "name": "Content Control", + "code": 1295, "mfgCode": null, - "define": "APPLICATION_BASIC_CLUSTER", + "define": "CONTENT_CONTROL_CLUSTER", "side": "server", "enabled": 1, + "commands": [ + { + "name": "UpdatePIN", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ResetPIN", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ResetPINResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "Enable", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Disable", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddBonusTime", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetScreenDailyTime", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "BlockUnratedContent", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UnblockUnratedContent", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetOnDemandRatingThreshold", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetScheduledContentRatingThreshold", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], "attributes": [ { - "name": "VendorName", + "name": "Enabled", "code": 0, "mfgCode": null, "side": "server", - "type": "char_string", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "VendorID", + "name": "OnDemandRatings", "code": 1, "mfgCode": null, "side": "server", - "type": "vendor_id", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ApplicationName", + "name": "OnDemandRatingThreshold", "code": 2, "mfgCode": null, "side": "server", - "type": "long_char_string", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ProductID", + "name": "ScheduledContentRatings", "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": null, "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "Application", + "name": "ScheduledContentRatingThreshold", "code": 4, "mfgCode": null, "side": "server", - "type": "ApplicationStruct", + "type": "char_string", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "Status", + "name": "ScreenDailyTime", "code": 5, "mfgCode": null, "side": "server", - "type": "ApplicationStatusEnum", + "type": "elapsed_s", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ApplicationVersion", + "name": "RemainingScreenTime", "code": 6, "mfgCode": null, "side": "server", - "type": "char_string", + "type": "elapsed_s", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "AllowedVendorList", + "name": "BlockUnrated", "code": 7, "mfgCode": null, "side": "server", - "type": "array", + "type": "boolean", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -7511,6 +8667,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -7555,22 +8727,31 @@ "bounded": 0, "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } + ], + "events": [ + { + "name": "RemainingScreenTimeExpired", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { - "name": "Account Login", - "code": 1294, + "name": "Content App Observer", + "code": 1296, "mfgCode": null, - "define": "ACCOUNT_LOGIN_CLUSTER", + "define": "CONTENT_APP_OBSERVER_CLUSTER", "side": "server", "enabled": 1, "commands": [ { - "name": "GetSetupPIN", + "name": "ContentAppMessage", "code": 0, "mfgCode": null, "source": "client", @@ -7578,31 +8759,79 @@ "isEnabled": 1 }, { - "name": "GetSetupPINResponse", + "name": "ContentAppMessageResponse", "code": 1, "mfgCode": null, "source": "server", "isIncoming": 0, "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "Login", - "code": 2, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "Logout", - "code": 3, + "name": "EventList", + "code": 65530, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -7631,8 +8860,8 @@ "bounded": 0, "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } ] @@ -7669,5 +8898,6 @@ "endpointId": 3, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 55885086b0fa45..9f87179489e41f 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -21,6 +21,8 @@ load "../src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml"; load "../src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml"; diff --git a/src/app/app-platform/ContentApp.h b/src/app/app-platform/ContentApp.h index e5eb99a5a701bd..915e47d8672e37 100644 --- a/src/app/app-platform/ContentApp.h +++ b/src/app/app-platform/ContentApp.h @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include @@ -41,6 +43,8 @@ using ApplicationBasicDelegate = app::Clusters::ApplicationBasic::Delegate; using ApplicationLauncherDelegate = app::Clusters::ApplicationLauncher::Delegate; using ChannelDelegate = app::Clusters::Channel::Delegate; using ContentLauncherDelegate = app::Clusters::ContentLauncher::Delegate; +using ContentAppObserverDelegate = app::Clusters::ContentAppObserver::Delegate; +using ContentControlDelegate = app::Clusters::ContentControl::Delegate; using KeypadInputDelegate = app::Clusters::KeypadInput::Delegate; using MediaPlaybackDelegate = app::Clusters::MediaPlayback::Delegate; using TargetNavigatorDelegate = app::Clusters::TargetNavigator::Delegate; @@ -58,6 +62,8 @@ class DLL_EXPORT ContentApp virtual ApplicationLauncherDelegate * GetApplicationLauncherDelegate() = 0; virtual ChannelDelegate * GetChannelDelegate() = 0; virtual ContentLauncherDelegate * GetContentLauncherDelegate() = 0; + virtual ContentControlDelegate * GetContentControlDelegate() = 0; + virtual ContentAppObserverDelegate * GetContentAppObserverDelegate() = 0; virtual KeypadInputDelegate * GetKeypadInputDelegate() = 0; virtual MediaPlaybackDelegate * GetMediaPlaybackDelegate() = 0; virtual TargetNavigatorDelegate * GetTargetNavigatorDelegate() = 0; diff --git a/src/app/clusters/account-login-server/account-login-delegate.h b/src/app/clusters/account-login-server/account-login-delegate.h index 3842412f40d7a2..0abf1de306d933 100644 --- a/src/app/clusters/account-login-server/account-login-delegate.h +++ b/src/app/clusters/account-login-server/account-login-delegate.h @@ -37,11 +37,12 @@ class Delegate // helper method to allow the platform to facilitate providing the pin virtual void SetSetupPin(char * setupPin) = 0; - virtual bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString) = 0; - virtual bool HandleLogout() = 0; + virtual bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString, + const chip::Optional & nodeId) = 0; + virtual bool HandleLogout(const chip::Optional & nodeId) = 0; virtual void HandleGetSetupPin(CommandResponseHelper & helper, - const chip::CharSpan & tempAccountIdentifierString) = 0; - virtual void GetSetupPin(char * setupPin, size_t setupPinSize, const chip::CharSpan & tempAccountIdentifierString) = 0; + const chip::CharSpan & tempAccountIdentifierString) = 0; + virtual void GetSetupPin(char * setupPin, size_t setupPinSize, const chip::CharSpan & tempAccountIdentifierString) = 0; virtual ~Delegate() = default; }; diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp index b9a05b8bc65cc8..b9727a9ad9561f 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -41,12 +42,43 @@ using namespace chip::app::Clusters::AccountLogin; #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED using namespace chip::AppPlatform; #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +using chip::NodeId; +using chip::app::LogEvent; using chip::app::Clusters::AccountLogin::Delegate; using chip::Protocols::InteractionModel::Status; +using LoggedOutEvent = chip::app::Clusters::AccountLogin::Events::LoggedOut::Type; static constexpr size_t kAccountLoginDeletageTableSize = EMBER_AF_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; static_assert(kAccountLoginDeletageTableSize <= kEmberInvalidEndpointIndex, "AccountLogin Delegate table size error"); + +NodeId getNodeId(const chip::app::CommandHandler * commandObj) +{ + // TODO: Why are we doing all these checks? At all the callsites we have + // just received a command, so we better have a handler, exchange, session, + // etc. The only thing we should be checking is that it's a CASE session. + if (nullptr == commandObj || nullptr == commandObj->GetExchangeContext()) + { + ChipLogError(Zcl, "Cannot access ExchangeContext of Command Object for Node ID"); + return kUndefinedNodeId; + } + + if (!commandObj->GetExchangeContext()->HasSessionHandle()) + { + ChipLogError(Zcl, "Cannot access session of Command Object for Node ID"); + return kUndefinedNodeId; + } + + auto descriptor = commandObj->GetExchangeContext()->GetSessionHandle()->GetSubjectDescriptor(); + if (descriptor.authMode != Access::AuthMode::kCase) + { + ChipLogError(Zcl, "Cannot get Node ID from non-CASE session of Command Object"); + return kUndefinedNodeId; + } + + return descriptor.subject; +} + // ----------------------------------------------------------------------------- // Delegate Implementation @@ -143,11 +175,12 @@ bool emberAfAccountLoginClusterLoginCallback(app::CommandHandler * command, cons Status status = Status::Success; auto & tempAccountIdentifier = commandData.tempAccountIdentifier; auto & setupPin = commandData.setupPIN; + auto & nodeId = commandData.node; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - if (!delegate->HandleLogin(tempAccountIdentifier, setupPin)) + if (!delegate->HandleLogin(tempAccountIdentifier, setupPin, nodeId)) { status = Status::UnsupportedAccess; } @@ -169,10 +202,12 @@ bool emberAfAccountLoginClusterLogoutCallback(app::CommandHandler * commandObj, EndpointId endpoint = commandPath.mEndpointId; Status status = Status::Success; + auto & nodeId = commandData.node; + Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - if (!delegate->HandleLogout()) + if (!delegate->HandleLogout(nodeId)) { status = Status::Failure; } @@ -184,6 +219,19 @@ bool emberAfAccountLoginClusterLogoutCallback(app::CommandHandler * commandObj, status = Status::Failure; } + if (nodeId.HasValue()) + { + // NodeId nodeId = getNodeId(commandObj); + EventNumber eventNumber; + LoggedOutEvent event{ .node = nodeId }; + CHIP_ERROR logEventError = LogEvent(event, endpoint, eventNumber); + + if (CHIP_NO_ERROR != logEventError) + { + ChipLogError(Zcl, "[Notify] Unable to send notify event: %s [endpointId=%d]", logEventError.AsString(), endpoint); + } + } + commandObj->AddStatus(commandPath, status); return true; } diff --git a/src/app/clusters/channel-server/channel-delegate.h b/src/app/clusters/channel-server/channel-delegate.h index f5fbbadda7ae16..6007bf06f8867f 100644 --- a/src/app/clusters/channel-server/channel-delegate.h +++ b/src/app/clusters/channel-server/channel-delegate.h @@ -29,6 +29,10 @@ namespace app { namespace Clusters { namespace Channel { +using ChannelInfo = chip::app::Clusters::Channel::Structs::ChannelInfoStruct::DecodableType; +using AdditionalInfo = chip::app::Clusters::Channel::Structs::AdditionalInfoStruct::DecodableType; +using PageToken = chip::app::Clusters::Channel::Structs::PageTokenStruct::Type; + /** @brief * Defines methods for implementing application-specific logic for the Channel Cluster. */ @@ -43,6 +47,21 @@ class Delegate const chip::CharSpan & match) = 0; virtual bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) = 0; virtual bool HandleSkipChannel(const int16_t & count) = 0; + virtual void HandleGetProgramGuide(CommandResponseHelper & helper, + const chip::Optional & startTime, const chip::Optional & endTime, + const chip::Optional> & channelList, + const chip::Optional & pageToken, + const chip::Optional> & recordingFlag, + const chip::Optional> & externalIdList, + const chip::Optional & data) = 0; + + virtual bool HandleRecordProgram(const chip::CharSpan & programIdentifier, bool shouldRecordSeries, + const DataModel::DecodableList & externalIdList, + const chip::ByteSpan & data) = 0; + + virtual bool HandleCancelRecordProgram(const chip::CharSpan & programIdentifier, bool shouldRecordSeries, + const DataModel::DecodableList & externalIdList, + const chip::ByteSpan & data) = 0; bool HasFeature(chip::EndpointId endpoint, Feature feature); virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 0; diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index 91e9fc613dadf5..52d30083075d66 100644 --- a/src/app/clusters/channel-server/channel-server.cpp +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -288,6 +288,115 @@ bool emberAfChannelClusterSkipChannelCallback(app::CommandHandler * command, con return true; } +/** + * @brief Channel Cluster GetProgramGuide Command callback (from client) + */ +bool emberAfChannelClusterGetProgramGuideCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Channel::Commands::GetProgramGuide::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + auto & startTime = commandData.startTime; + auto & endTime = commandData.endTime; + auto & channelList = commandData.channelList; + auto & pageToken = commandData.pageToken; + auto & recordingFlag = commandData.recordingFlag; + auto & externalIDList = commandData.externalIDList; + auto & data = commandData.data; + + app::CommandResponseHelper responder(command, commandPath); + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleGetProgramGuide(responder, startTime, endTime, channelList, pageToken, recordingFlag, externalIDList, data); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfChannelClusterGetProgramGuideCallback error: %s", err.AsString()); + } + + // If isDelegateNull, no one will call responder, so HasSentResponse will be false + if (!responder.HasSentResponse()) + { + command->AddStatus(commandPath, Status::Failure); + } + + return true; +} + +/** + * @brief Channel Cluster RecordProgram Command callback (from client) + */ +bool emberAfChannelClusterRecordProgramCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Channel::Commands::RecordProgram::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + auto & programIdentifier = commandData.programIdentifier; + auto & shouldRecordSeries = commandData.shouldRecordSeries; + auto & externalIDList = commandData.externalIDList; + auto & data = commandData.data; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + if (!delegate->HandleRecordProgram(programIdentifier, shouldRecordSeries, externalIDList, data)) + { + status = Status::Failure; + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfChannelClusterRecordProgramCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Channel Cluster CancelRecordProgram Command callback (from client) + */ +bool emberAfChannelClusterCancelRecordProgramCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Channel::Commands::CancelRecordProgram::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + auto & programIdentifier = commandData.programIdentifier; + auto & shouldRecordSeries = commandData.shouldRecordSeries; + auto & externalIDList = commandData.externalIDList; + auto & data = commandData.data; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + if (!delegate->HandleCancelRecordProgram(programIdentifier, shouldRecordSeries, externalIDList, data)) + { + status = Status::Failure; + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfChannelClusterCancelRecordProgramCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + void MatterChannelPluginServerInitCallback() { registerAttributeAccessOverride(&gChannelAttrAccess); diff --git a/src/app/clusters/content-app-observer/content-app-observer-delegate.h b/src/app/clusters/content-app-observer/content-app-observer-delegate.h new file mode 100644 index 00000000000000..d206f19ff1c174 --- /dev/null +++ b/src/app/clusters/content-app-observer/content-app-observer-delegate.h @@ -0,0 +1,46 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ContentAppObserver { + +/** @brief + * Defines methods for implementing application-specific logic for the Content App Observer Cluster. + */ +class Delegate +{ +public: + virtual void HandleContentAppMessage(CommandResponseHelper & helper, + const chip::Optional & data, const chip::CharSpan & encodingHint) = 0; + + virtual ~Delegate() = default; +}; + +} // namespace ContentAppObserver +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/content-app-observer/content-app-observer.cpp b/src/app/clusters/content-app-observer/content-app-observer.cpp new file mode 100644 index 00000000000000..26739027b494af --- /dev/null +++ b/src/app/clusters/content-app-observer/content-app-observer.cpp @@ -0,0 +1,153 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/**************************************************************************** + * @file + * @brief Routines for the Application Launcher plugin, the + *server implementation of the Application Launcher cluster. + ******************************************************************************* + ******************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +#include +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ContentAppObserver; +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +using namespace chip::AppPlatform; +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +using chip::app::Clusters::ContentAppObserver::Delegate; +using chip::Protocols::InteractionModel::Status; + +static constexpr size_t kContentAppObserverDeletageTableSize = + EMBER_AF_CONTENT_APP_OBSERVER_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; +static_assert(kContentAppObserverDeletageTableSize <= kEmberInvalidEndpointIndex, "ContentAppObserver Delegate table size error"); + +// ----------------------------------------------------------------------------- +// Delegate Implementation + +namespace { + +Delegate * gDelegateTable[kContentAppObserverDeletageTableSize] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) +{ +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + ContentApp * app = ContentAppPlatform::GetInstance().GetContentApp(endpoint); + if (app != nullptr) + { + ChipLogProgress(Zcl, "ContentAppObserver returning ContentApp delegate for endpoint:%u", endpoint); + return app->GetContentAppObserverDelegate(); + } +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + ChipLogProgress(Zcl, "ContentAppObserver NOT returning ContentApp delegate for endpoint:%u", endpoint); + + uint16_t ep = emberAfGetClusterServerEndpointIndex(endpoint, ContentAppObserver::Id, + EMBER_AF_CONTENT_APP_OBSERVER_CLUSTER_SERVER_ENDPOINT_COUNT); + return (ep >= kContentAppObserverDeletageTableSize ? nullptr : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) + { + ChipLogProgress(Zcl, "Content App Observer has no delegate set for endpoint:%u", endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace ContentAppObserver { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfGetClusterServerEndpointIndex(endpoint, ContentAppObserver::Id, + EMBER_AF_CONTENT_APP_OBSERVER_CLUSTER_SERVER_ENDPOINT_COUNT); + // if endpoint is found + if (ep < kContentAppObserverDeletageTableSize) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace ContentAppObserver +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +/** + * @brief Content App Observer Cluster ContentAppMessage Command callback (from client) + */ +bool emberAfContentAppObserverClusterContentAppMessageCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + auto & data = commandData.data; + auto & encodingHint = commandData.encodingHint; + + app::CommandResponseHelper responder(command, commandPath); + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleContentAppMessage(responder, data, encodingHint); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentAppObserverClusterContentAppMessageCallback error: %s", err.AsString()); + } + + // If isDelegateNull, no one will call responder, so HasSentResponse will be false + if (!responder.HasSentResponse()) + { + command->AddStatus(commandPath, Status::Failure); + } + + return true; +} + +// ----------------------------------------------------------------------------- +// Plugin initialization + +void MatterContentAppObserverPluginServerInitCallback() {} diff --git a/src/app/clusters/content-app-observer/content-app-observer.h b/src/app/clusters/content-app-observer/content-app-observer.h new file mode 100644 index 00000000000000..3d16ba2a99b866 --- /dev/null +++ b/src/app/clusters/content-app-observer/content-app-observer.h @@ -0,0 +1,39 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/**************************************************************************** + * @file + * @brief Routines for the Content App Observer plugin, the + *server implementation of the Content App Observer cluster. + ******************************************************************************* + ******************************************************************************/ + +#pragma once + +#include "content-app-observer-delegate.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ContentAppObserver { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace ContentAppObserver +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/content-control-server/content-control-delegate.h b/src/app/clusters/content-control-server/content-control-delegate.h new file mode 100644 index 00000000000000..b587c3a7610a3c --- /dev/null +++ b/src/app/clusters/content-control-server/content-control-delegate.h @@ -0,0 +1,69 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ContentControl { + +/** @brief + * Defines methods for implementing application-specific logic for the Content Control Cluster. + */ +class Delegate +{ +public: + // Attribute Delegates + virtual bool HandleGetEnabled() = 0; + virtual CHIP_ERROR HandleGetOnDemandRatings(app::AttributeValueEncoder & aEncoder) = 0; + virtual chip::CharSpan HandleGetOnDemandRatingThreshold() = 0; + virtual CHIP_ERROR HandleGetScheduledContentRatings(app::AttributeValueEncoder & aEncoder) = 0; + virtual chip::CharSpan HandleGetScheduledContentRatingThreshold() = 0; + virtual uint32_t HandleGetScreenDailyTime() = 0; + virtual uint32_t HandleGetRemainingScreenTime() = 0; + virtual bool HandleGetBlockUnrated() = 0; + + // Command Delegates + virtual void HandleUpdatePIN(Optional oldPIN, chip::CharSpan newPIN) = 0; + virtual void HandleResetPIN(CommandResponseHelper & helper) = 0; + virtual void HandleEnable() = 0; + virtual void HandleDisable() = 0; + virtual void HandleAddBonusTime(Optional PINCode, Optional bonusTime) = 0; + virtual void HandleSetScreenDailyTime(uint32_t screenDailyTime) = 0; + virtual void HandleBlockUnratedContent() = 0; + virtual void HandleUnblockUnratedContent() = 0; + virtual void HandleSetOnDemandRatingThreshold(chip::CharSpan rating) = 0; + virtual void HandleSetScheduledContentRatingThreshold(chip::CharSpan rating) = 0; + + bool HasFeature(chip::EndpointId endpoint, Feature feature); + + virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 0; + + virtual ~Delegate() = default; +}; + +} // namespace ContentControl +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/content-control-server/content-control-server.cpp b/src/app/clusters/content-control-server/content-control-server.cpp new file mode 100644 index 00000000000000..1434e25000f389 --- /dev/null +++ b/src/app/clusters/content-control-server/content-control-server.cpp @@ -0,0 +1,417 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/**************************************************************************** + * @file + * @brief Routines for the Application Launcher plugin, the + *server implementation of the Application Launcher cluster. + ******************************************************************************* + ******************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +#include +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ContentControl; +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +using namespace chip::AppPlatform; +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +using chip::NodeId; +using chip::app::LogEvent; +using chip::app::Clusters::ContentControl::Delegate; +using chip::Protocols::InteractionModel::Status; +using RemainingScreenTimeExpiredEvent = chip::app::Clusters::ContentControl::Events::RemainingScreenTimeExpired::Type; + +static constexpr size_t kContentControlDeletageTableSize = + EMBER_AF_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; +static_assert(kContentControlDeletageTableSize <= kEmberInvalidEndpointIndex, "ContentControl Delegate table size error"); + +// ----------------------------------------------------------------------------- +// Delegate Implementation + +namespace { + +Delegate * gDelegateTable[kContentControlDeletageTableSize] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) +{ +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + ContentApp * app = ContentAppPlatform::GetInstance().GetContentApp(endpoint); + if (app != nullptr) + { + ChipLogProgress(Zcl, "ContentControl returning ContentApp delegate for endpoint:%u", endpoint); + return app->GetContentControlDelegate(); + } +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + ChipLogProgress(Zcl, "ContentControl NOT returning ContentApp delegate for endpoint:%u", endpoint); + + uint16_t ep = + emberAfGetClusterServerEndpointIndex(endpoint, ContentControl::Id, EMBER_AF_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT); + return (ep >= kContentControlDeletageTableSize ? nullptr : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) + { + ChipLogProgress(Zcl, "Content App Observer has no delegate set for endpoint:%u", endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace ContentControl { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = + emberAfGetClusterServerEndpointIndex(endpoint, ContentControl::Id, EMBER_AF_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT); + // if endpoint is found + if (ep < kContentControlDeletageTableSize) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace ContentControl +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +/** + * @brief Content Control Cluster UpdatePIN Command callback (from client) + */ +bool emberAfContentControlClusterUpdatePINCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::UpdatePIN::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + auto & oldPin = commandData.oldPIN; + auto & newPin = commandData.newPIN; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleUpdatePIN(oldPin, newPin); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentControlClusterUpdatePINCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Content Control Cluster ResetPIN Command callback (from client) + */ +bool emberAfContentControlClusterResetPINCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::ResetPIN::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + app::CommandResponseHelper responder(command, commandPath); + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleResetPIN(responder); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentControlClusterResetPINCallback error: %s", err.AsString()); + } + + // If isDelegateNull, no one will call responder, so HasSentResponse will be false + if (!responder.HasSentResponse()) + { + command->AddStatus(commandPath, Status::Failure); + } + + return true; +} + +/** + * @brief Content Control Cluster Enable Command callback (from client) + */ +bool emberAfContentControlClusterEnableCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::Enable::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleEnable(); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentControlClusterEnableCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Content Control Cluster Disable Command callback (from client) + */ +bool emberAfContentControlClusterDisableCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::Disable::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleDisable(); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentControlClusterDisableCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Content Control Cluster AddBonusTime Command callback (from client) + */ +bool emberAfContentControlClusterAddBonusTimeCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::AddBonusTime::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + auto & pinCode = commandData.PINCode; + auto & bonusTime = commandData.bonusTime; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleAddBonusTime(pinCode, bonusTime); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentControlClusterAddBonusTimeCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Content Control Cluster SetScreenDailyTime Command callback (from client) + */ +bool emberAfContentControlClusterSetScreenDailyTimeCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::SetScreenDailyTime::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + auto & screenTime = commandData.screenTime; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleSetScreenDailyTime(screenTime); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentControlClusterSetScreenDailyTimeCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Content Control Cluster BlockUnratedContent Command callback (from client) + */ +bool emberAfContentControlClusterBlockUnratedContentCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::BlockUnratedContent::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleBlockUnratedContent(); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentControlClusterBlockUnratedContentCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Content Control Cluster UnblockUnratedContent Command callback (from client) + */ +bool emberAfContentControlClusterUnblockUnratedContentCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::UnblockUnratedContent::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleUnblockUnratedContent(); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentControlClusterUnblockUnratedContentCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Content Control Cluster SetOnDemandRatingThreshold Command callback (from client) + */ +bool emberAfContentControlClusterSetOnDemandRatingThresholdCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::SetOnDemandRatingThreshold::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + auto & rating = commandData.rating; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleSetOnDemandRatingThreshold(rating); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentControlClusterSetOnDemandRatingThresholdCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Content Control Cluster SetScheduledContentRatingThreshold Command callback (from client) + */ +bool emberAfContentControlClusterSetScheduledContentRatingThresholdCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::SetScheduledContentRatingThreshold::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + auto & rating = commandData.rating; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleSetScheduledContentRatingThreshold(rating); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfContentControlClusterSetScheduledContentRatingThresholdCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +// ----------------------------------------------------------------------------- +// Plugin initialization + +void MatterContentControlPluginServerInitCallback() {} diff --git a/src/app/clusters/content-control-server/content-control-server.h b/src/app/clusters/content-control-server/content-control-server.h new file mode 100644 index 00000000000000..4ae61a6dc484c9 --- /dev/null +++ b/src/app/clusters/content-control-server/content-control-server.h @@ -0,0 +1,39 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/**************************************************************************** + * @file + * @brief Routines for the Content App Observer plugin, the + *server implementation of the Content App Observer cluster. + ******************************************************************************* + ******************************************************************************/ + +#pragma once + +#include "content-control-delegate.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ContentControl { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace ContentControl +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/content-launch-server/content-launch-delegate.h b/src/app/clusters/content-launch-server/content-launch-delegate.h index 5f189861164088..0f84887c881788 100644 --- a/src/app/clusters/content-launch-server/content-launch-delegate.h +++ b/src/app/clusters/content-launch-server/content-launch-delegate.h @@ -31,6 +31,7 @@ namespace Clusters { namespace ContentLauncher { using BrandingInformation = chip::app::Clusters::ContentLauncher::Structs::BrandingInformationStruct::Type; +using PlaybackPreferences = chip::app::Clusters::ContentLauncher::Structs::PlaybackPreferencesStruct::DecodableType; using Parameter = chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::DecodableType; /** @brief @@ -41,7 +42,8 @@ class Delegate public: virtual void HandleLaunchContent(CommandResponseHelper & helper, const DataModel::DecodableList & parameterList, bool autoplay, - const CharSpan & data) = 0; + const CharSpan & data, const Optional playbackPreferences, + bool useCurrentContext) = 0; virtual void HandleLaunchUrl(CommandResponseHelper & helper, const CharSpan & contentUrl, const CharSpan & displayString, const BrandingInformation & brandingInformation) = 0; diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index 70144aaec1b06d..405ec7b427f373 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -206,6 +206,8 @@ bool emberAfContentLauncherClusterLaunchContentCallback(CommandHandler * command auto & autoplay = commandData.autoPlay; auto & data = commandData.data; auto & decodableParameterList = commandData.search.parameterList; + auto & playbackPreferences = commandData.playbackPreferences; + auto & useCurrentContext = commandData.useCurrentContext; app::CommandResponseHelper responder(commandObj, commandPath); @@ -214,7 +216,9 @@ bool emberAfContentLauncherClusterLaunchContentCallback(CommandHandler * command VerifyOrExit(isDelegateNull(delegate, endpoint) != true && delegate->HasFeature(endpoint, Feature::kContentSearch), err = CHIP_ERROR_INCORRECT_STATE); - delegate->HandleLaunchContent(responder, decodableParameterList, autoplay, data.HasValue() ? data.Value() : CharSpan()); + // note assume if client does not send useCurrentContext then it's set to false + delegate->HandleLaunchContent(responder, decodableParameterList, autoplay, data.HasValue() ? data.Value() : CharSpan(), + playbackPreferences, useCurrentContext.HasValue() ? useCurrentContext.Value() : false); exit: if (err != CHIP_NO_ERROR) diff --git a/src/app/clusters/media-playback-server/media-playback-delegate.h b/src/app/clusters/media-playback-server/media-playback-delegate.h index 64b85b85480318..db60f897b8b623 100644 --- a/src/app/clusters/media-playback-server/media-playback-delegate.h +++ b/src/app/clusters/media-playback-server/media-playback-delegate.h @@ -30,34 +30,45 @@ namespace app { namespace Clusters { namespace MediaPlayback { +using TrackStruct = chip::app::Clusters::MediaPlayback::Structs::TrackStruct::Type; + /** @brief * Defines methods for implementing application-specific logic for the Media Playback Cluster. */ class Delegate { public: - virtual PlaybackStateEnum HandleGetCurrentState() = 0; - virtual uint64_t HandleGetStartTime() = 0; - virtual uint64_t HandleGetDuration() = 0; - virtual CHIP_ERROR HandleGetSampledPosition(app::AttributeValueEncoder & aEncoder) = 0; - virtual float HandleGetPlaybackSpeed() = 0; - virtual uint64_t HandleGetSeekRangeStart() = 0; - virtual uint64_t HandleGetSeekRangeEnd() = 0; + virtual PlaybackStateEnum HandleGetCurrentState() = 0; + virtual uint64_t HandleGetStartTime() = 0; + virtual uint64_t HandleGetDuration() = 0; + virtual CHIP_ERROR HandleGetSampledPosition(app::AttributeValueEncoder & aEncoder) = 0; + virtual float HandleGetPlaybackSpeed() = 0; + virtual uint64_t HandleGetSeekRangeStart() = 0; + virtual uint64_t HandleGetSeekRangeEnd() = 0; + virtual CHIP_ERROR HandleGetActiveAudioTrack(app::AttributeValueEncoder & aEncoder) = 0; + virtual CHIP_ERROR HandleGetAvailableAudioTracks(app::AttributeValueEncoder & aEncoder) = 0; + virtual CHIP_ERROR HandleGetActiveTextTrack(app::AttributeValueEncoder & aEncoder) = 0; + virtual CHIP_ERROR HandleGetAvailableTextTracks(app::AttributeValueEncoder & aEncoder) = 0; - virtual void HandlePlay(CommandResponseHelper & helper) = 0; - virtual void HandlePause(CommandResponseHelper & helper) = 0; - virtual void HandleStop(CommandResponseHelper & helper) = 0; - virtual void HandleFastForward(CommandResponseHelper & helper) = 0; - virtual void HandlePrevious(CommandResponseHelper & helper) = 0; - virtual void HandleRewind(CommandResponseHelper & helper) = 0; + virtual void HandlePlay(CommandResponseHelper & helper) = 0; + virtual void HandlePause(CommandResponseHelper & helper) = 0; + virtual void HandleStop(CommandResponseHelper & helper) = 0; + virtual void HandleFastForward(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) = 0; + virtual void HandlePrevious(CommandResponseHelper & helper) = 0; + virtual void HandleRewind(CommandResponseHelper & helper, + const chip::Optional & audioAdvanceUnmuted) = 0; virtual void HandleSkipBackward(CommandResponseHelper & helper, - const uint64_t & deltaPositionMilliseconds) = 0; + const uint64_t & deltaPositionMilliseconds) = 0; virtual void HandleSkipForward(CommandResponseHelper & helper, - const uint64_t & deltaPositionMilliseconds) = 0; + const uint64_t & deltaPositionMilliseconds) = 0; virtual void HandleSeek(CommandResponseHelper & helper, - const uint64_t & positionMilliseconds) = 0; - virtual void HandleNext(CommandResponseHelper & helper) = 0; - virtual void HandleStartOver(CommandResponseHelper & helper) = 0; + const uint64_t & positionMilliseconds) = 0; + virtual void HandleNext(CommandResponseHelper & helper) = 0; + virtual void HandleStartOver(CommandResponseHelper & helper) = 0; + virtual bool HandleActivateAudioTrack(const chip::CharSpan & trackId, const uint8_t & audioOutputIndex) = 0; + virtual bool HandleActivateTextTrack(const chip::CharSpan & trackId) = 0; + virtual bool HandleDeactivateTextTrack() = 0; virtual uint32_t GetFeatureMap(chip::EndpointId endpoint) = 0; diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 028fa8fcc2ec6e..a23a2d9e2a5c77 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -45,6 +46,8 @@ using namespace chip::app::Clusters::MediaPlayback; using namespace chip::AppPlatform; #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED using chip::Protocols::InteractionModel::Status; +using StateChangedEvent = chip::app::Clusters::MediaPlayback::Events::StateChanged::Type; +using chip::app::LogEvent; static constexpr size_t kMediaPlaybackDelegateTableSize = EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; @@ -131,6 +134,10 @@ class MediaPlaybackAttrAccess : public app::AttributeAccessInterface CHIP_ERROR ReadPlaybackSpeedAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); CHIP_ERROR ReadSeekRangeStartAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); CHIP_ERROR ReadSeekRangeEndAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadActiveAudioTrackAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadAvailableAudioTracksAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadActiveTextTrackAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadAvailableTextTracksAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); CHIP_ERROR ReadFeatureFlagAttribute(EndpointId endpoint, app::AttributeValueEncoder & aEncoder, Delegate * delegate); }; @@ -141,9 +148,23 @@ CHIP_ERROR MediaPlaybackAttrAccess::Read(const app::ConcreteReadAttributePath & EndpointId endpoint = aPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); + // TODO: Add hasFeature condition + if (isDelegateNull(delegate, endpoint)) { - return CHIP_NO_ERROR; + switch (aPath.mAttributeId) + { + case app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::Id: { + return aEncoder.EncodeEmptyList(); + } + case app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::Id: { + return aEncoder.EncodeEmptyList(); + } + default: { + return CHIP_NO_ERROR; + break; + } + } } switch (aPath.mAttributeId) @@ -169,6 +190,18 @@ CHIP_ERROR MediaPlaybackAttrAccess::Read(const app::ConcreteReadAttributePath & case app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id: { return ReadSeekRangeEndAttribute(aEncoder, delegate); } + case app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::Id: { + return ReadActiveAudioTrackAttribute(aEncoder, delegate); + } + case app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::Id: { + return ReadAvailableAudioTracksAttribute(aEncoder, delegate); + } + case app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::Id: { + return ReadActiveTextTrackAttribute(aEncoder, delegate); + } + case app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::Id: { + return ReadAvailableTextTracksAttribute(aEncoder, delegate); + } case app::Clusters::ContentLauncher::Attributes::FeatureMap::Id: { return ReadFeatureFlagAttribute(endpoint, aEncoder, delegate); } @@ -228,6 +261,26 @@ CHIP_ERROR MediaPlaybackAttrAccess::ReadSeekRangeEndAttribute(app::AttributeValu return aEncoder.Encode(seekRangeEnd); } +CHIP_ERROR MediaPlaybackAttrAccess::ReadActiveAudioTrackAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + return delegate->HandleGetActiveAudioTrack(aEncoder); +} + +CHIP_ERROR MediaPlaybackAttrAccess::ReadAvailableAudioTracksAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + return delegate->HandleGetAvailableAudioTracks(aEncoder); +} + +CHIP_ERROR MediaPlaybackAttrAccess::ReadActiveTextTrackAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + return delegate->HandleGetActiveTextTrack(aEncoder); +} + +CHIP_ERROR MediaPlaybackAttrAccess::ReadAvailableTextTracksAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + return delegate->HandleGetAvailableTextTracks(aEncoder); +} + } // anonymous namespace // ----------------------------------------------------------------------------- @@ -312,11 +365,13 @@ bool emberAfMediaPlaybackClusterFastForwardCallback(app::CommandHandler * comman EndpointId endpoint = commandPath.mEndpointId; app::CommandResponseHelper responder(command, commandPath); + auto & audioAdvanceUnmuted = commandData.audioAdvanceUnmuted; + Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); { - delegate->HandleFastForward(responder); + delegate->HandleFastForward(responder, audioAdvanceUnmuted); } exit: @@ -360,11 +415,13 @@ bool emberAfMediaPlaybackClusterRewindCallback(app::CommandHandler * command, co EndpointId endpoint = commandPath.mEndpointId; app::CommandResponseHelper responder(command, commandPath); + auto & audioAdvanceUnmuted = commandData.audioAdvanceUnmuted; + Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); { - delegate->HandleRewind(responder); + delegate->HandleRewind(responder, audioAdvanceUnmuted); } exit: @@ -501,6 +558,150 @@ bool emberAfMediaPlaybackClusterStartOverCallback(app::CommandHandler * command, return true; } +/** + * @brief Media Playback Cluster ActivateAudioTrack Command callback (from client) + */ +bool emberAfMediaPlaybackClusterActivateAudioTrackCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + auto & trackId = commandData.trackID; + auto & audioOutputIndex = commandData.audioOutputIndex; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleActivateAudioTrack(trackId, audioOutputIndex); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterActivateAudioTrackCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Media Playback Cluster ActivateTextTrack Command callback (from client) + */ +bool emberAfMediaPlaybackClusterActivateTextTrackCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + auto & trackId = commandData.trackID; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleActivateTextTrack(trackId); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterActivateTextTrackCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** + * @brief Media Playback Cluster DeactivateTextTrack Command callback (from client) + */ +bool emberAfMediaPlaybackClusterDeactivateTextTrackCallback( + chip::app::CommandHandler * command, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + delegate->HandleDeactivateTextTrack(); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterDeactivateTextTrackCallback error: %s", err.AsString()); + status = Status::Failure; + } + + command->AddStatus(commandPath, status); + return true; +} + +/** @brief Media Playback Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterMediaPlaybackClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath) +{ + ChipLogProgress(Zcl, "Media Playback Server Cluster Attribute changed [EP:%d, ID:0x%x]", attributePath.mEndpointId, + (unsigned int) attributePath.mAttributeId); + + // TODO: Check if event feature is supported and only then continue + switch (attributePath.mAttributeId) + { + case app::Clusters::MediaPlayback::Attributes::CurrentState::Id: + case app::Clusters::MediaPlayback::Attributes::StartTime::Id: + case app::Clusters::MediaPlayback::Attributes::Duration::Id: + case app::Clusters::MediaPlayback::Attributes::SampledPosition::Id: + case app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::Id: + case app::Clusters::MediaPlayback::Attributes::SeekRangeStart::Id: + case app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id: { + EventNumber eventNumber; + + // TODO: Update values + PlaybackStateEnum currentState = static_cast(0); + uint64_t startTime = static_cast(0); + uint64_t duration = static_cast(0); + Structs::PlaybackPositionStruct::Type sampledPosition; + float playbackSpeed = static_cast(0); + uint64_t seekRangeEnd = static_cast(0); + uint64_t seekRangeStart = static_cast(0); + chip::ByteSpan data = ByteSpan(); + bool audioAdvanceUnmuted = false; + + StateChangedEvent event{ currentState, startTime, duration, sampledPosition, playbackSpeed, + seekRangeEnd, seekRangeStart, MakeOptional(data), audioAdvanceUnmuted }; + + // TODO: Add endpoint variable instead of 0 + CHIP_ERROR logEventError = LogEvent(event, 0, eventNumber); + + if (CHIP_NO_ERROR != logEventError) + { + // TODO: Add endpoint variable instead of 0 + ChipLogError(Zcl, "[Notify] Unable to send notify event: %s [endpointId=%d]", logEventError.AsString(), 0); + } + break; + } + + default: { + ChipLogProgress(Zcl, "Media Playback Server: unhandled attribute ID"); + break; + } + } +} + void MatterMediaPlaybackPluginServerInitCallback() { registerAttributeAccessOverride(&gMediaPlaybackAttrAccess); diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index 1718b2b9cc459c..e52ef407003eb1 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +44,9 @@ using namespace chip::app::Clusters::TargetNavigator; #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED using namespace chip::AppPlatform; #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +using chip::app::LogEvent; using chip::Protocols::InteractionModel::Status; +using TargetUpdatedEvent = chip::app::Clusters::TargetNavigator::Events::TargetUpdated::Type; static constexpr size_t kTargetNavigatorDelegateTableSize = EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; @@ -203,6 +206,49 @@ bool emberAfTargetNavigatorClusterNavigateTargetCallback(app::CommandHandler * c return true; } +/** @brief Target Navigator Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterTargetNavigatorClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath) +{ + ChipLogProgress(Zcl, "Target Navigator Server Cluster Attribute changed [EP:%d, ID:0x%x]", attributePath.mEndpointId, + (unsigned int) attributePath.mAttributeId); + + // TODO: Check if event feature is supported and only then continue + switch (attributePath.mAttributeId) + { + case app::Clusters::TargetNavigator::Attributes::TargetList::Id: + case app::Clusters::TargetNavigator::Attributes::CurrentTarget::Id: { + EventNumber eventNumber; + + // TODO: Update values + chip::app::DataModel::List targetList; + uint8_t currentTarget = static_cast(0); + chip::ByteSpan data = ByteSpan(); + + TargetUpdatedEvent event{ targetList, currentTarget, data }; + + // TODO: Add endpoint variable instead of 0 + CHIP_ERROR logEventError = LogEvent(event, 0, eventNumber); + + if (CHIP_NO_ERROR != logEventError) + { + // TODO: Add endpoint variable instead of 0 + ChipLogError(Zcl, "[Notify] Unable to send notify event: %s [endpointId=%d]", logEventError.AsString(), 0); + } + break; + } + + default: { + ChipLogProgress(Zcl, "Media Playback Server: unhandled attribute ID"); + break; + } + } +} + void MatterTargetNavigatorPluginServerInitCallback() { registerAttributeAccessOverride(&gTargetNavigatorAttrAccess); diff --git a/src/app/tests/suites/TV_AccountLoginCluster.yaml b/src/app/tests/suites/TV_AccountLoginCluster.yaml index cc80a57f18636d..8f92502da47218 100644 --- a/src/app/tests/suites/TV_AccountLoginCluster.yaml +++ b/src/app/tests/suites/TV_AccountLoginCluster.yaml @@ -48,7 +48,13 @@ tests: value: "asdf" - name: "SetupPIN" value: "tempPin123" + - name: "Node" + value: nodeId - label: "Logout Command" command: "Logout" timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "Node" + value: nodeId diff --git a/src/app/tests/suites/TV_ContentLauncherCluster.yaml b/src/app/tests/suites/TV_ContentLauncherCluster.yaml index 3ec333c6f2e61f..33634a1b540c82 100644 --- a/src/app/tests/suites/TV_ContentLauncherCluster.yaml +++ b/src/app/tests/suites/TV_ContentLauncherCluster.yaml @@ -61,6 +61,27 @@ tests: }, ], } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } + - name: "UseCurrentContext" + value: true response: values: - name: "Data" diff --git a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml index db1826a4949557..2c7be1eebcf05e 100644 --- a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml @@ -75,7 +75,7 @@ tests: - name: "SetupPIN" saveAs: setupPIN constraints: - minLength: 11 + minLength: 8 - label: "Step 2: TH sends a Login command to the DUT with test values provided @@ -89,6 +89,8 @@ tests: value: TempAccountIdentifier - name: "SetupPIN" value: setupPIN + - name: "Node" + value: nodeId - label: "Step 3: TH sends a Logout command to the DUT with test values @@ -96,3 +98,7 @@ tests: PICS: ALOGIN.S.C03.Rsp && PICS_SKIP_SAMPLE_APP command: "Logout" timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "Node" + value: nodeId diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml index 85336aefe3b4a0..06eccef6b6363e 100644 --- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml @@ -72,6 +72,27 @@ tests: }, ], } + - name: "UseCurrentContext" + value: false + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Data" @@ -123,6 +144,27 @@ tests: }, ], } + - name: "UseCurrentContext" + value: false + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Data" diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml index 4c1515efe4a296..299d812dd94e44 100644 --- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml @@ -46,6 +46,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 0, Value: "Gaby sHoffman" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -75,6 +94,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 1, Value: "PBS" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -104,6 +142,25 @@ tests: value: false - name: "Search" value: { ParameterList: [{ Type: 2, Value: "Snow White" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -133,6 +190,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 3, Value: "Spike Lee" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -162,6 +238,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 4, Value: "Football games" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -191,6 +286,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 5, Value: "Star Wars" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -220,6 +334,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 6, Value: "Horror" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -249,6 +382,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 7, Value: "NCAA" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -278,6 +430,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 8, Value: PopularityName }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -307,6 +478,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 9, Value: "Netflix" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -336,6 +526,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 10, Value: "football" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -365,6 +574,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 11, Value: "Arsenel" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" @@ -394,6 +622,25 @@ tests: value: true - name: "Search" value: { ParameterList: [{ Type: 12, Value: "TVSeries" }] } + - name: "PlaybackPreferences" + value: + { + PlaybackPosition: 0, + TextTrack: + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + AudioTracks: + [ + { + LanguageCode: "exampleLanguageCode", + Characteristics: [0], + AudioOutputIndex: 0, + }, + ], + } response: values: - name: "Status" diff --git a/src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml index 992b07897336c9..273533c5fa82a1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml @@ -35,11 +35,13 @@ limitations under the License. Upon receipt, the Content App checks if the account associated with the client’s Temp Account Identifier (Rotating ID) has a current active Setup PIN with the given value. If the Setup PIN is valid for the user account associated with the Temp Account Identifier, then the Content App MAY make that user account active. - + + The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. + @@ -47,5 +49,10 @@ limitations under the License. + + This event can be used by the Content App to indicate that the current user has logged out. In response to this event, the Fabric Admin SHALL remove access to this Content App by the specified Node. If no Node is provided, then the Fabric Admin SHALL remove access to all non-Admin Nodes. + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml index 7c5376098850a2..5dc01df19f65f5 100644 --- a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml @@ -50,6 +50,39 @@ limitations under the License. + + This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. + + + + + + + + + + + This command is a response to the GetProgramGuide command. + + + + + + Record a specific program or series when it goes live. This functionality enables DVR recording features. + + + + + + + + Cancel recording for a specific program or series. + + + + + + @@ -59,6 +92,8 @@ limitations under the License. + + @@ -69,6 +104,66 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -81,10 +176,26 @@ limitations under the License. + + + + + + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml new file mode 100644 index 00000000000000..89d72eb768e519 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml @@ -0,0 +1,49 @@ + + + + + + Media + Content App Observer + 0x0510 + CONTENT_APP_OBSERVER_CLUSTER + true + true + This cluster provides an interface for sending targeted commands to an Observer of a Content App on a Video Player device such as a Streaming Media Player, Smart TV or Smart Screen. The cluster server for Content App Observer is implemented by an endpoint that communicates with a Content App, such as a Casting Video Client. The cluster client for Content App Observer is implemented by a Content App endpoint. A Content App is informed of the NodeId of an Observer when a binding is set on the Content App. The Content App can then send the ContentAppMessage to the Observer (server cluster), and the Observer responds with a ContentAppMessageResponse. + + + Upon receipt, the data field MAY be parsed and interpreted. Message encoding is specific to the Content App. A Content App MAY when possible read attributes from the Basic Information Cluster on the Observer and use this to determine the Message encoding. + + + + + + This command SHALL be generated in response to ContentAppMessage command. + + + + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml new file mode 100644 index 00000000000000..6dcf825c364c03 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml @@ -0,0 +1,108 @@ + + + + + + Media + Content Control + 0x050F + CONTENT_CONTROL_CLUSTER + true + true + This cluster is used for managing the content control (including "parental control") settings on a media device such as a TV, or Set-top Box. + Enabled + OnDemandRatings + OnDemandRatingThreshold + ScheduledContentRatings + ScheduledContentRatingThreshold + ScreenDailyTime + RemainingScreenTime + BlockUnrated + + + The purpose of this command is to update the PIN used for protecting configuration of the content control settings. Upon success, the old PIN SHALL no longer work. The PIN is used to ensure that only the Node (or User) with the PIN code can make changes to the Content Control settings, for example, turn off Content Controls or modify the ScreenDailyTime. The PIN is composed of a numeric string of up to 6 human readable characters (displayable) . Upon receipt of this command, the media device SHALL check if the OldPIN field of this command is the same as the current PIN. If the PINs are the same, then the PIN code SHALL be set to NewPIN. Otherwise a response with InvalidPINCode error status SHALL be returned. The media device MAY provide a default PIN to the User via an out of band mechanism. For security reasons, it is recommended that a client encourage the user to update the PIN from its default value when performing configuration of the Content Control settings exposed by this cluster. The ResetPIN command can also be used to obtain the default PIN. + + + + + + The purpose of this command is to reset the PIN. If this command is executed successfully, a ResetPINResponse command with a new PIN SHALL be returned. + + + + This command SHALL be generated in response to a ResetPIN command. The data for this command SHALL be as follows: + + + + + The purpose of this command is to turn on the Content Control feature on a media device. On receipt of the Enable command, the media device SHALL set the Enabled attribute to TRUE. + + + + The purpose of this command is to turn off the Content Control feature on a media device. On receipt of the Disable command, the media device SHALL set the Enabled attribute to FALSE. + + + + The purpose of this command is to add the extra screen time for the user. If a client with Operate privilege invokes this command, the media device SHALL check whether the PINCode passed in the command matches the current PINCode value. If these match, then the RemainingScreenTime attribute SHALL be increased by the specified BonusTime value. If the PINs do not match, then a response with InvalidPINCode error status SHALL be returned, and no changes SHALL be made to RemainingScreenTime. If a client with Manage privilege or greater invokes this command, the media device SHALL ignore the PINCode field and directly increase the RemainingScreenTime attribute by the specified BonusTime value. A server that does not support the PM feature SHALL respond with InvalidPINCode to clients that only have Operate privilege unless: It has been provided with the PIN value to expect via an out of band mechanism, and The client has provided a PINCode that matches the expected PIN value. + + + + + + The purpose of this command is to set the ScreenDailyTime attribute. On receipt of the SetScreenDailyTime command, the media device SHALL set the ScreenDailyTime attribute to the ScreenTime value. + + + + + The purpose of this command is to specify whether programs with no Content rating must be blocked by this media device. On receipt of the BlockUnratedContent command, the media device SHALL set the BlockUnrated attribute to TRUE. + + + + The purpose of this command is to specify whether programs with no Content rating must be blocked by this media device. On receipt of the UnblockUnratedContent command, the media device SHALL set the BlockUnrated attribute to FALSE. + + + + The purpose of this command is to set the OnDemandRatingThreshold attribute. On receipt of the SetOnDemandRatingThreshold command, the media device SHALL check if the Rating field is one of values present in the OnDemandRatings attribute. If not, then a response with InvalidRating error status SHALL be returned. + + + + + The purpose of this command is to set ScheduledContentRatingThreshold attribute. On receipt of the SetScheduledContentRatingThreshold command, the media device SHALL check if the Rating field is one of values present in the ScheduledContentRatings attribute. If not, then a response with InvalidRating error status SHALL be returned. + + + + + This event SHALL be generated when the RemainingScreenTime equals 0. + + + + + + + + + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml index e76f15e609a7ef..f74b61a29f4784 100644 --- a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml @@ -34,6 +34,8 @@ limitations under the License. + + @@ -111,6 +113,9 @@ limitations under the License. + + + @@ -118,6 +123,8 @@ limitations under the License. + + @@ -127,15 +134,55 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml index 23ab5f6fd7b3e5..1d9b56dc9a1385 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml @@ -33,6 +33,10 @@ limitations under the License. PlaybackSpeed SeekRangeEnd SeekRangeStart + ActiveAudioTrack + AvailableAudioTracks + ActiveTextTrack + AvailableTextTracks @@ -61,10 +65,12 @@ limitations under the License. Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). + Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). + @@ -88,8 +94,48 @@ limitations under the License. + + Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. + + + + + + Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. + + + + + If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. + + + + If supported, this event SHALL be generated when there is a change in any of the supported attributes of the Media Playback cluster. + + + + + + + + + + + + + + + + + + + + + + + @@ -118,5 +164,31 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml index 74d1ea507e52e1..388770512ee27c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml @@ -38,6 +38,13 @@ limitations under the License. + + + This field SHALL indicate the updated target list as defined by the TargetList attribute if there is a change in the list of targets. Otherwise this field can be omitted from the event. + + + + @@ -49,7 +56,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 720a6514804268..00270e8a1c708f 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -34,6 +34,8 @@ "color-control-cluster.xml", "concentration-measurement-cluster.xml", "content-launch-cluster.xml", + "content-app-observer-cluster.xml", + "content-control-cluster.xml", "descriptor-cluster.xml", "diagnostic-logs-cluster.xml", "dishwasher-alarm-cluster.xml", @@ -312,7 +314,11 @@ "OverrunCount" ], "Channel": ["Lineup", "CurrentChannel"], - "Media Playback": ["SampledPosition"], + "Media Playback": [ + "SampledPosition", + "ActiveAudioTrack", + "ActiveTextTrack" + ], "Application Launcher": ["CurrentApp"], "Application Basic": ["Application"], "Time Synchronization": [ diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 9fe43e38eada59..ab8680bba751ac 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -33,6 +33,8 @@ "color-control-cluster.xml", "concentration-measurement-cluster.xml", "content-launch-cluster.xml", + "content-app-observer-cluster.xml", + "content-control-cluster.xml", "descriptor-cluster.xml", "diagnostic-logs-cluster.xml", "dishwasher-alarm-cluster.xml", @@ -310,7 +312,11 @@ "OverrunCount" ], "Channel": ["Lineup", "CurrentChannel"], - "Media Playback": ["SampledPosition"], + "Media Playback": [ + "SampledPosition", + "ActiveAudioTrack", + "ActiveTextTrack" + ], "Application Launcher": ["CurrentApp"], "Application Basic": ["Application"], "Time Synchronization": [ diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index d3556f225fc0cb..137f05aeda4bd4 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -25,6 +25,8 @@ "COLOR_CONTROL_CLUSTER": [], "COMMISSIONING_CLUSTER": [], "CONTENT_LAUNCHER_CLUSTER": [], + "CONTENT_CONTROL_CLUSTER": [], + "CONTENT_APP_OBSERVER_CLUSTER": [], "DESCRIPTOR_CLUSTER": [], "DEVICE_TEMP_CLUSTER": [], "DIAGNOSTIC_LOGS_CLUSTER": [], @@ -157,6 +159,8 @@ "COLOR_CONTROL_CLUSTER": ["color-control-server"], "COMMISSIONING_CLUSTER": [], "CONTENT_LAUNCHER_CLUSTER": ["content-launch-server"], + "CONTENT_CONTROL_CLUSTER": ["content-control-server"], + "CONTENT_APP_OBSERVER_CLUSTER": ["content-app-observer"], "DESCRIPTOR_CLUSTER": ["descriptor"], "DEVICE_TEMP_CLUSTER": [], "DIAGNOSTIC_LOGS_CLUSTER": ["diagnostic-logs-server"], From fabd8146321b9cfd20ee1bd9cc55c86e509108ab Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Thu, 30 Nov 2023 22:00:32 +0100 Subject: [PATCH 2/3] ZAP generated files --- .../all-clusters-minimal-app.matter | 242 +- ...ootnode_basicvideoplayer_0ff86e943b.matter | 187 +- .../placeholder/linux/apps/app1/config.matter | 484 ++- .../placeholder/linux/apps/app2/config.matter | 484 ++- examples/tv-app/tv-common/tv-app.matter | 468 ++- .../tv-casting-common/tv-casting-app.matter | 242 +- .../data_model/controller-clusters.matter | 356 +- .../chip/devicecontroller/ChipClusters.java | 1199 +++++- .../devicecontroller/ChipEventStructs.java | 288 ++ .../chip/devicecontroller/ChipStructs.java | 1176 +++++- .../devicecontroller/ClusterIDMapping.java | 493 ++- .../devicecontroller/ClusterInfoMapping.java | 759 +++- .../devicecontroller/ClusterReadMapping.java | 252 ++ .../devicecontroller/ClusterWriteMapping.java | 4 + .../AccountLoginClusterLoggedOutEvent.kt | 61 + .../MediaPlaybackClusterStateChangedEvent.kt | 118 + ...argetNavigatorClusterTargetUpdatedEvent.kt | 82 + .../chip/devicecontroller/cluster/files.gni | 15 + .../ChannelClusterAdditionalInfoStruct.kt | 56 + .../ChannelClusterChannelInfoStruct.kt | 32 +- .../ChannelClusterChannelPagingStruct.kt | 101 + .../structs/ChannelClusterPageTokenStruct.kt | 89 + .../ChannelClusterProgramCastStruct.kt | 56 + .../ChannelClusterProgramCategoryStruct.kt | 65 + .../structs/ChannelClusterProgramStruct.kt | 350 ++ .../structs/ChannelClusterSeriesInfoStruct.kt | 56 + .../ContentControlClusterRatingNameStruct.kt | 68 + ...auncherClusterPlaybackPreferencesStruct.kt | 97 + ...entLauncherClusterTrackPreferenceStruct.kt | 90 + ...diaPlaybackClusterTrackAttributesStruct.kt | 77 + .../MediaPlaybackClusterTrackStruct.kt | 72 + .../cluster/clusters/AccountLoginCluster.kt | 9 +- .../cluster/clusters/ChannelCluster.kt | 56 + .../clusters/ContentAppObserverCluster.kt | 111 + .../cluster/clusters/ContentControlCluster.kt | 280 ++ .../clusters/ContentLauncherCluster.kt | 2 + .../cluster/clusters/MediaPlaybackCluster.kt | 96 +- .../AccountLoginClusterLoggedOutEvent.kt | 61 + .../MediaPlaybackClusterStateChangedEvent.kt | 118 + ...argetNavigatorClusterTargetUpdatedEvent.kt | 80 + .../matter/devicecontroller/cluster/files.gni | 17 + .../ChannelClusterAdditionalInfoStruct.kt | 56 + .../ChannelClusterChannelInfoStruct.kt | 32 +- .../ChannelClusterChannelPagingStruct.kt | 101 + .../structs/ChannelClusterPageTokenStruct.kt | 89 + .../ChannelClusterProgramCastStruct.kt | 56 + .../ChannelClusterProgramCategoryStruct.kt | 65 + .../structs/ChannelClusterProgramStruct.kt | 350 ++ .../structs/ChannelClusterSeriesInfoStruct.kt | 56 + .../ContentControlClusterRatingNameStruct.kt | 68 + ...auncherClusterPlaybackPreferencesStruct.kt | 97 + ...entLauncherClusterTrackPreferenceStruct.kt | 90 + ...diaPlaybackClusterTrackAttributesStruct.kt | 77 + .../MediaPlaybackClusterTrackStruct.kt | 72 + .../CHIPAttributeTLVValueDecoder.cpp | 947 ++++- .../java/zap-generated/CHIPClientCallbacks.h | 32 + .../CHIPEventTLVValueDecoder.cpp | 317 ++ .../zap-generated/CHIPInvokeCallbacks.cpp | 682 +++ .../java/zap-generated/CHIPInvokeCallbacks.h | 45 + .../java/zap-generated/CHIPReadCallbacks.cpp | 1118 ++++- .../python/chip/clusters/CHIPClusters.py | 299 ++ .../python/chip/clusters/Objects.py | 1214 +++++- .../MTRAttributeSpecifiedCheck.mm | 96 + .../MTRAttributeTLVValueDecoder.mm | 434 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 403 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 1330 +++++- .../CHIP/zap-generated/MTRClusterConstants.h | 72 + .../CHIP/zap-generated/MTRClusters.h | 136 +- .../CHIP/zap-generated/MTRClusters.mm | 631 ++- .../zap-generated/MTRCommandPayloadsObjc.h | 605 +++ .../zap-generated/MTRCommandPayloadsObjc.mm | 3670 +++++++++++++---- .../MTRCommandPayloads_Internal.h | 120 + .../zap-generated/MTRCommandTimedCheck.mm | 24 + .../zap-generated/MTREventTLVValueDecoder.mm | 178 + .../CHIP/zap-generated/MTRStructsObjc.h | 123 + .../CHIP/zap-generated/MTRStructsObjc.mm | 562 ++- .../zap-generated/attributes/Accessors.cpp | 322 ++ .../zap-generated/attributes/Accessors.h | 62 + .../app-common/zap-generated/callback.h | 272 ++ .../zap-generated/cluster-enums-check.h | 91 +- .../app-common/zap-generated/cluster-enums.h | 137 +- .../zap-generated/cluster-objects.cpp | 3154 ++++++++++---- .../zap-generated/cluster-objects.h | 1697 +++++++- .../app-common/zap-generated/ids/Attributes.h | 108 + .../app-common/zap-generated/ids/Clusters.h | 6 + .../app-common/zap-generated/ids/Commands.h | 92 + .../app-common/zap-generated/ids/Events.h | 40 + .../app-common/zap-generated/print-cluster.h | 14 + .../zap-generated/cluster/Commands.h | 1178 +++++- .../cluster/ComplexArgumentParser.cpp | 551 +++ .../cluster/ComplexArgumentParser.h | 61 + .../cluster/logging/DataModelLogger.cpp | 871 +++- .../cluster/logging/DataModelLogger.h | 51 + .../zap-generated/cluster/Commands.h | 3524 ++++++++++++++++ .../zap-generated/test/Commands.h | 724 +++- 95 files changed, 34189 insertions(+), 1962 deletions(-) create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccountLoginClusterLoggedOutEvent.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/MediaPlaybackClusterStateChangedEvent.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterPageTokenStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCastStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterPlaybackPreferencesStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterTrackPreferenceStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackAttributesStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentAppObserverCluster.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentControlCluster.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/AccountLoginClusterLoggedOutEvent.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/MediaPlaybackClusterStateChangedEvent.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterPageTokenStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramCastStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterPlaybackPreferencesStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterTrackPreferenceStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterTrackAttributesStruct.kt create mode 100644 src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt 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 0e8c85ddc42de7..f9a695d21e6d8d 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 @@ -4270,6 +4270,12 @@ cluster WakeOnLan = 1283 { cluster Channel = 1284 { revision 1; // NOTE: Default/not specifically set + enum ChannelTypeEnum : enum8 { + kSatellite = 0; + kCable = 1; + kTerrestrial = 2; + } + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } @@ -4283,6 +4289,29 @@ cluster Channel = 1284 { bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; + kElectronicGuide = 0x3; + kRecordProgram = 0x4; + } + + bitmap RecordingFlagBitmap : bitmap32 { + kScheduled = 0x1; + kRecordSeries = 0x2; + kRecorded = 0x3; + } + + struct ProgramCastStruct { + char_string name = 0; + char_string role = 1; + } + + struct ProgramCategoryStruct { + char_string category = 0; + optional char_string subCategory = 1; + } + + struct SeriesInfoStruct { + char_string season = 0; + char_string episode = 1; } struct ChannelInfoStruct { @@ -4291,6 +4320,46 @@ cluster Channel = 1284 { optional char_string name = 2; optional char_string callSign = 3; optional char_string affiliateCallSign = 4; + optional char_string identifier = 5; + optional ChannelTypeEnum type = 6; + } + + struct ProgramStruct { + char_string identifier = 0; + ChannelInfoStruct channel = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + char_string title = 4; + optional char_string subtitle = 5; + optional char_string description = 6; + optional char_string audioLanguages[] = 7; + optional char_string ratings[] = 8; + optional char_string thumbnailUrl = 9; + optional char_string posterArtUrl = 10; + optional char_string dvbiUrl = 11; + optional char_string releaseDate = 12; + optional char_string parentalGuidanceText = 13; + optional RecordingFlagBitmap recordingFlag = 14; + optional nullable SeriesInfoStruct seriesInfo = 15; + optional ProgramCategoryStruct categoryList[] = 16; + optional ProgramCastStruct castList[] = 17; + optional ProgramCastStruct externalIDList[] = 18; + } + + struct PageTokenStruct { + optional int16u limit = 0; + optional char_string after = 1; + optional char_string before = 2; + } + + struct ChannelPagingStruct { + optional nullable PageTokenStruct previousToken = 0; + optional nullable PageTokenStruct nextToken = 1; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct LineupInfoStruct { @@ -4328,12 +4397,47 @@ cluster Channel = 1284 { int16s count = 0; } + request struct GetProgramGuideRequest { + optional epoch_s startTime = 0; + optional epoch_s endTime = 1; + optional ChannelInfoStruct channelList[] = 2; + optional PageTokenStruct pageToken = 3; + optional RecordingFlagBitmap recordingFlag = 4; + optional AdditionalInfoStruct externalIDList[] = 5; + optional octet_string data = 6; + } + + response struct ProgramGuideResponse = 5 { + int16s channelPagingStruct = 0; + ProgramStruct programList[] = 1; + } + + request struct RecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + + request struct CancelRecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; /** Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute. */ command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; /** This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. */ command SkipChannel(SkipChannelRequest): DefaultSuccess = 3; + /** This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. */ + command GetProgramGuide(GetProgramGuideRequest): ProgramGuideResponse = 4; + /** Record a specific program or series when it goes live. This functionality enables DVR recording features. */ + command RecordProgram(RecordProgramRequest): DefaultSuccess = 6; + /** Cancel recording for a specific program or series. */ + command CancelRecordProgram(CancelRecordProgramRequest): DefaultSuccess = 7; } /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ @@ -4351,6 +4455,12 @@ cluster TargetNavigator = 1285 { char_string name = 1; } + info event TargetUpdated = 0 { + TargetInfoStruct targetList[] = 0; + int8u currentTarget = 1; + octet_string data = 2; + } + readonly attribute TargetInfoStruct targetList[] = 0; readonly attribute optional int8u currentTarget = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -4378,6 +4488,27 @@ cluster TargetNavigator = 1285 { cluster MediaPlayback = 1286 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; @@ -4397,6 +4528,19 @@ cluster MediaPlayback = 1286 { bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; + kTextTracks = 0x3; + kAudioTracks = 0x4; + kAudioAdvance = 0x5; + } + + struct TrackAttributesStruct { + char_string<32> languageCode = 0; + optional nullable char_string displayName = 1; + } + + struct TrackStruct { + char_string<32> id = 0; + nullable TrackAttributesStruct trackAttributes = 1; } struct PlaybackPositionStruct { @@ -4404,6 +4548,18 @@ cluster MediaPlayback = 1286 { nullable int64u position = 1; } + info event StateChanged = 0 { + PlaybackStateEnum currentState = 0; + EPOCH_US startTime = 1; + INT64U duration = 2; + PlaybackPositionStruct sampledPosition = 3; + single playbackSpeed = 4; + INT64U seekRangeEnd = 5; + INT64U seekRangeStart = 6; + optional OCTET_STRING data = 7; + boolean audioAdvanceUnmuted = 8; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute optional nullable epoch_us startTime = 1; readonly attribute optional nullable int64u duration = 2; @@ -4411,6 +4567,10 @@ cluster MediaPlayback = 1286 { readonly attribute optional single playbackSpeed = 4; readonly attribute optional nullable int64u seekRangeEnd = 5; readonly attribute optional nullable int64u seekRangeStart = 6; + readonly attribute optional nullable TrackStruct activeAudioTrack = 7; + readonly attribute optional nullable TrackStruct availableAudioTracks[] = 8; + readonly attribute optional nullable TrackStruct activeTextTrack = 9; + readonly attribute optional nullable TrackStruct availableTextTracks[] = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4418,6 +4578,14 @@ cluster MediaPlayback = 1286 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct RewindRequest { + optional boolean audioAdvanceUnmuted = 0; + } + + request struct FastForwardRequest { + optional boolean audioAdvanceUnmuted = 0; + } + request struct SkipForwardRequest { int64u deltaPositionMilliseconds = 0; } @@ -4435,6 +4603,15 @@ cluster MediaPlayback = 1286 { int64u position = 0; } + request struct ActivateAudioTrackRequest { + CHAR_STRING trackID = 0; + INT8U audioOutputIndex = 1; + } + + request struct ActivateTextTrackRequest { + CHAR_STRING trackID = 0; + } + /** Upon receipt, this SHALL play media. */ command Play(): PlaybackResponse = 0; /** Upon receipt, this SHALL pause media. */ @@ -4448,15 +4625,21 @@ cluster MediaPlayback = 1286 { /** Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. */ command Next(): PlaybackResponse = 5; /** Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command Rewind(): PlaybackResponse = 6; + command Rewind(RewindRequest): PlaybackResponse = 6; /** Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command FastForward(): PlaybackResponse = 7; + command FastForward(FastForwardRequest): PlaybackResponse = 7; /** Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: */ command SkipForward(SkipForwardRequest): PlaybackResponse = 8; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command SkipBackward(SkipBackwardRequest): PlaybackResponse = 9; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command Seek(SeekRequest): PlaybackResponse = 11; + /** Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. */ + command ActivateAudioTrack(ActivateAudioTrackRequest): DefaultSuccess = 12; + /** Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. */ + command ActivateTextTrack(ActivateTextTrackRequest): DefaultSuccess = 13; + /** If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. */ + command DeactivateTextTrack(): DefaultSuccess = 14; } /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ @@ -4660,6 +4843,27 @@ cluster KeypadInput = 1289 { cluster ContentLauncher = 1290 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; @@ -4680,22 +4884,31 @@ cluster ContentLauncher = 1290 { kSportsTeam = 11; kType = 12; kVideo = 13; + kSeason = 14; + kEpisode = 15; + kAny = 16; } enum StatusEnum : enum8 { kSuccess = 0; kURLNotAvailable = 1; kAuthFailed = 2; + kTextTrackNotAvailable = 3; + kAudioTrackNotAvailable = 4; } bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; + kAdvancedSeek = 0x3; + kTextTracks = 0x4; + kAudioTracks = 0x5; } bitmap SupportedProtocolsBitmap : bitmap32 { kDASH = 0x1; kHLS = 0x2; + kWebRTC = 0x2; } struct DimensionStruct { @@ -4704,6 +4917,18 @@ cluster ContentLauncher = 1290 { MetricTypeEnum metric = 2; } + struct TrackPreferenceStruct { + char_string<32> languageCode = 0; + optional CharacteristicEnum characteristics[] = 1; + int8u audioOutputIndex = 2; + } + + struct PlaybackPreferencesStruct { + int64u playbackPosition = 0; + TrackPreferenceStruct textTrack = 1; + optional TrackPreferenceStruct audioTracks[] = 2; + } + struct AdditionalInfoStruct { char_string<256> name = 0; char_string<8192> value = 1; @@ -4747,6 +4972,8 @@ cluster ContentLauncher = 1290 { ContentSearchStruct search = 0; boolean autoPlay = 1; optional char_string data = 2; + optional PlaybackPreferencesStruct playbackPreferences = 3; + optional boolean useCurrentContext = 4; } request struct LaunchURLRequest { @@ -4908,6 +5135,10 @@ cluster ApplicationBasic = 1293 { cluster AccountLogin = 1294 { revision 1; // NOTE: Default/not specifically set + critical event LoggedOut = 0 { + optional node_id node = 0; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4926,6 +5157,11 @@ cluster AccountLogin = 1294 { request struct LoginRequest { char_string<100> tempAccountIdentifier = 0; char_string setupPIN = 1; + optional node_id node = 2; + } + + request struct LogoutRequest { + optional node_id node = 0; } /** Upon receipt, the Content App checks if the account associated with the client Temp Account Identifier Rotating ID is the same acount that is active on the given Content App. If the accounts are the same, then the Content App includes the Setup PIN in the GetSetupPIN Response. */ @@ -4933,7 +5169,7 @@ cluster AccountLogin = 1294 { /** Upon receipt, the Content App checks if the account associated with the client’s Temp Account Identifier (Rotating ID) has a current active Setup PIN with the given value. If the Setup PIN is valid for the user account associated with the Temp Account Identifier, then the Content App MAY make that user account active. */ fabric timed command access(invoke: administer) Login(LoginRequest): DefaultSuccess = 2; /** The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. */ - fabric timed command Logout(): DefaultSuccess = 3; + fabric timed command Logout(LogoutRequest): DefaultSuccess = 3; } /** The Test Cluster is meant to validate the generated code */ diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index c459ab1e46b03e..e3da1bf7d4c4ef 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -1230,6 +1230,12 @@ cluster WakeOnLan = 1283 { cluster Channel = 1284 { revision 1; // NOTE: Default/not specifically set + enum ChannelTypeEnum : enum8 { + kSatellite = 0; + kCable = 1; + kTerrestrial = 2; + } + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } @@ -1243,6 +1249,29 @@ cluster Channel = 1284 { bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; + kElectronicGuide = 0x3; + kRecordProgram = 0x4; + } + + bitmap RecordingFlagBitmap : bitmap32 { + kScheduled = 0x1; + kRecordSeries = 0x2; + kRecorded = 0x3; + } + + struct ProgramCastStruct { + char_string name = 0; + char_string role = 1; + } + + struct ProgramCategoryStruct { + char_string category = 0; + optional char_string subCategory = 1; + } + + struct SeriesInfoStruct { + char_string season = 0; + char_string episode = 1; } struct ChannelInfoStruct { @@ -1251,6 +1280,46 @@ cluster Channel = 1284 { optional char_string name = 2; optional char_string callSign = 3; optional char_string affiliateCallSign = 4; + optional char_string identifier = 5; + optional ChannelTypeEnum type = 6; + } + + struct ProgramStruct { + char_string identifier = 0; + ChannelInfoStruct channel = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + char_string title = 4; + optional char_string subtitle = 5; + optional char_string description = 6; + optional char_string audioLanguages[] = 7; + optional char_string ratings[] = 8; + optional char_string thumbnailUrl = 9; + optional char_string posterArtUrl = 10; + optional char_string dvbiUrl = 11; + optional char_string releaseDate = 12; + optional char_string parentalGuidanceText = 13; + optional RecordingFlagBitmap recordingFlag = 14; + optional nullable SeriesInfoStruct seriesInfo = 15; + optional ProgramCategoryStruct categoryList[] = 16; + optional ProgramCastStruct castList[] = 17; + optional ProgramCastStruct externalIDList[] = 18; + } + + struct PageTokenStruct { + optional int16u limit = 0; + optional char_string after = 1; + optional char_string before = 2; + } + + struct ChannelPagingStruct { + optional nullable PageTokenStruct previousToken = 0; + optional nullable PageTokenStruct nextToken = 1; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct LineupInfoStruct { @@ -1288,12 +1357,47 @@ cluster Channel = 1284 { int16s count = 0; } + request struct GetProgramGuideRequest { + optional epoch_s startTime = 0; + optional epoch_s endTime = 1; + optional ChannelInfoStruct channelList[] = 2; + optional PageTokenStruct pageToken = 3; + optional RecordingFlagBitmap recordingFlag = 4; + optional AdditionalInfoStruct externalIDList[] = 5; + optional octet_string data = 6; + } + + response struct ProgramGuideResponse = 5 { + int16s channelPagingStruct = 0; + ProgramStruct programList[] = 1; + } + + request struct RecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + + request struct CancelRecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; /** Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute. */ command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; /** This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. */ command SkipChannel(SkipChannelRequest): DefaultSuccess = 3; + /** This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. */ + command GetProgramGuide(GetProgramGuideRequest): ProgramGuideResponse = 4; + /** Record a specific program or series when it goes live. This functionality enables DVR recording features. */ + command RecordProgram(RecordProgramRequest): DefaultSuccess = 6; + /** Cancel recording for a specific program or series. */ + command CancelRecordProgram(CancelRecordProgramRequest): DefaultSuccess = 7; } /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ @@ -1311,6 +1415,12 @@ cluster TargetNavigator = 1285 { char_string name = 1; } + info event TargetUpdated = 0 { + TargetInfoStruct targetList[] = 0; + int8u currentTarget = 1; + octet_string data = 2; + } + readonly attribute TargetInfoStruct targetList[] = 0; readonly attribute optional int8u currentTarget = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -1338,6 +1448,27 @@ cluster TargetNavigator = 1285 { cluster MediaPlayback = 1286 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; @@ -1357,6 +1488,19 @@ cluster MediaPlayback = 1286 { bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; + kTextTracks = 0x3; + kAudioTracks = 0x4; + kAudioAdvance = 0x5; + } + + struct TrackAttributesStruct { + char_string<32> languageCode = 0; + optional nullable char_string displayName = 1; + } + + struct TrackStruct { + char_string<32> id = 0; + nullable TrackAttributesStruct trackAttributes = 1; } struct PlaybackPositionStruct { @@ -1364,6 +1508,18 @@ cluster MediaPlayback = 1286 { nullable int64u position = 1; } + info event StateChanged = 0 { + PlaybackStateEnum currentState = 0; + EPOCH_US startTime = 1; + INT64U duration = 2; + PlaybackPositionStruct sampledPosition = 3; + single playbackSpeed = 4; + INT64U seekRangeEnd = 5; + INT64U seekRangeStart = 6; + optional OCTET_STRING data = 7; + boolean audioAdvanceUnmuted = 8; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute optional nullable epoch_us startTime = 1; readonly attribute optional nullable int64u duration = 2; @@ -1371,6 +1527,10 @@ cluster MediaPlayback = 1286 { readonly attribute optional single playbackSpeed = 4; readonly attribute optional nullable int64u seekRangeEnd = 5; readonly attribute optional nullable int64u seekRangeStart = 6; + readonly attribute optional nullable TrackStruct activeAudioTrack = 7; + readonly attribute optional nullable TrackStruct availableAudioTracks[] = 8; + readonly attribute optional nullable TrackStruct activeTextTrack = 9; + readonly attribute optional nullable TrackStruct availableTextTracks[] = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1378,6 +1538,14 @@ cluster MediaPlayback = 1286 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct RewindRequest { + optional boolean audioAdvanceUnmuted = 0; + } + + request struct FastForwardRequest { + optional boolean audioAdvanceUnmuted = 0; + } + request struct SkipForwardRequest { int64u deltaPositionMilliseconds = 0; } @@ -1395,6 +1563,15 @@ cluster MediaPlayback = 1286 { int64u position = 0; } + request struct ActivateAudioTrackRequest { + CHAR_STRING trackID = 0; + INT8U audioOutputIndex = 1; + } + + request struct ActivateTextTrackRequest { + CHAR_STRING trackID = 0; + } + /** Upon receipt, this SHALL play media. */ command Play(): PlaybackResponse = 0; /** Upon receipt, this SHALL pause media. */ @@ -1408,15 +1585,21 @@ cluster MediaPlayback = 1286 { /** Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. */ command Next(): PlaybackResponse = 5; /** Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command Rewind(): PlaybackResponse = 6; + command Rewind(RewindRequest): PlaybackResponse = 6; /** Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command FastForward(): PlaybackResponse = 7; + command FastForward(FastForwardRequest): PlaybackResponse = 7; /** Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: */ command SkipForward(SkipForwardRequest): PlaybackResponse = 8; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command SkipBackward(SkipBackwardRequest): PlaybackResponse = 9; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command Seek(SeekRequest): PlaybackResponse = 11; + /** Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. */ + command ActivateAudioTrack(ActivateAudioTrackRequest): DefaultSuccess = 12; + /** Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. */ + command ActivateTextTrack(ActivateTextTrackRequest): DefaultSuccess = 13; + /** If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. */ + command DeactivateTextTrack(): DefaultSuccess = 14; } /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 27222ce0d236d3..839a1e0e525597 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -5900,6 +5900,12 @@ cluster OccupancySensing = 1030 { cluster Channel = 1284 { revision 1; // NOTE: Default/not specifically set + enum ChannelTypeEnum : enum8 { + kSatellite = 0; + kCable = 1; + kTerrestrial = 2; + } + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } @@ -5913,6 +5919,29 @@ cluster Channel = 1284 { bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; + kElectronicGuide = 0x3; + kRecordProgram = 0x4; + } + + bitmap RecordingFlagBitmap : bitmap32 { + kScheduled = 0x1; + kRecordSeries = 0x2; + kRecorded = 0x3; + } + + struct ProgramCastStruct { + char_string name = 0; + char_string role = 1; + } + + struct ProgramCategoryStruct { + char_string category = 0; + optional char_string subCategory = 1; + } + + struct SeriesInfoStruct { + char_string season = 0; + char_string episode = 1; } struct ChannelInfoStruct { @@ -5921,6 +5950,46 @@ cluster Channel = 1284 { optional char_string name = 2; optional char_string callSign = 3; optional char_string affiliateCallSign = 4; + optional char_string identifier = 5; + optional ChannelTypeEnum type = 6; + } + + struct ProgramStruct { + char_string identifier = 0; + ChannelInfoStruct channel = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + char_string title = 4; + optional char_string subtitle = 5; + optional char_string description = 6; + optional char_string audioLanguages[] = 7; + optional char_string ratings[] = 8; + optional char_string thumbnailUrl = 9; + optional char_string posterArtUrl = 10; + optional char_string dvbiUrl = 11; + optional char_string releaseDate = 12; + optional char_string parentalGuidanceText = 13; + optional RecordingFlagBitmap recordingFlag = 14; + optional nullable SeriesInfoStruct seriesInfo = 15; + optional ProgramCategoryStruct categoryList[] = 16; + optional ProgramCastStruct castList[] = 17; + optional ProgramCastStruct externalIDList[] = 18; + } + + struct PageTokenStruct { + optional int16u limit = 0; + optional char_string after = 1; + optional char_string before = 2; + } + + struct ChannelPagingStruct { + optional nullable PageTokenStruct previousToken = 0; + optional nullable PageTokenStruct nextToken = 1; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct LineupInfoStruct { @@ -5958,18 +6027,59 @@ cluster Channel = 1284 { int16s count = 0; } + request struct GetProgramGuideRequest { + optional epoch_s startTime = 0; + optional epoch_s endTime = 1; + optional ChannelInfoStruct channelList[] = 2; + optional PageTokenStruct pageToken = 3; + optional RecordingFlagBitmap recordingFlag = 4; + optional AdditionalInfoStruct externalIDList[] = 5; + optional octet_string data = 6; + } + + response struct ProgramGuideResponse = 5 { + int16s channelPagingStruct = 0; + ProgramStruct programList[] = 1; + } + + request struct RecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + + request struct CancelRecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; /** Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute. */ command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; /** This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. */ command SkipChannel(SkipChannelRequest): DefaultSuccess = 3; + /** This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. */ + command GetProgramGuide(GetProgramGuideRequest): ProgramGuideResponse = 4; + /** Record a specific program or series when it goes live. This functionality enables DVR recording features. */ + command RecordProgram(RecordProgramRequest): DefaultSuccess = 6; + /** Cancel recording for a specific program or series. */ + command CancelRecordProgram(CancelRecordProgramRequest): DefaultSuccess = 7; } /** This cluster provides an interface for controlling the current Channel on a device. */ cluster Channel = 1284 { revision 1; // NOTE: Default/not specifically set + enum ChannelTypeEnum : enum8 { + kSatellite = 0; + kCable = 1; + kTerrestrial = 2; + } + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } @@ -5983,6 +6093,29 @@ cluster Channel = 1284 { bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; + kElectronicGuide = 0x3; + kRecordProgram = 0x4; + } + + bitmap RecordingFlagBitmap : bitmap32 { + kScheduled = 0x1; + kRecordSeries = 0x2; + kRecorded = 0x3; + } + + struct ProgramCastStruct { + char_string name = 0; + char_string role = 1; + } + + struct ProgramCategoryStruct { + char_string category = 0; + optional char_string subCategory = 1; + } + + struct SeriesInfoStruct { + char_string season = 0; + char_string episode = 1; } struct ChannelInfoStruct { @@ -5991,6 +6124,46 @@ cluster Channel = 1284 { optional char_string name = 2; optional char_string callSign = 3; optional char_string affiliateCallSign = 4; + optional char_string identifier = 5; + optional ChannelTypeEnum type = 6; + } + + struct ProgramStruct { + char_string identifier = 0; + ChannelInfoStruct channel = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + char_string title = 4; + optional char_string subtitle = 5; + optional char_string description = 6; + optional char_string audioLanguages[] = 7; + optional char_string ratings[] = 8; + optional char_string thumbnailUrl = 9; + optional char_string posterArtUrl = 10; + optional char_string dvbiUrl = 11; + optional char_string releaseDate = 12; + optional char_string parentalGuidanceText = 13; + optional RecordingFlagBitmap recordingFlag = 14; + optional nullable SeriesInfoStruct seriesInfo = 15; + optional ProgramCategoryStruct categoryList[] = 16; + optional ProgramCastStruct castList[] = 17; + optional ProgramCastStruct externalIDList[] = 18; + } + + struct PageTokenStruct { + optional int16u limit = 0; + optional char_string after = 1; + optional char_string before = 2; + } + + struct ChannelPagingStruct { + optional nullable PageTokenStruct previousToken = 0; + optional nullable PageTokenStruct nextToken = 1; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct LineupInfoStruct { @@ -6028,12 +6201,47 @@ cluster Channel = 1284 { int16s count = 0; } + request struct GetProgramGuideRequest { + optional epoch_s startTime = 0; + optional epoch_s endTime = 1; + optional ChannelInfoStruct channelList[] = 2; + optional PageTokenStruct pageToken = 3; + optional RecordingFlagBitmap recordingFlag = 4; + optional AdditionalInfoStruct externalIDList[] = 5; + optional octet_string data = 6; + } + + response struct ProgramGuideResponse = 5 { + int16s channelPagingStruct = 0; + ProgramStruct programList[] = 1; + } + + request struct RecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + + request struct CancelRecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; /** Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute. */ command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; /** This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. */ command SkipChannel(SkipChannelRequest): DefaultSuccess = 3; + /** This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. */ + command GetProgramGuide(GetProgramGuideRequest): ProgramGuideResponse = 4; + /** Record a specific program or series when it goes live. This functionality enables DVR recording features. */ + command RecordProgram(RecordProgramRequest): DefaultSuccess = 6; + /** Cancel recording for a specific program or series. */ + command CancelRecordProgram(CancelRecordProgramRequest): DefaultSuccess = 7; } /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ @@ -6051,6 +6259,12 @@ cluster TargetNavigator = 1285 { char_string name = 1; } + info event TargetUpdated = 0 { + TargetInfoStruct targetList[] = 0; + int8u currentTarget = 1; + octet_string data = 2; + } + readonly attribute TargetInfoStruct targetList[] = 0; readonly attribute optional int8u currentTarget = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -6089,6 +6303,12 @@ cluster TargetNavigator = 1285 { char_string name = 1; } + info event TargetUpdated = 0 { + TargetInfoStruct targetList[] = 0; + int8u currentTarget = 1; + octet_string data = 2; + } + readonly attribute TargetInfoStruct targetList[] = 0; readonly attribute optional int8u currentTarget = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -6116,6 +6336,27 @@ cluster TargetNavigator = 1285 { cluster MediaPlayback = 1286 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; @@ -6135,6 +6376,19 @@ cluster MediaPlayback = 1286 { bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; + kTextTracks = 0x3; + kAudioTracks = 0x4; + kAudioAdvance = 0x5; + } + + struct TrackAttributesStruct { + char_string<32> languageCode = 0; + optional nullable char_string displayName = 1; + } + + struct TrackStruct { + char_string<32> id = 0; + nullable TrackAttributesStruct trackAttributes = 1; } struct PlaybackPositionStruct { @@ -6142,6 +6396,18 @@ cluster MediaPlayback = 1286 { nullable int64u position = 1; } + info event StateChanged = 0 { + PlaybackStateEnum currentState = 0; + EPOCH_US startTime = 1; + INT64U duration = 2; + PlaybackPositionStruct sampledPosition = 3; + single playbackSpeed = 4; + INT64U seekRangeEnd = 5; + INT64U seekRangeStart = 6; + optional OCTET_STRING data = 7; + boolean audioAdvanceUnmuted = 8; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute optional nullable epoch_us startTime = 1; readonly attribute optional nullable int64u duration = 2; @@ -6149,6 +6415,10 @@ cluster MediaPlayback = 1286 { readonly attribute optional single playbackSpeed = 4; readonly attribute optional nullable int64u seekRangeEnd = 5; readonly attribute optional nullable int64u seekRangeStart = 6; + readonly attribute optional nullable TrackStruct activeAudioTrack = 7; + readonly attribute optional nullable TrackStruct availableAudioTracks[] = 8; + readonly attribute optional nullable TrackStruct activeTextTrack = 9; + readonly attribute optional nullable TrackStruct availableTextTracks[] = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6156,6 +6426,14 @@ cluster MediaPlayback = 1286 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct RewindRequest { + optional boolean audioAdvanceUnmuted = 0; + } + + request struct FastForwardRequest { + optional boolean audioAdvanceUnmuted = 0; + } + request struct SkipForwardRequest { int64u deltaPositionMilliseconds = 0; } @@ -6173,6 +6451,15 @@ cluster MediaPlayback = 1286 { int64u position = 0; } + request struct ActivateAudioTrackRequest { + CHAR_STRING trackID = 0; + INT8U audioOutputIndex = 1; + } + + request struct ActivateTextTrackRequest { + CHAR_STRING trackID = 0; + } + /** Upon receipt, this SHALL play media. */ command Play(): PlaybackResponse = 0; /** Upon receipt, this SHALL pause media. */ @@ -6186,21 +6473,48 @@ cluster MediaPlayback = 1286 { /** Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. */ command Next(): PlaybackResponse = 5; /** Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command Rewind(): PlaybackResponse = 6; + command Rewind(RewindRequest): PlaybackResponse = 6; /** Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command FastForward(): PlaybackResponse = 7; + command FastForward(FastForwardRequest): PlaybackResponse = 7; /** Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: */ command SkipForward(SkipForwardRequest): PlaybackResponse = 8; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command SkipBackward(SkipBackwardRequest): PlaybackResponse = 9; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command Seek(SeekRequest): PlaybackResponse = 11; + /** Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. */ + command ActivateAudioTrack(ActivateAudioTrackRequest): DefaultSuccess = 12; + /** Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. */ + command ActivateTextTrack(ActivateTextTrackRequest): DefaultSuccess = 13; + /** If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. */ + command DeactivateTextTrack(): DefaultSuccess = 14; } /** This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. */ cluster MediaPlayback = 1286 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; @@ -6220,6 +6534,19 @@ cluster MediaPlayback = 1286 { bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; + kTextTracks = 0x3; + kAudioTracks = 0x4; + kAudioAdvance = 0x5; + } + + struct TrackAttributesStruct { + char_string<32> languageCode = 0; + optional nullable char_string displayName = 1; + } + + struct TrackStruct { + char_string<32> id = 0; + nullable TrackAttributesStruct trackAttributes = 1; } struct PlaybackPositionStruct { @@ -6227,6 +6554,18 @@ cluster MediaPlayback = 1286 { nullable int64u position = 1; } + info event StateChanged = 0 { + PlaybackStateEnum currentState = 0; + EPOCH_US startTime = 1; + INT64U duration = 2; + PlaybackPositionStruct sampledPosition = 3; + single playbackSpeed = 4; + INT64U seekRangeEnd = 5; + INT64U seekRangeStart = 6; + optional OCTET_STRING data = 7; + boolean audioAdvanceUnmuted = 8; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute optional nullable epoch_us startTime = 1; readonly attribute optional nullable int64u duration = 2; @@ -6234,6 +6573,10 @@ cluster MediaPlayback = 1286 { readonly attribute optional single playbackSpeed = 4; readonly attribute optional nullable int64u seekRangeEnd = 5; readonly attribute optional nullable int64u seekRangeStart = 6; + readonly attribute optional nullable TrackStruct activeAudioTrack = 7; + readonly attribute optional nullable TrackStruct availableAudioTracks[] = 8; + readonly attribute optional nullable TrackStruct activeTextTrack = 9; + readonly attribute optional nullable TrackStruct availableTextTracks[] = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6241,6 +6584,14 @@ cluster MediaPlayback = 1286 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct RewindRequest { + optional boolean audioAdvanceUnmuted = 0; + } + + request struct FastForwardRequest { + optional boolean audioAdvanceUnmuted = 0; + } + request struct SkipForwardRequest { int64u deltaPositionMilliseconds = 0; } @@ -6258,6 +6609,15 @@ cluster MediaPlayback = 1286 { int64u position = 0; } + request struct ActivateAudioTrackRequest { + CHAR_STRING trackID = 0; + INT8U audioOutputIndex = 1; + } + + request struct ActivateTextTrackRequest { + CHAR_STRING trackID = 0; + } + /** Upon receipt, this SHALL play media. */ command Play(): PlaybackResponse = 0; /** Upon receipt, this SHALL pause media. */ @@ -6271,15 +6631,21 @@ cluster MediaPlayback = 1286 { /** Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. */ command Next(): PlaybackResponse = 5; /** Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command Rewind(): PlaybackResponse = 6; + command Rewind(RewindRequest): PlaybackResponse = 6; /** Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command FastForward(): PlaybackResponse = 7; + command FastForward(FastForwardRequest): PlaybackResponse = 7; /** Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: */ command SkipForward(SkipForwardRequest): PlaybackResponse = 8; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command SkipBackward(SkipBackwardRequest): PlaybackResponse = 9; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command Seek(SeekRequest): PlaybackResponse = 11; + /** Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. */ + command ActivateAudioTrack(ActivateAudioTrackRequest): DefaultSuccess = 12; + /** Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. */ + command ActivateTextTrack(ActivateTextTrackRequest): DefaultSuccess = 13; + /** If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. */ + command DeactivateTextTrack(): DefaultSuccess = 14; } /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ @@ -6665,6 +7031,27 @@ cluster KeypadInput = 1289 { cluster ContentLauncher = 1290 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; @@ -6685,22 +7072,31 @@ cluster ContentLauncher = 1290 { kSportsTeam = 11; kType = 12; kVideo = 13; + kSeason = 14; + kEpisode = 15; + kAny = 16; } enum StatusEnum : enum8 { kSuccess = 0; kURLNotAvailable = 1; kAuthFailed = 2; + kTextTrackNotAvailable = 3; + kAudioTrackNotAvailable = 4; } bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; + kAdvancedSeek = 0x3; + kTextTracks = 0x4; + kAudioTracks = 0x5; } bitmap SupportedProtocolsBitmap : bitmap32 { kDASH = 0x1; kHLS = 0x2; + kWebRTC = 0x2; } struct DimensionStruct { @@ -6709,6 +7105,18 @@ cluster ContentLauncher = 1290 { MetricTypeEnum metric = 2; } + struct TrackPreferenceStruct { + char_string<32> languageCode = 0; + optional CharacteristicEnum characteristics[] = 1; + int8u audioOutputIndex = 2; + } + + struct PlaybackPreferencesStruct { + int64u playbackPosition = 0; + TrackPreferenceStruct textTrack = 1; + optional TrackPreferenceStruct audioTracks[] = 2; + } + struct AdditionalInfoStruct { char_string<256> name = 0; char_string<8192> value = 1; @@ -6752,6 +7160,8 @@ cluster ContentLauncher = 1290 { ContentSearchStruct search = 0; boolean autoPlay = 1; optional char_string data = 2; + optional PlaybackPreferencesStruct playbackPreferences = 3; + optional boolean useCurrentContext = 4; } request struct LaunchURLRequest { @@ -6775,6 +7185,27 @@ cluster ContentLauncher = 1290 { cluster ContentLauncher = 1290 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; @@ -6795,22 +7226,31 @@ cluster ContentLauncher = 1290 { kSportsTeam = 11; kType = 12; kVideo = 13; + kSeason = 14; + kEpisode = 15; + kAny = 16; } enum StatusEnum : enum8 { kSuccess = 0; kURLNotAvailable = 1; kAuthFailed = 2; + kTextTrackNotAvailable = 3; + kAudioTrackNotAvailable = 4; } bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; + kAdvancedSeek = 0x3; + kTextTracks = 0x4; + kAudioTracks = 0x5; } bitmap SupportedProtocolsBitmap : bitmap32 { kDASH = 0x1; kHLS = 0x2; + kWebRTC = 0x2; } struct DimensionStruct { @@ -6819,6 +7259,18 @@ cluster ContentLauncher = 1290 { MetricTypeEnum metric = 2; } + struct TrackPreferenceStruct { + char_string<32> languageCode = 0; + optional CharacteristicEnum characteristics[] = 1; + int8u audioOutputIndex = 2; + } + + struct PlaybackPreferencesStruct { + int64u playbackPosition = 0; + TrackPreferenceStruct textTrack = 1; + optional TrackPreferenceStruct audioTracks[] = 2; + } + struct AdditionalInfoStruct { char_string<256> name = 0; char_string<8192> value = 1; @@ -6862,6 +7314,8 @@ cluster ContentLauncher = 1290 { ContentSearchStruct search = 0; boolean autoPlay = 1; optional char_string data = 2; + optional PlaybackPreferencesStruct playbackPreferences = 3; + optional boolean useCurrentContext = 4; } request struct LaunchURLRequest { @@ -7161,6 +7615,10 @@ cluster ApplicationBasic = 1293 { cluster AccountLogin = 1294 { revision 1; // NOTE: Default/not specifically set + critical event LoggedOut = 0 { + optional node_id node = 0; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -7179,6 +7637,11 @@ cluster AccountLogin = 1294 { request struct LoginRequest { char_string<100> tempAccountIdentifier = 0; char_string setupPIN = 1; + optional node_id node = 2; + } + + request struct LogoutRequest { + optional node_id node = 0; } /** Upon receipt, the Content App checks if the account associated with the client Temp Account Identifier Rotating ID is the same acount that is active on the given Content App. If the accounts are the same, then the Content App includes the Setup PIN in the GetSetupPIN Response. */ @@ -7186,13 +7649,17 @@ cluster AccountLogin = 1294 { /** Upon receipt, the Content App checks if the account associated with the client’s Temp Account Identifier (Rotating ID) has a current active Setup PIN with the given value. If the Setup PIN is valid for the user account associated with the Temp Account Identifier, then the Content App MAY make that user account active. */ fabric timed command access(invoke: administer) Login(LoginRequest): DefaultSuccess = 2; /** The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. */ - fabric timed command Logout(): DefaultSuccess = 3; + fabric timed command Logout(LogoutRequest): DefaultSuccess = 3; } /** This cluster provides commands that facilitate user account login on a Content App or a node. For example, a Content App running on a Video Player device, which is represented as an endpoint (see [TV Architecture]), can use this cluster to help make the user account on the Content App match the user account on the Client. */ cluster AccountLogin = 1294 { revision 1; // NOTE: Default/not specifically set + critical event LoggedOut = 0 { + optional node_id node = 0; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -7211,6 +7678,11 @@ cluster AccountLogin = 1294 { request struct LoginRequest { char_string<100> tempAccountIdentifier = 0; char_string setupPIN = 1; + optional node_id node = 2; + } + + request struct LogoutRequest { + optional node_id node = 0; } /** Upon receipt, the Content App checks if the account associated with the client Temp Account Identifier Rotating ID is the same acount that is active on the given Content App. If the accounts are the same, then the Content App includes the Setup PIN in the GetSetupPIN Response. */ @@ -7218,7 +7690,7 @@ cluster AccountLogin = 1294 { /** Upon receipt, the Content App checks if the account associated with the client’s Temp Account Identifier (Rotating ID) has a current active Setup PIN with the given value. If the Setup PIN is valid for the user account associated with the Temp Account Identifier, then the Content App MAY make that user account active. */ fabric timed command access(invoke: administer) Login(LoginRequest): DefaultSuccess = 2; /** The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. */ - fabric timed command Logout(): DefaultSuccess = 3; + fabric timed command Logout(LogoutRequest): DefaultSuccess = 3; } endpoint 0 { diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 4aa42846cc1bd9..f01e0b2838b48e 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -5857,6 +5857,12 @@ cluster OccupancySensing = 1030 { cluster Channel = 1284 { revision 1; // NOTE: Default/not specifically set + enum ChannelTypeEnum : enum8 { + kSatellite = 0; + kCable = 1; + kTerrestrial = 2; + } + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } @@ -5870,6 +5876,29 @@ cluster Channel = 1284 { bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; + kElectronicGuide = 0x3; + kRecordProgram = 0x4; + } + + bitmap RecordingFlagBitmap : bitmap32 { + kScheduled = 0x1; + kRecordSeries = 0x2; + kRecorded = 0x3; + } + + struct ProgramCastStruct { + char_string name = 0; + char_string role = 1; + } + + struct ProgramCategoryStruct { + char_string category = 0; + optional char_string subCategory = 1; + } + + struct SeriesInfoStruct { + char_string season = 0; + char_string episode = 1; } struct ChannelInfoStruct { @@ -5878,6 +5907,46 @@ cluster Channel = 1284 { optional char_string name = 2; optional char_string callSign = 3; optional char_string affiliateCallSign = 4; + optional char_string identifier = 5; + optional ChannelTypeEnum type = 6; + } + + struct ProgramStruct { + char_string identifier = 0; + ChannelInfoStruct channel = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + char_string title = 4; + optional char_string subtitle = 5; + optional char_string description = 6; + optional char_string audioLanguages[] = 7; + optional char_string ratings[] = 8; + optional char_string thumbnailUrl = 9; + optional char_string posterArtUrl = 10; + optional char_string dvbiUrl = 11; + optional char_string releaseDate = 12; + optional char_string parentalGuidanceText = 13; + optional RecordingFlagBitmap recordingFlag = 14; + optional nullable SeriesInfoStruct seriesInfo = 15; + optional ProgramCategoryStruct categoryList[] = 16; + optional ProgramCastStruct castList[] = 17; + optional ProgramCastStruct externalIDList[] = 18; + } + + struct PageTokenStruct { + optional int16u limit = 0; + optional char_string after = 1; + optional char_string before = 2; + } + + struct ChannelPagingStruct { + optional nullable PageTokenStruct previousToken = 0; + optional nullable PageTokenStruct nextToken = 1; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct LineupInfoStruct { @@ -5915,18 +5984,59 @@ cluster Channel = 1284 { int16s count = 0; } + request struct GetProgramGuideRequest { + optional epoch_s startTime = 0; + optional epoch_s endTime = 1; + optional ChannelInfoStruct channelList[] = 2; + optional PageTokenStruct pageToken = 3; + optional RecordingFlagBitmap recordingFlag = 4; + optional AdditionalInfoStruct externalIDList[] = 5; + optional octet_string data = 6; + } + + response struct ProgramGuideResponse = 5 { + int16s channelPagingStruct = 0; + ProgramStruct programList[] = 1; + } + + request struct RecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + + request struct CancelRecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; /** Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute. */ command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; /** This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. */ command SkipChannel(SkipChannelRequest): DefaultSuccess = 3; + /** This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. */ + command GetProgramGuide(GetProgramGuideRequest): ProgramGuideResponse = 4; + /** Record a specific program or series when it goes live. This functionality enables DVR recording features. */ + command RecordProgram(RecordProgramRequest): DefaultSuccess = 6; + /** Cancel recording for a specific program or series. */ + command CancelRecordProgram(CancelRecordProgramRequest): DefaultSuccess = 7; } /** This cluster provides an interface for controlling the current Channel on a device. */ cluster Channel = 1284 { revision 1; // NOTE: Default/not specifically set + enum ChannelTypeEnum : enum8 { + kSatellite = 0; + kCable = 1; + kTerrestrial = 2; + } + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } @@ -5940,6 +6050,29 @@ cluster Channel = 1284 { bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; + kElectronicGuide = 0x3; + kRecordProgram = 0x4; + } + + bitmap RecordingFlagBitmap : bitmap32 { + kScheduled = 0x1; + kRecordSeries = 0x2; + kRecorded = 0x3; + } + + struct ProgramCastStruct { + char_string name = 0; + char_string role = 1; + } + + struct ProgramCategoryStruct { + char_string category = 0; + optional char_string subCategory = 1; + } + + struct SeriesInfoStruct { + char_string season = 0; + char_string episode = 1; } struct ChannelInfoStruct { @@ -5948,6 +6081,46 @@ cluster Channel = 1284 { optional char_string name = 2; optional char_string callSign = 3; optional char_string affiliateCallSign = 4; + optional char_string identifier = 5; + optional ChannelTypeEnum type = 6; + } + + struct ProgramStruct { + char_string identifier = 0; + ChannelInfoStruct channel = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + char_string title = 4; + optional char_string subtitle = 5; + optional char_string description = 6; + optional char_string audioLanguages[] = 7; + optional char_string ratings[] = 8; + optional char_string thumbnailUrl = 9; + optional char_string posterArtUrl = 10; + optional char_string dvbiUrl = 11; + optional char_string releaseDate = 12; + optional char_string parentalGuidanceText = 13; + optional RecordingFlagBitmap recordingFlag = 14; + optional nullable SeriesInfoStruct seriesInfo = 15; + optional ProgramCategoryStruct categoryList[] = 16; + optional ProgramCastStruct castList[] = 17; + optional ProgramCastStruct externalIDList[] = 18; + } + + struct PageTokenStruct { + optional int16u limit = 0; + optional char_string after = 1; + optional char_string before = 2; + } + + struct ChannelPagingStruct { + optional nullable PageTokenStruct previousToken = 0; + optional nullable PageTokenStruct nextToken = 1; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct LineupInfoStruct { @@ -5985,12 +6158,47 @@ cluster Channel = 1284 { int16s count = 0; } + request struct GetProgramGuideRequest { + optional epoch_s startTime = 0; + optional epoch_s endTime = 1; + optional ChannelInfoStruct channelList[] = 2; + optional PageTokenStruct pageToken = 3; + optional RecordingFlagBitmap recordingFlag = 4; + optional AdditionalInfoStruct externalIDList[] = 5; + optional octet_string data = 6; + } + + response struct ProgramGuideResponse = 5 { + int16s channelPagingStruct = 0; + ProgramStruct programList[] = 1; + } + + request struct RecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + + request struct CancelRecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; /** Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute. */ command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; /** This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. */ command SkipChannel(SkipChannelRequest): DefaultSuccess = 3; + /** This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. */ + command GetProgramGuide(GetProgramGuideRequest): ProgramGuideResponse = 4; + /** Record a specific program or series when it goes live. This functionality enables DVR recording features. */ + command RecordProgram(RecordProgramRequest): DefaultSuccess = 6; + /** Cancel recording for a specific program or series. */ + command CancelRecordProgram(CancelRecordProgramRequest): DefaultSuccess = 7; } /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ @@ -6008,6 +6216,12 @@ cluster TargetNavigator = 1285 { char_string name = 1; } + info event TargetUpdated = 0 { + TargetInfoStruct targetList[] = 0; + int8u currentTarget = 1; + octet_string data = 2; + } + readonly attribute TargetInfoStruct targetList[] = 0; readonly attribute optional int8u currentTarget = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -6046,6 +6260,12 @@ cluster TargetNavigator = 1285 { char_string name = 1; } + info event TargetUpdated = 0 { + TargetInfoStruct targetList[] = 0; + int8u currentTarget = 1; + octet_string data = 2; + } + readonly attribute TargetInfoStruct targetList[] = 0; readonly attribute optional int8u currentTarget = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -6073,6 +6293,27 @@ cluster TargetNavigator = 1285 { cluster MediaPlayback = 1286 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; @@ -6092,6 +6333,19 @@ cluster MediaPlayback = 1286 { bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; + kTextTracks = 0x3; + kAudioTracks = 0x4; + kAudioAdvance = 0x5; + } + + struct TrackAttributesStruct { + char_string<32> languageCode = 0; + optional nullable char_string displayName = 1; + } + + struct TrackStruct { + char_string<32> id = 0; + nullable TrackAttributesStruct trackAttributes = 1; } struct PlaybackPositionStruct { @@ -6099,6 +6353,18 @@ cluster MediaPlayback = 1286 { nullable int64u position = 1; } + info event StateChanged = 0 { + PlaybackStateEnum currentState = 0; + EPOCH_US startTime = 1; + INT64U duration = 2; + PlaybackPositionStruct sampledPosition = 3; + single playbackSpeed = 4; + INT64U seekRangeEnd = 5; + INT64U seekRangeStart = 6; + optional OCTET_STRING data = 7; + boolean audioAdvanceUnmuted = 8; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute optional nullable epoch_us startTime = 1; readonly attribute optional nullable int64u duration = 2; @@ -6106,6 +6372,10 @@ cluster MediaPlayback = 1286 { readonly attribute optional single playbackSpeed = 4; readonly attribute optional nullable int64u seekRangeEnd = 5; readonly attribute optional nullable int64u seekRangeStart = 6; + readonly attribute optional nullable TrackStruct activeAudioTrack = 7; + readonly attribute optional nullable TrackStruct availableAudioTracks[] = 8; + readonly attribute optional nullable TrackStruct activeTextTrack = 9; + readonly attribute optional nullable TrackStruct availableTextTracks[] = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6113,6 +6383,14 @@ cluster MediaPlayback = 1286 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct RewindRequest { + optional boolean audioAdvanceUnmuted = 0; + } + + request struct FastForwardRequest { + optional boolean audioAdvanceUnmuted = 0; + } + request struct SkipForwardRequest { int64u deltaPositionMilliseconds = 0; } @@ -6130,6 +6408,15 @@ cluster MediaPlayback = 1286 { int64u position = 0; } + request struct ActivateAudioTrackRequest { + CHAR_STRING trackID = 0; + INT8U audioOutputIndex = 1; + } + + request struct ActivateTextTrackRequest { + CHAR_STRING trackID = 0; + } + /** Upon receipt, this SHALL play media. */ command Play(): PlaybackResponse = 0; /** Upon receipt, this SHALL pause media. */ @@ -6143,21 +6430,48 @@ cluster MediaPlayback = 1286 { /** Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. */ command Next(): PlaybackResponse = 5; /** Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command Rewind(): PlaybackResponse = 6; + command Rewind(RewindRequest): PlaybackResponse = 6; /** Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command FastForward(): PlaybackResponse = 7; + command FastForward(FastForwardRequest): PlaybackResponse = 7; /** Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: */ command SkipForward(SkipForwardRequest): PlaybackResponse = 8; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command SkipBackward(SkipBackwardRequest): PlaybackResponse = 9; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command Seek(SeekRequest): PlaybackResponse = 11; + /** Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. */ + command ActivateAudioTrack(ActivateAudioTrackRequest): DefaultSuccess = 12; + /** Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. */ + command ActivateTextTrack(ActivateTextTrackRequest): DefaultSuccess = 13; + /** If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. */ + command DeactivateTextTrack(): DefaultSuccess = 14; } /** This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. */ cluster MediaPlayback = 1286 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; @@ -6177,6 +6491,19 @@ cluster MediaPlayback = 1286 { bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; + kTextTracks = 0x3; + kAudioTracks = 0x4; + kAudioAdvance = 0x5; + } + + struct TrackAttributesStruct { + char_string<32> languageCode = 0; + optional nullable char_string displayName = 1; + } + + struct TrackStruct { + char_string<32> id = 0; + nullable TrackAttributesStruct trackAttributes = 1; } struct PlaybackPositionStruct { @@ -6184,6 +6511,18 @@ cluster MediaPlayback = 1286 { nullable int64u position = 1; } + info event StateChanged = 0 { + PlaybackStateEnum currentState = 0; + EPOCH_US startTime = 1; + INT64U duration = 2; + PlaybackPositionStruct sampledPosition = 3; + single playbackSpeed = 4; + INT64U seekRangeEnd = 5; + INT64U seekRangeStart = 6; + optional OCTET_STRING data = 7; + boolean audioAdvanceUnmuted = 8; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute optional nullable epoch_us startTime = 1; readonly attribute optional nullable int64u duration = 2; @@ -6191,6 +6530,10 @@ cluster MediaPlayback = 1286 { readonly attribute optional single playbackSpeed = 4; readonly attribute optional nullable int64u seekRangeEnd = 5; readonly attribute optional nullable int64u seekRangeStart = 6; + readonly attribute optional nullable TrackStruct activeAudioTrack = 7; + readonly attribute optional nullable TrackStruct availableAudioTracks[] = 8; + readonly attribute optional nullable TrackStruct activeTextTrack = 9; + readonly attribute optional nullable TrackStruct availableTextTracks[] = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6198,6 +6541,14 @@ cluster MediaPlayback = 1286 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct RewindRequest { + optional boolean audioAdvanceUnmuted = 0; + } + + request struct FastForwardRequest { + optional boolean audioAdvanceUnmuted = 0; + } + request struct SkipForwardRequest { int64u deltaPositionMilliseconds = 0; } @@ -6215,6 +6566,15 @@ cluster MediaPlayback = 1286 { int64u position = 0; } + request struct ActivateAudioTrackRequest { + CHAR_STRING trackID = 0; + INT8U audioOutputIndex = 1; + } + + request struct ActivateTextTrackRequest { + CHAR_STRING trackID = 0; + } + /** Upon receipt, this SHALL play media. */ command Play(): PlaybackResponse = 0; /** Upon receipt, this SHALL pause media. */ @@ -6228,15 +6588,21 @@ cluster MediaPlayback = 1286 { /** Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. */ command Next(): PlaybackResponse = 5; /** Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command Rewind(): PlaybackResponse = 6; + command Rewind(RewindRequest): PlaybackResponse = 6; /** Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command FastForward(): PlaybackResponse = 7; + command FastForward(FastForwardRequest): PlaybackResponse = 7; /** Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: */ command SkipForward(SkipForwardRequest): PlaybackResponse = 8; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command SkipBackward(SkipBackwardRequest): PlaybackResponse = 9; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command Seek(SeekRequest): PlaybackResponse = 11; + /** Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. */ + command ActivateAudioTrack(ActivateAudioTrackRequest): DefaultSuccess = 12; + /** Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. */ + command ActivateTextTrack(ActivateTextTrackRequest): DefaultSuccess = 13; + /** If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. */ + command DeactivateTextTrack(): DefaultSuccess = 14; } /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ @@ -6622,6 +6988,27 @@ cluster KeypadInput = 1289 { cluster ContentLauncher = 1290 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; @@ -6642,22 +7029,31 @@ cluster ContentLauncher = 1290 { kSportsTeam = 11; kType = 12; kVideo = 13; + kSeason = 14; + kEpisode = 15; + kAny = 16; } enum StatusEnum : enum8 { kSuccess = 0; kURLNotAvailable = 1; kAuthFailed = 2; + kTextTrackNotAvailable = 3; + kAudioTrackNotAvailable = 4; } bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; + kAdvancedSeek = 0x3; + kTextTracks = 0x4; + kAudioTracks = 0x5; } bitmap SupportedProtocolsBitmap : bitmap32 { kDASH = 0x1; kHLS = 0x2; + kWebRTC = 0x2; } struct DimensionStruct { @@ -6666,6 +7062,18 @@ cluster ContentLauncher = 1290 { MetricTypeEnum metric = 2; } + struct TrackPreferenceStruct { + char_string<32> languageCode = 0; + optional CharacteristicEnum characteristics[] = 1; + int8u audioOutputIndex = 2; + } + + struct PlaybackPreferencesStruct { + int64u playbackPosition = 0; + TrackPreferenceStruct textTrack = 1; + optional TrackPreferenceStruct audioTracks[] = 2; + } + struct AdditionalInfoStruct { char_string<256> name = 0; char_string<8192> value = 1; @@ -6709,6 +7117,8 @@ cluster ContentLauncher = 1290 { ContentSearchStruct search = 0; boolean autoPlay = 1; optional char_string data = 2; + optional PlaybackPreferencesStruct playbackPreferences = 3; + optional boolean useCurrentContext = 4; } request struct LaunchURLRequest { @@ -6732,6 +7142,27 @@ cluster ContentLauncher = 1290 { cluster ContentLauncher = 1290 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; @@ -6752,22 +7183,31 @@ cluster ContentLauncher = 1290 { kSportsTeam = 11; kType = 12; kVideo = 13; + kSeason = 14; + kEpisode = 15; + kAny = 16; } enum StatusEnum : enum8 { kSuccess = 0; kURLNotAvailable = 1; kAuthFailed = 2; + kTextTrackNotAvailable = 3; + kAudioTrackNotAvailable = 4; } bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; + kAdvancedSeek = 0x3; + kTextTracks = 0x4; + kAudioTracks = 0x5; } bitmap SupportedProtocolsBitmap : bitmap32 { kDASH = 0x1; kHLS = 0x2; + kWebRTC = 0x2; } struct DimensionStruct { @@ -6776,6 +7216,18 @@ cluster ContentLauncher = 1290 { MetricTypeEnum metric = 2; } + struct TrackPreferenceStruct { + char_string<32> languageCode = 0; + optional CharacteristicEnum characteristics[] = 1; + int8u audioOutputIndex = 2; + } + + struct PlaybackPreferencesStruct { + int64u playbackPosition = 0; + TrackPreferenceStruct textTrack = 1; + optional TrackPreferenceStruct audioTracks[] = 2; + } + struct AdditionalInfoStruct { char_string<256> name = 0; char_string<8192> value = 1; @@ -6819,6 +7271,8 @@ cluster ContentLauncher = 1290 { ContentSearchStruct search = 0; boolean autoPlay = 1; optional char_string data = 2; + optional PlaybackPreferencesStruct playbackPreferences = 3; + optional boolean useCurrentContext = 4; } request struct LaunchURLRequest { @@ -7118,6 +7572,10 @@ cluster ApplicationBasic = 1293 { cluster AccountLogin = 1294 { revision 1; // NOTE: Default/not specifically set + critical event LoggedOut = 0 { + optional node_id node = 0; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -7136,6 +7594,11 @@ cluster AccountLogin = 1294 { request struct LoginRequest { char_string<100> tempAccountIdentifier = 0; char_string setupPIN = 1; + optional node_id node = 2; + } + + request struct LogoutRequest { + optional node_id node = 0; } /** Upon receipt, the Content App checks if the account associated with the client Temp Account Identifier Rotating ID is the same acount that is active on the given Content App. If the accounts are the same, then the Content App includes the Setup PIN in the GetSetupPIN Response. */ @@ -7143,13 +7606,17 @@ cluster AccountLogin = 1294 { /** Upon receipt, the Content App checks if the account associated with the client’s Temp Account Identifier (Rotating ID) has a current active Setup PIN with the given value. If the Setup PIN is valid for the user account associated with the Temp Account Identifier, then the Content App MAY make that user account active. */ fabric timed command access(invoke: administer) Login(LoginRequest): DefaultSuccess = 2; /** The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. */ - fabric timed command Logout(): DefaultSuccess = 3; + fabric timed command Logout(LogoutRequest): DefaultSuccess = 3; } /** This cluster provides commands that facilitate user account login on a Content App or a node. For example, a Content App running on a Video Player device, which is represented as an endpoint (see [TV Architecture]), can use this cluster to help make the user account on the Content App match the user account on the Client. */ cluster AccountLogin = 1294 { revision 1; // NOTE: Default/not specifically set + critical event LoggedOut = 0 { + optional node_id node = 0; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -7168,6 +7635,11 @@ cluster AccountLogin = 1294 { request struct LoginRequest { char_string<100> tempAccountIdentifier = 0; char_string setupPIN = 1; + optional node_id node = 2; + } + + request struct LogoutRequest { + optional node_id node = 0; } /** Upon receipt, the Content App checks if the account associated with the client Temp Account Identifier Rotating ID is the same acount that is active on the given Content App. If the accounts are the same, then the Content App includes the Setup PIN in the GetSetupPIN Response. */ @@ -7175,7 +7647,7 @@ cluster AccountLogin = 1294 { /** Upon receipt, the Content App checks if the account associated with the client’s Temp Account Identifier (Rotating ID) has a current active Setup PIN with the given value. If the Setup PIN is valid for the user account associated with the Temp Account Identifier, then the Content App MAY make that user account active. */ fabric timed command access(invoke: administer) Login(LoginRequest): DefaultSuccess = 2; /** The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. */ - fabric timed command Logout(): DefaultSuccess = 3; + fabric timed command Logout(LogoutRequest): DefaultSuccess = 3; } endpoint 0 { diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 1e8bcf10fdcd54..36a1cb63d8f41c 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -2039,6 +2039,12 @@ cluster WakeOnLan = 1283 { cluster Channel = 1284 { revision 1; // NOTE: Default/not specifically set + enum ChannelTypeEnum : enum8 { + kSatellite = 0; + kCable = 1; + kTerrestrial = 2; + } + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } @@ -2052,6 +2058,29 @@ cluster Channel = 1284 { bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; + kElectronicGuide = 0x3; + kRecordProgram = 0x4; + } + + bitmap RecordingFlagBitmap : bitmap32 { + kScheduled = 0x1; + kRecordSeries = 0x2; + kRecorded = 0x3; + } + + struct ProgramCastStruct { + char_string name = 0; + char_string role = 1; + } + + struct ProgramCategoryStruct { + char_string category = 0; + optional char_string subCategory = 1; + } + + struct SeriesInfoStruct { + char_string season = 0; + char_string episode = 1; } struct ChannelInfoStruct { @@ -2060,6 +2089,46 @@ cluster Channel = 1284 { optional char_string name = 2; optional char_string callSign = 3; optional char_string affiliateCallSign = 4; + optional char_string identifier = 5; + optional ChannelTypeEnum type = 6; + } + + struct ProgramStruct { + char_string identifier = 0; + ChannelInfoStruct channel = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + char_string title = 4; + optional char_string subtitle = 5; + optional char_string description = 6; + optional char_string audioLanguages[] = 7; + optional char_string ratings[] = 8; + optional char_string thumbnailUrl = 9; + optional char_string posterArtUrl = 10; + optional char_string dvbiUrl = 11; + optional char_string releaseDate = 12; + optional char_string parentalGuidanceText = 13; + optional RecordingFlagBitmap recordingFlag = 14; + optional nullable SeriesInfoStruct seriesInfo = 15; + optional ProgramCategoryStruct categoryList[] = 16; + optional ProgramCastStruct castList[] = 17; + optional ProgramCastStruct externalIDList[] = 18; + } + + struct PageTokenStruct { + optional int16u limit = 0; + optional char_string after = 1; + optional char_string before = 2; + } + + struct ChannelPagingStruct { + optional nullable PageTokenStruct previousToken = 0; + optional nullable PageTokenStruct nextToken = 1; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct LineupInfoStruct { @@ -2097,12 +2166,47 @@ cluster Channel = 1284 { int16s count = 0; } + request struct GetProgramGuideRequest { + optional epoch_s startTime = 0; + optional epoch_s endTime = 1; + optional ChannelInfoStruct channelList[] = 2; + optional PageTokenStruct pageToken = 3; + optional RecordingFlagBitmap recordingFlag = 4; + optional AdditionalInfoStruct externalIDList[] = 5; + optional octet_string data = 6; + } + + response struct ProgramGuideResponse = 5 { + int16s channelPagingStruct = 0; + ProgramStruct programList[] = 1; + } + + request struct RecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + + request struct CancelRecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; /** Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute. */ command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; /** This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. */ command SkipChannel(SkipChannelRequest): DefaultSuccess = 3; + /** This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. */ + command GetProgramGuide(GetProgramGuideRequest): ProgramGuideResponse = 4; + /** Record a specific program or series when it goes live. This functionality enables DVR recording features. */ + command RecordProgram(RecordProgramRequest): DefaultSuccess = 6; + /** Cancel recording for a specific program or series. */ + command CancelRecordProgram(CancelRecordProgramRequest): DefaultSuccess = 7; } /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ @@ -2120,6 +2224,12 @@ cluster TargetNavigator = 1285 { char_string name = 1; } + info event TargetUpdated = 0 { + TargetInfoStruct targetList[] = 0; + int8u currentTarget = 1; + octet_string data = 2; + } + readonly attribute TargetInfoStruct targetList[] = 0; readonly attribute optional int8u currentTarget = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -2147,6 +2257,27 @@ cluster TargetNavigator = 1285 { cluster MediaPlayback = 1286 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; @@ -2166,6 +2297,19 @@ cluster MediaPlayback = 1286 { bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; + kTextTracks = 0x3; + kAudioTracks = 0x4; + kAudioAdvance = 0x5; + } + + struct TrackAttributesStruct { + char_string<32> languageCode = 0; + optional nullable char_string displayName = 1; + } + + struct TrackStruct { + char_string<32> id = 0; + nullable TrackAttributesStruct trackAttributes = 1; } struct PlaybackPositionStruct { @@ -2173,6 +2317,18 @@ cluster MediaPlayback = 1286 { nullable int64u position = 1; } + info event StateChanged = 0 { + PlaybackStateEnum currentState = 0; + EPOCH_US startTime = 1; + INT64U duration = 2; + PlaybackPositionStruct sampledPosition = 3; + single playbackSpeed = 4; + INT64U seekRangeEnd = 5; + INT64U seekRangeStart = 6; + optional OCTET_STRING data = 7; + boolean audioAdvanceUnmuted = 8; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute optional nullable epoch_us startTime = 1; readonly attribute optional nullable int64u duration = 2; @@ -2180,6 +2336,10 @@ cluster MediaPlayback = 1286 { readonly attribute optional single playbackSpeed = 4; readonly attribute optional nullable int64u seekRangeEnd = 5; readonly attribute optional nullable int64u seekRangeStart = 6; + readonly attribute optional nullable TrackStruct activeAudioTrack = 7; + readonly attribute optional nullable TrackStruct availableAudioTracks[] = 8; + readonly attribute optional nullable TrackStruct activeTextTrack = 9; + readonly attribute optional nullable TrackStruct availableTextTracks[] = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2187,6 +2347,14 @@ cluster MediaPlayback = 1286 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct RewindRequest { + optional boolean audioAdvanceUnmuted = 0; + } + + request struct FastForwardRequest { + optional boolean audioAdvanceUnmuted = 0; + } + request struct SkipForwardRequest { int64u deltaPositionMilliseconds = 0; } @@ -2204,6 +2372,15 @@ cluster MediaPlayback = 1286 { int64u position = 0; } + request struct ActivateAudioTrackRequest { + CHAR_STRING trackID = 0; + INT8U audioOutputIndex = 1; + } + + request struct ActivateTextTrackRequest { + CHAR_STRING trackID = 0; + } + /** Upon receipt, this SHALL play media. */ command Play(): PlaybackResponse = 0; /** Upon receipt, this SHALL pause media. */ @@ -2217,15 +2394,21 @@ cluster MediaPlayback = 1286 { /** Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. */ command Next(): PlaybackResponse = 5; /** Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command Rewind(): PlaybackResponse = 6; + command Rewind(RewindRequest): PlaybackResponse = 6; /** Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command FastForward(): PlaybackResponse = 7; + command FastForward(FastForwardRequest): PlaybackResponse = 7; /** Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: */ command SkipForward(SkipForwardRequest): PlaybackResponse = 8; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command SkipBackward(SkipBackwardRequest): PlaybackResponse = 9; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command Seek(SeekRequest): PlaybackResponse = 11; + /** Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. */ + command ActivateAudioTrack(ActivateAudioTrackRequest): DefaultSuccess = 12; + /** Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. */ + command ActivateTextTrack(ActivateTextTrackRequest): DefaultSuccess = 13; + /** If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. */ + command DeactivateTextTrack(): DefaultSuccess = 14; } /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ @@ -2429,6 +2612,27 @@ cluster KeypadInput = 1289 { cluster ContentLauncher = 1290 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; @@ -2449,22 +2653,31 @@ cluster ContentLauncher = 1290 { kSportsTeam = 11; kType = 12; kVideo = 13; + kSeason = 14; + kEpisode = 15; + kAny = 16; } enum StatusEnum : enum8 { kSuccess = 0; kURLNotAvailable = 1; kAuthFailed = 2; + kTextTrackNotAvailable = 3; + kAudioTrackNotAvailable = 4; } bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; + kAdvancedSeek = 0x3; + kTextTracks = 0x4; + kAudioTracks = 0x5; } bitmap SupportedProtocolsBitmap : bitmap32 { kDASH = 0x1; kHLS = 0x2; + kWebRTC = 0x2; } struct DimensionStruct { @@ -2473,6 +2686,18 @@ cluster ContentLauncher = 1290 { MetricTypeEnum metric = 2; } + struct TrackPreferenceStruct { + char_string<32> languageCode = 0; + optional CharacteristicEnum characteristics[] = 1; + int8u audioOutputIndex = 2; + } + + struct PlaybackPreferencesStruct { + int64u playbackPosition = 0; + TrackPreferenceStruct textTrack = 1; + optional TrackPreferenceStruct audioTracks[] = 2; + } + struct AdditionalInfoStruct { char_string<256> name = 0; char_string<8192> value = 1; @@ -2516,6 +2741,8 @@ cluster ContentLauncher = 1290 { ContentSearchStruct search = 0; boolean autoPlay = 1; optional char_string data = 2; + optional PlaybackPreferencesStruct playbackPreferences = 3; + optional boolean useCurrentContext = 4; } request struct LaunchURLRequest { @@ -2677,6 +2904,10 @@ cluster ApplicationBasic = 1293 { cluster AccountLogin = 1294 { revision 1; // NOTE: Default/not specifically set + critical event LoggedOut = 0 { + optional node_id node = 0; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2695,6 +2926,11 @@ cluster AccountLogin = 1294 { request struct LoginRequest { char_string<100> tempAccountIdentifier = 0; char_string setupPIN = 1; + optional node_id node = 2; + } + + request struct LogoutRequest { + optional node_id node = 0; } /** Upon receipt, the Content App checks if the account associated with the client Temp Account Identifier Rotating ID is the same acount that is active on the given Content App. If the accounts are the same, then the Content App includes the Setup PIN in the GetSetupPIN Response. */ @@ -2702,7 +2938,121 @@ cluster AccountLogin = 1294 { /** Upon receipt, the Content App checks if the account associated with the client’s Temp Account Identifier (Rotating ID) has a current active Setup PIN with the given value. If the Setup PIN is valid for the user account associated with the Temp Account Identifier, then the Content App MAY make that user account active. */ fabric timed command access(invoke: administer) Login(LoginRequest): DefaultSuccess = 2; /** The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. */ - fabric timed command Logout(): DefaultSuccess = 3; + fabric timed command Logout(LogoutRequest): DefaultSuccess = 3; +} + +/** This cluster is used for managing the content control (including "parental control") settings on a media device such as a TV, or Set-top Box. */ +cluster ContentControl = 1295 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kScreenTime = 0x1; + kPINManagement = 0x2; + kBlockUnrated = 0x3; + kOnDemandContentRating = 0x4; + kScheduledContentRating = 0x5; + } + + struct RatingNameStruct { + char_string ratingName = 0; + optional char_string ratingNameDesc = 1; + } + + info event RemainingScreenTimeExpired = 0 { + } + + readonly attribute boolean enabled = 0; + readonly attribute optional RatingNameStruct onDemandRatings[] = 1; + readonly attribute optional char_string<8> onDemandRatingThreshold = 2; + readonly attribute optional RatingNameStruct scheduledContentRatings[] = 3; + readonly attribute optional char_string<8> scheduledContentRatingThreshold = 4; + readonly attribute optional elapsed_s screenDailyTime = 5; + readonly attribute optional elapsed_s remainingScreenTime = 6; + readonly attribute boolean blockUnrated = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct UpdatePINRequest { + optional char_string oldPIN = 0; + char_string newPIN = 1; + } + + response struct ResetPINResponse = 2 { + char_string PINCode = 0; + } + + request struct AddBonusTimeRequest { + optional char_string PINCode = 0; + optional elapsed_s bonusTime = 1; + } + + request struct SetScreenDailyTimeRequest { + elapsed_s screenTime = 0; + } + + request struct SetOnDemandRatingThresholdRequest { + char_string rating = 0; + } + + request struct SetScheduledContentRatingThresholdRequest { + char_string rating = 0; + } + + /** The purpose of this command is to update the PIN used for protecting configuration of the content control settings. Upon success, the old PIN SHALL no longer work. The PIN is used to ensure that only the Node (or User) with the PIN code can make changes to the Content Control settings, for example, turn off Content Controls or modify the ScreenDailyTime. The PIN is composed of a numeric string of up to 6 human readable characters (displayable) . Upon receipt of this command, the media device SHALL check if the OldPIN field of this command is the same as the current PIN. If the PINs are the same, then the PIN code SHALL be set to NewPIN. Otherwise a response with InvalidPINCode error status SHALL be returned. The media device MAY provide a default PIN to the User via an out of band mechanism. For security reasons, it is recommended that a client encourage the user to update the PIN from its default value when performing configuration of the Content Control settings exposed by this cluster. The ResetPIN command can also be used to obtain the default PIN. */ + command UpdatePIN(UpdatePINRequest): DefaultSuccess = 0; + /** The purpose of this command is to reset the PIN. If this command is executed successfully, a ResetPINResponse command with a new PIN SHALL be returned. */ + command ResetPIN(): ResetPINResponse = 1; + /** The purpose of this command is to turn on the Content Control feature on a media device. On receipt of the Enable command, the media device SHALL set the Enabled attribute to TRUE. */ + command Enable(): DefaultSuccess = 3; + /** The purpose of this command is to turn off the Content Control feature on a media device. On receipt of the Disable command, the media device SHALL set the Enabled attribute to FALSE. */ + command Disable(): DefaultSuccess = 4; + /** The purpose of this command is to add the extra screen time for the user. If a client with Operate privilege invokes this command, the media device SHALL check whether the PINCode passed in the command matches the current PINCode value. If these match, then the RemainingScreenTime attribute SHALL be increased by the specified BonusTime value. If the PINs do not match, then a response with InvalidPINCode error status SHALL be returned, and no changes SHALL be made to RemainingScreenTime. If a client with Manage privilege or greater invokes this command, the media device SHALL ignore the PINCode field and directly increase the RemainingScreenTime attribute by the specified BonusTime value. A server that does not support the PM feature SHALL respond with InvalidPINCode to clients that only have Operate privilege unless: It has been provided with the PIN value to expect via an out of band mechanism, and The client has provided a PINCode that matches the expected PIN value. */ + command AddBonusTime(AddBonusTimeRequest): DefaultSuccess = 5; + /** The purpose of this command is to set the ScreenDailyTime attribute. On receipt of the SetScreenDailyTime command, the media device SHALL set the ScreenDailyTime attribute to the ScreenTime value. */ + command SetScreenDailyTime(SetScreenDailyTimeRequest): DefaultSuccess = 6; + /** The purpose of this command is to specify whether programs with no Content rating must be blocked by this media device. On receipt of the BlockUnratedContent command, the media device SHALL set the BlockUnrated attribute to TRUE. */ + command BlockUnratedContent(): DefaultSuccess = 7; + /** The purpose of this command is to specify whether programs with no Content rating must be blocked by this media device. On receipt of the UnblockUnratedContent command, the media device SHALL set the BlockUnrated attribute to FALSE. */ + command UnblockUnratedContent(): DefaultSuccess = 8; + /** The purpose of this command is to set the OnDemandRatingThreshold attribute. On receipt of the SetOnDemandRatingThreshold command, the media device SHALL check if the Rating field is one of values present in the OnDemandRatings attribute. If not, then a response with InvalidRating error status SHALL be returned. */ + command SetOnDemandRatingThreshold(SetOnDemandRatingThresholdRequest): DefaultSuccess = 9; + /** The purpose of this command is to set ScheduledContentRatingThreshold attribute. On receipt of the SetScheduledContentRatingThreshold command, the media device SHALL check if the Rating field is one of values present in the ScheduledContentRatings attribute. If not, then a response with InvalidRating error status SHALL be returned. */ + command SetScheduledContentRatingThreshold(SetScheduledContentRatingThresholdRequest): DefaultSuccess = 10; +} + +/** This cluster provides an interface for sending targeted commands to an Observer of a Content App on a Video Player device such as a Streaming Media Player, Smart TV or Smart Screen. The cluster server for Content App Observer is implemented by an endpoint that communicates with a Content App, such as a Casting Video Client. The cluster client for Content App Observer is implemented by a Content App endpoint. A Content App is informed of the NodeId of an Observer when a binding is set on the Content App. The Content App can then send the ContentAppMessage to the Observer (server cluster), and the Observer responds with a ContentAppMessageResponse. */ +cluster ContentAppObserver = 1296 { + revision 1; // NOTE: Default/not specifically set + + enum StatusEnum : enum8 { + kSuccess = 0; + kUnexpectedData = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ContentAppMessageRequest { + optional char_string data = 0; + char_string encodingHint = 1; + } + + response struct ContentAppMessageResponse = 1 { + optional StatusEnum status = 0; + char_string data = 1; + char_string encodingHint = 2; + } + + /** Upon receipt, the data field MAY be parsed and interpreted. Message encoding is specific to the Content App. A Content App MAY when possible read attributes from the Basic Information Cluster on the Observer and use this to determine the Message encoding. */ + command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0; } endpoint 0 { @@ -3097,9 +3447,14 @@ endpoint 1 { handle command ChangeChannelResponse; handle command ChangeChannelByNumber; handle command SkipChannel; + handle command GetProgramGuide; + handle command ProgramGuideResponse; + handle command RecordProgram; + handle command CancelRecordProgram; } server cluster TargetNavigator { + emits event TargetUpdated; callback attribute targetList; ram attribute currentTarget default = 0; ram attribute featureMap default = 0; @@ -3110,6 +3465,7 @@ endpoint 1 { } server cluster MediaPlayback { + emits event StateChanged; ram attribute currentState default = 0x00; ram attribute startTime default = 0x00; ram attribute duration default = 0; @@ -3117,6 +3473,10 @@ endpoint 1 { ram attribute playbackSpeed default = 0; ram attribute seekRangeEnd; ram attribute seekRangeStart; + callback attribute activeAudioTrack; + callback attribute availableAudioTracks; + callback attribute activeTextTrack; + callback attribute availableTextTracks; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; @@ -3135,6 +3495,9 @@ endpoint 1 { handle command SkipBackward; handle command PlaybackResponse; handle command Seek; + handle command ActivateAudioTrack; + handle command ActivateTextTrack; + handle command DeactivateTextTrack; } server cluster MediaInput { @@ -3198,6 +3561,48 @@ endpoint 1 { handle command HideApp; handle command LauncherResponse; } + + server cluster ContentControl { + emits event RemainingScreenTimeExpired; + ram attribute enabled; + callback attribute onDemandRatings; + ram attribute onDemandRatingThreshold; + callback attribute scheduledContentRatings; + ram attribute scheduledContentRatingThreshold; + ram attribute screenDailyTime; + ram attribute remainingScreenTime; + ram attribute blockUnrated; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command UpdatePIN; + handle command ResetPIN; + handle command ResetPINResponse; + handle command Enable; + handle command Disable; + handle command AddBonusTime; + handle command SetScreenDailyTime; + handle command BlockUnratedContent; + handle command UnblockUnratedContent; + handle command SetOnDemandRatingThreshold; + handle command SetScheduledContentRatingThreshold; + } + + server cluster ContentAppObserver { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ContentAppMessage; + handle command ContentAppMessageResponse; + } } endpoint 2 { device type ma_speaker = 34, version 1; @@ -3264,6 +3669,9 @@ endpoint 3 { } server cluster Channel { + callback attribute channelList; + callback attribute lineup; + callback attribute currentChannel; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; @@ -3274,6 +3682,10 @@ endpoint 3 { handle command ChangeChannelResponse; handle command ChangeChannelByNumber; handle command SkipChannel; + handle command GetProgramGuide; + handle command ProgramGuideResponse; + handle command RecordProgram; + handle command CancelRecordProgram; } server cluster TargetNavigator { @@ -3289,6 +3701,7 @@ endpoint 3 { } server cluster MediaPlayback { + emits event StateChanged; ram attribute currentState default = 0x00; ram attribute startTime default = 0xFF; ram attribute duration; @@ -3296,6 +3709,10 @@ endpoint 3 { ram attribute playbackSpeed; ram attribute seekRangeEnd; ram attribute seekRangeStart; + callback attribute activeAudioTrack; + callback attribute availableAudioTracks; + callback attribute activeTextTrack; + callback attribute availableTextTracks; ram attribute featureMap default = 0x0003; ram attribute clusterRevision default = 1; @@ -3311,6 +3728,9 @@ endpoint 3 { handle command SkipBackward; handle command PlaybackResponse; handle command Seek; + handle command ActivateAudioTrack; + handle command ActivateTextTrack; + handle command DeactivateTextTrack; } server cluster KeypadInput { @@ -3373,6 +3793,48 @@ endpoint 3 { handle command Login; handle command Logout; } + + server cluster ContentControl { + emits event RemainingScreenTimeExpired; + ram attribute enabled; + callback attribute onDemandRatings; + ram attribute onDemandRatingThreshold; + callback attribute scheduledContentRatings; + ram attribute scheduledContentRatingThreshold; + ram attribute screenDailyTime; + ram attribute remainingScreenTime; + ram attribute blockUnrated; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command UpdatePIN; + handle command ResetPIN; + handle command ResetPINResponse; + handle command Enable; + handle command Disable; + handle command AddBonusTime; + handle command SetScreenDailyTime; + handle command BlockUnratedContent; + handle command UnblockUnratedContent; + handle command SetOnDemandRatingThreshold; + handle command SetScheduledContentRatingThreshold; + } + + server cluster ContentAppObserver { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ContentAppMessage; + handle command ContentAppMessageResponse; + } } diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 0aab1d22b6d981..810f249772319e 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -1501,6 +1501,12 @@ cluster WakeOnLan = 1283 { cluster Channel = 1284 { revision 1; // NOTE: Default/not specifically set + enum ChannelTypeEnum : enum8 { + kSatellite = 0; + kCable = 1; + kTerrestrial = 2; + } + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } @@ -1514,6 +1520,29 @@ cluster Channel = 1284 { bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; + kElectronicGuide = 0x3; + kRecordProgram = 0x4; + } + + bitmap RecordingFlagBitmap : bitmap32 { + kScheduled = 0x1; + kRecordSeries = 0x2; + kRecorded = 0x3; + } + + struct ProgramCastStruct { + char_string name = 0; + char_string role = 1; + } + + struct ProgramCategoryStruct { + char_string category = 0; + optional char_string subCategory = 1; + } + + struct SeriesInfoStruct { + char_string season = 0; + char_string episode = 1; } struct ChannelInfoStruct { @@ -1522,6 +1551,46 @@ cluster Channel = 1284 { optional char_string name = 2; optional char_string callSign = 3; optional char_string affiliateCallSign = 4; + optional char_string identifier = 5; + optional ChannelTypeEnum type = 6; + } + + struct ProgramStruct { + char_string identifier = 0; + ChannelInfoStruct channel = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + char_string title = 4; + optional char_string subtitle = 5; + optional char_string description = 6; + optional char_string audioLanguages[] = 7; + optional char_string ratings[] = 8; + optional char_string thumbnailUrl = 9; + optional char_string posterArtUrl = 10; + optional char_string dvbiUrl = 11; + optional char_string releaseDate = 12; + optional char_string parentalGuidanceText = 13; + optional RecordingFlagBitmap recordingFlag = 14; + optional nullable SeriesInfoStruct seriesInfo = 15; + optional ProgramCategoryStruct categoryList[] = 16; + optional ProgramCastStruct castList[] = 17; + optional ProgramCastStruct externalIDList[] = 18; + } + + struct PageTokenStruct { + optional int16u limit = 0; + optional char_string after = 1; + optional char_string before = 2; + } + + struct ChannelPagingStruct { + optional nullable PageTokenStruct previousToken = 0; + optional nullable PageTokenStruct nextToken = 1; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct LineupInfoStruct { @@ -1559,12 +1628,47 @@ cluster Channel = 1284 { int16s count = 0; } + request struct GetProgramGuideRequest { + optional epoch_s startTime = 0; + optional epoch_s endTime = 1; + optional ChannelInfoStruct channelList[] = 2; + optional PageTokenStruct pageToken = 3; + optional RecordingFlagBitmap recordingFlag = 4; + optional AdditionalInfoStruct externalIDList[] = 5; + optional octet_string data = 6; + } + + response struct ProgramGuideResponse = 5 { + int16s channelPagingStruct = 0; + ProgramStruct programList[] = 1; + } + + request struct RecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + + request struct CancelRecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; /** Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute. */ command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; /** This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. */ command SkipChannel(SkipChannelRequest): DefaultSuccess = 3; + /** This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. */ + command GetProgramGuide(GetProgramGuideRequest): ProgramGuideResponse = 4; + /** Record a specific program or series when it goes live. This functionality enables DVR recording features. */ + command RecordProgram(RecordProgramRequest): DefaultSuccess = 6; + /** Cancel recording for a specific program or series. */ + command CancelRecordProgram(CancelRecordProgramRequest): DefaultSuccess = 7; } /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ @@ -1582,6 +1686,12 @@ cluster TargetNavigator = 1285 { char_string name = 1; } + info event TargetUpdated = 0 { + TargetInfoStruct targetList[] = 0; + int8u currentTarget = 1; + octet_string data = 2; + } + readonly attribute TargetInfoStruct targetList[] = 0; readonly attribute optional int8u currentTarget = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -1609,6 +1719,27 @@ cluster TargetNavigator = 1285 { cluster MediaPlayback = 1286 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; @@ -1628,6 +1759,19 @@ cluster MediaPlayback = 1286 { bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; + kTextTracks = 0x3; + kAudioTracks = 0x4; + kAudioAdvance = 0x5; + } + + struct TrackAttributesStruct { + char_string<32> languageCode = 0; + optional nullable char_string displayName = 1; + } + + struct TrackStruct { + char_string<32> id = 0; + nullable TrackAttributesStruct trackAttributes = 1; } struct PlaybackPositionStruct { @@ -1635,6 +1779,18 @@ cluster MediaPlayback = 1286 { nullable int64u position = 1; } + info event StateChanged = 0 { + PlaybackStateEnum currentState = 0; + EPOCH_US startTime = 1; + INT64U duration = 2; + PlaybackPositionStruct sampledPosition = 3; + single playbackSpeed = 4; + INT64U seekRangeEnd = 5; + INT64U seekRangeStart = 6; + optional OCTET_STRING data = 7; + boolean audioAdvanceUnmuted = 8; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute optional nullable epoch_us startTime = 1; readonly attribute optional nullable int64u duration = 2; @@ -1642,6 +1798,10 @@ cluster MediaPlayback = 1286 { readonly attribute optional single playbackSpeed = 4; readonly attribute optional nullable int64u seekRangeEnd = 5; readonly attribute optional nullable int64u seekRangeStart = 6; + readonly attribute optional nullable TrackStruct activeAudioTrack = 7; + readonly attribute optional nullable TrackStruct availableAudioTracks[] = 8; + readonly attribute optional nullable TrackStruct activeTextTrack = 9; + readonly attribute optional nullable TrackStruct availableTextTracks[] = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1649,6 +1809,14 @@ cluster MediaPlayback = 1286 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct RewindRequest { + optional boolean audioAdvanceUnmuted = 0; + } + + request struct FastForwardRequest { + optional boolean audioAdvanceUnmuted = 0; + } + request struct SkipForwardRequest { int64u deltaPositionMilliseconds = 0; } @@ -1666,6 +1834,15 @@ cluster MediaPlayback = 1286 { int64u position = 0; } + request struct ActivateAudioTrackRequest { + CHAR_STRING trackID = 0; + INT8U audioOutputIndex = 1; + } + + request struct ActivateTextTrackRequest { + CHAR_STRING trackID = 0; + } + /** Upon receipt, this SHALL play media. */ command Play(): PlaybackResponse = 0; /** Upon receipt, this SHALL pause media. */ @@ -1679,15 +1856,21 @@ cluster MediaPlayback = 1286 { /** Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. */ command Next(): PlaybackResponse = 5; /** Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command Rewind(): PlaybackResponse = 6; + command Rewind(RewindRequest): PlaybackResponse = 6; /** Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command FastForward(): PlaybackResponse = 7; + command FastForward(FastForwardRequest): PlaybackResponse = 7; /** Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: */ command SkipForward(SkipForwardRequest): PlaybackResponse = 8; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command SkipBackward(SkipBackwardRequest): PlaybackResponse = 9; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command Seek(SeekRequest): PlaybackResponse = 11; + /** Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. */ + command ActivateAudioTrack(ActivateAudioTrackRequest): DefaultSuccess = 12; + /** Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. */ + command ActivateTextTrack(ActivateTextTrackRequest): DefaultSuccess = 13; + /** If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. */ + command DeactivateTextTrack(): DefaultSuccess = 14; } /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ @@ -1891,6 +2074,27 @@ cluster KeypadInput = 1289 { cluster ContentLauncher = 1290 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; @@ -1911,22 +2115,31 @@ cluster ContentLauncher = 1290 { kSportsTeam = 11; kType = 12; kVideo = 13; + kSeason = 14; + kEpisode = 15; + kAny = 16; } enum StatusEnum : enum8 { kSuccess = 0; kURLNotAvailable = 1; kAuthFailed = 2; + kTextTrackNotAvailable = 3; + kAudioTrackNotAvailable = 4; } bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; + kAdvancedSeek = 0x3; + kTextTracks = 0x4; + kAudioTracks = 0x5; } bitmap SupportedProtocolsBitmap : bitmap32 { kDASH = 0x1; kHLS = 0x2; + kWebRTC = 0x2; } struct DimensionStruct { @@ -1935,6 +2148,18 @@ cluster ContentLauncher = 1290 { MetricTypeEnum metric = 2; } + struct TrackPreferenceStruct { + char_string<32> languageCode = 0; + optional CharacteristicEnum characteristics[] = 1; + int8u audioOutputIndex = 2; + } + + struct PlaybackPreferencesStruct { + int64u playbackPosition = 0; + TrackPreferenceStruct textTrack = 1; + optional TrackPreferenceStruct audioTracks[] = 2; + } + struct AdditionalInfoStruct { char_string<256> name = 0; char_string<8192> value = 1; @@ -1978,6 +2203,8 @@ cluster ContentLauncher = 1290 { ContentSearchStruct search = 0; boolean autoPlay = 1; optional char_string data = 2; + optional PlaybackPreferencesStruct playbackPreferences = 3; + optional boolean useCurrentContext = 4; } request struct LaunchURLRequest { @@ -2139,6 +2366,10 @@ cluster ApplicationBasic = 1293 { cluster AccountLogin = 1294 { revision 1; // NOTE: Default/not specifically set + critical event LoggedOut = 0 { + optional node_id node = 0; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2157,6 +2388,11 @@ cluster AccountLogin = 1294 { request struct LoginRequest { char_string<100> tempAccountIdentifier = 0; char_string setupPIN = 1; + optional node_id node = 2; + } + + request struct LogoutRequest { + optional node_id node = 0; } /** Upon receipt, the Content App checks if the account associated with the client Temp Account Identifier Rotating ID is the same acount that is active on the given Content App. If the accounts are the same, then the Content App includes the Setup PIN in the GetSetupPIN Response. */ @@ -2164,7 +2400,7 @@ cluster AccountLogin = 1294 { /** Upon receipt, the Content App checks if the account associated with the client’s Temp Account Identifier (Rotating ID) has a current active Setup PIN with the given value. If the Setup PIN is valid for the user account associated with the Temp Account Identifier, then the Content App MAY make that user account active. */ fabric timed command access(invoke: administer) Login(LoginRequest): DefaultSuccess = 2; /** The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. */ - fabric timed command Logout(): DefaultSuccess = 3; + fabric timed command Logout(LogoutRequest): DefaultSuccess = 3; } endpoint 0 { diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index efa65e27e39874..365b15dfea4758 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -6777,6 +6777,12 @@ cluster WakeOnLan = 1283 { cluster Channel = 1284 { revision 1; // NOTE: Default/not specifically set + enum ChannelTypeEnum : enum8 { + kSatellite = 0; + kCable = 1; + kTerrestrial = 2; + } + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } @@ -6790,6 +6796,29 @@ cluster Channel = 1284 { bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; + kElectronicGuide = 0x3; + kRecordProgram = 0x4; + } + + bitmap RecordingFlagBitmap : bitmap32 { + kScheduled = 0x1; + kRecordSeries = 0x2; + kRecorded = 0x3; + } + + struct ProgramCastStruct { + char_string name = 0; + char_string role = 1; + } + + struct ProgramCategoryStruct { + char_string category = 0; + optional char_string subCategory = 1; + } + + struct SeriesInfoStruct { + char_string season = 0; + char_string episode = 1; } struct ChannelInfoStruct { @@ -6798,6 +6827,46 @@ cluster Channel = 1284 { optional char_string name = 2; optional char_string callSign = 3; optional char_string affiliateCallSign = 4; + optional char_string identifier = 5; + optional ChannelTypeEnum type = 6; + } + + struct ProgramStruct { + char_string identifier = 0; + ChannelInfoStruct channel = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + char_string title = 4; + optional char_string subtitle = 5; + optional char_string description = 6; + optional char_string audioLanguages[] = 7; + optional char_string ratings[] = 8; + optional char_string thumbnailUrl = 9; + optional char_string posterArtUrl = 10; + optional char_string dvbiUrl = 11; + optional char_string releaseDate = 12; + optional char_string parentalGuidanceText = 13; + optional RecordingFlagBitmap recordingFlag = 14; + optional nullable SeriesInfoStruct seriesInfo = 15; + optional ProgramCategoryStruct categoryList[] = 16; + optional ProgramCastStruct castList[] = 17; + optional ProgramCastStruct externalIDList[] = 18; + } + + struct PageTokenStruct { + optional int16u limit = 0; + optional char_string after = 1; + optional char_string before = 2; + } + + struct ChannelPagingStruct { + optional nullable PageTokenStruct previousToken = 0; + optional nullable PageTokenStruct nextToken = 1; + } + + struct AdditionalInfoStruct { + char_string name = 0; + char_string value = 1; } struct LineupInfoStruct { @@ -6835,12 +6904,47 @@ cluster Channel = 1284 { int16s count = 0; } + request struct GetProgramGuideRequest { + optional epoch_s startTime = 0; + optional epoch_s endTime = 1; + optional ChannelInfoStruct channelList[] = 2; + optional PageTokenStruct pageToken = 3; + optional RecordingFlagBitmap recordingFlag = 4; + optional AdditionalInfoStruct externalIDList[] = 5; + optional octet_string data = 6; + } + + response struct ProgramGuideResponse = 5 { + int16s channelPagingStruct = 0; + ProgramStruct programList[] = 1; + } + + request struct RecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + + request struct CancelRecordProgramRequest { + char_string programIdentifier = 0; + boolean shouldRecordSeries = 1; + AdditionalInfoStruct externalIDList[] = 2; + octet_string data = 3; + } + /** Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. */ command ChangeChannel(ChangeChannelRequest): ChangeChannelResponse = 0; /** Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute. */ command ChangeChannelByNumber(ChangeChannelByNumberRequest): DefaultSuccess = 2; /** This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. */ command SkipChannel(SkipChannelRequest): DefaultSuccess = 3; + /** This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. */ + command GetProgramGuide(GetProgramGuideRequest): ProgramGuideResponse = 4; + /** Record a specific program or series when it goes live. This functionality enables DVR recording features. */ + command RecordProgram(RecordProgramRequest): DefaultSuccess = 6; + /** Cancel recording for a specific program or series. */ + command CancelRecordProgram(CancelRecordProgramRequest): DefaultSuccess = 7; } /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ @@ -6858,6 +6962,12 @@ cluster TargetNavigator = 1285 { char_string name = 1; } + info event TargetUpdated = 0 { + TargetInfoStruct targetList[] = 0; + int8u currentTarget = 1; + octet_string data = 2; + } + readonly attribute TargetInfoStruct targetList[] = 0; readonly attribute optional int8u currentTarget = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -6885,6 +6995,27 @@ cluster TargetNavigator = 1285 { cluster MediaPlayback = 1286 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; @@ -6904,6 +7035,19 @@ cluster MediaPlayback = 1286 { bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; + kTextTracks = 0x3; + kAudioTracks = 0x4; + kAudioAdvance = 0x5; + } + + struct TrackAttributesStruct { + char_string<32> languageCode = 0; + optional nullable char_string displayName = 1; + } + + struct TrackStruct { + char_string<32> id = 0; + nullable TrackAttributesStruct trackAttributes = 1; } struct PlaybackPositionStruct { @@ -6911,6 +7055,18 @@ cluster MediaPlayback = 1286 { nullable int64u position = 1; } + info event StateChanged = 0 { + PlaybackStateEnum currentState = 0; + EPOCH_US startTime = 1; + INT64U duration = 2; + PlaybackPositionStruct sampledPosition = 3; + single playbackSpeed = 4; + INT64U seekRangeEnd = 5; + INT64U seekRangeStart = 6; + optional OCTET_STRING data = 7; + boolean audioAdvanceUnmuted = 8; + } + readonly attribute PlaybackStateEnum currentState = 0; readonly attribute optional nullable epoch_us startTime = 1; readonly attribute optional nullable int64u duration = 2; @@ -6918,6 +7074,10 @@ cluster MediaPlayback = 1286 { readonly attribute optional single playbackSpeed = 4; readonly attribute optional nullable int64u seekRangeEnd = 5; readonly attribute optional nullable int64u seekRangeStart = 6; + readonly attribute optional nullable TrackStruct activeAudioTrack = 7; + readonly attribute optional nullable TrackStruct availableAudioTracks[] = 8; + readonly attribute optional nullable TrackStruct activeTextTrack = 9; + readonly attribute optional nullable TrackStruct availableTextTracks[] = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6925,6 +7085,14 @@ cluster MediaPlayback = 1286 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + request struct RewindRequest { + optional boolean audioAdvanceUnmuted = 0; + } + + request struct FastForwardRequest { + optional boolean audioAdvanceUnmuted = 0; + } + request struct SkipForwardRequest { int64u deltaPositionMilliseconds = 0; } @@ -6942,6 +7110,15 @@ cluster MediaPlayback = 1286 { int64u position = 0; } + request struct ActivateAudioTrackRequest { + CHAR_STRING trackID = 0; + INT8U audioOutputIndex = 1; + } + + request struct ActivateTextTrackRequest { + CHAR_STRING trackID = 0; + } + /** Upon receipt, this SHALL play media. */ command Play(): PlaybackResponse = 0; /** Upon receipt, this SHALL pause media. */ @@ -6955,15 +7132,21 @@ cluster MediaPlayback = 1286 { /** Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. */ command Next(): PlaybackResponse = 5; /** Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command Rewind(): PlaybackResponse = 6; + command Rewind(RewindRequest): PlaybackResponse = 6; /** Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - command FastForward(): PlaybackResponse = 7; + command FastForward(FastForwardRequest): PlaybackResponse = 7; /** Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: */ command SkipForward(SkipForwardRequest): PlaybackResponse = 8; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command SkipBackward(SkipBackwardRequest): PlaybackResponse = 9; /** Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ command Seek(SeekRequest): PlaybackResponse = 11; + /** Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. */ + command ActivateAudioTrack(ActivateAudioTrackRequest): DefaultSuccess = 12; + /** Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. */ + command ActivateTextTrack(ActivateTextTrackRequest): DefaultSuccess = 13; + /** If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. */ + command DeactivateTextTrack(): DefaultSuccess = 14; } /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ @@ -7167,6 +7350,27 @@ cluster KeypadInput = 1289 { cluster ContentLauncher = 1290 { revision 1; // NOTE: Default/not specifically set + enum CharacteristicEnum : enum8 { + kForcedSubtitles = 0; + kDescribesVideo = 1; + kEasyToRead = 2; + kFrameBased = 3; + kMainProgram = 4; + kOriginalContent = 5; + kVoiceOverTranslation = 6; + kCaption = 7; + kSubtitle = 8; + kAlternate = 9; + kSupplementary = 10; + kCommentary = 11; + kDubbedTranslation = 12; + kDescription = 13; + kMetadata = 14; + kEnhancedAudioIntelligibility = 15; + kEmergency = 16; + kKaraoke = 17; + } + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; @@ -7187,22 +7391,31 @@ cluster ContentLauncher = 1290 { kSportsTeam = 11; kType = 12; kVideo = 13; + kSeason = 14; + kEpisode = 15; + kAny = 16; } enum StatusEnum : enum8 { kSuccess = 0; kURLNotAvailable = 1; kAuthFailed = 2; + kTextTrackNotAvailable = 3; + kAudioTrackNotAvailable = 4; } bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; + kAdvancedSeek = 0x3; + kTextTracks = 0x4; + kAudioTracks = 0x5; } bitmap SupportedProtocolsBitmap : bitmap32 { kDASH = 0x1; kHLS = 0x2; + kWebRTC = 0x2; } struct DimensionStruct { @@ -7211,6 +7424,18 @@ cluster ContentLauncher = 1290 { MetricTypeEnum metric = 2; } + struct TrackPreferenceStruct { + char_string<32> languageCode = 0; + optional CharacteristicEnum characteristics[] = 1; + int8u audioOutputIndex = 2; + } + + struct PlaybackPreferencesStruct { + int64u playbackPosition = 0; + TrackPreferenceStruct textTrack = 1; + optional TrackPreferenceStruct audioTracks[] = 2; + } + struct AdditionalInfoStruct { char_string<256> name = 0; char_string<8192> value = 1; @@ -7254,6 +7479,8 @@ cluster ContentLauncher = 1290 { ContentSearchStruct search = 0; boolean autoPlay = 1; optional char_string data = 2; + optional PlaybackPreferencesStruct playbackPreferences = 3; + optional boolean useCurrentContext = 4; } request struct LaunchURLRequest { @@ -7415,6 +7642,10 @@ cluster ApplicationBasic = 1293 { cluster AccountLogin = 1294 { revision 1; // NOTE: Default/not specifically set + critical event LoggedOut = 0 { + optional node_id node = 0; + } + readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -7433,6 +7664,11 @@ cluster AccountLogin = 1294 { request struct LoginRequest { char_string<100> tempAccountIdentifier = 0; char_string setupPIN = 1; + optional node_id node = 2; + } + + request struct LogoutRequest { + optional node_id node = 0; } /** Upon receipt, the Content App checks if the account associated with the client Temp Account Identifier Rotating ID is the same acount that is active on the given Content App. If the accounts are the same, then the Content App includes the Setup PIN in the GetSetupPIN Response. */ @@ -7440,7 +7676,121 @@ cluster AccountLogin = 1294 { /** Upon receipt, the Content App checks if the account associated with the client’s Temp Account Identifier (Rotating ID) has a current active Setup PIN with the given value. If the Setup PIN is valid for the user account associated with the Temp Account Identifier, then the Content App MAY make that user account active. */ fabric timed command access(invoke: administer) Login(LoginRequest): DefaultSuccess = 2; /** The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. */ - fabric timed command Logout(): DefaultSuccess = 3; + fabric timed command Logout(LogoutRequest): DefaultSuccess = 3; +} + +/** This cluster is used for managing the content control (including "parental control") settings on a media device such as a TV, or Set-top Box. */ +cluster ContentControl = 1295 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kScreenTime = 0x1; + kPINManagement = 0x2; + kBlockUnrated = 0x3; + kOnDemandContentRating = 0x4; + kScheduledContentRating = 0x5; + } + + struct RatingNameStruct { + char_string ratingName = 0; + optional char_string ratingNameDesc = 1; + } + + info event RemainingScreenTimeExpired = 0 { + } + + readonly attribute boolean enabled = 0; + readonly attribute optional RatingNameStruct onDemandRatings[] = 1; + readonly attribute optional char_string<8> onDemandRatingThreshold = 2; + readonly attribute optional RatingNameStruct scheduledContentRatings[] = 3; + readonly attribute optional char_string<8> scheduledContentRatingThreshold = 4; + readonly attribute optional elapsed_s screenDailyTime = 5; + readonly attribute optional elapsed_s remainingScreenTime = 6; + readonly attribute boolean blockUnrated = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct UpdatePINRequest { + optional char_string oldPIN = 0; + char_string newPIN = 1; + } + + response struct ResetPINResponse = 2 { + char_string PINCode = 0; + } + + request struct AddBonusTimeRequest { + optional char_string PINCode = 0; + optional elapsed_s bonusTime = 1; + } + + request struct SetScreenDailyTimeRequest { + elapsed_s screenTime = 0; + } + + request struct SetOnDemandRatingThresholdRequest { + char_string rating = 0; + } + + request struct SetScheduledContentRatingThresholdRequest { + char_string rating = 0; + } + + /** The purpose of this command is to update the PIN used for protecting configuration of the content control settings. Upon success, the old PIN SHALL no longer work. The PIN is used to ensure that only the Node (or User) with the PIN code can make changes to the Content Control settings, for example, turn off Content Controls or modify the ScreenDailyTime. The PIN is composed of a numeric string of up to 6 human readable characters (displayable) . Upon receipt of this command, the media device SHALL check if the OldPIN field of this command is the same as the current PIN. If the PINs are the same, then the PIN code SHALL be set to NewPIN. Otherwise a response with InvalidPINCode error status SHALL be returned. The media device MAY provide a default PIN to the User via an out of band mechanism. For security reasons, it is recommended that a client encourage the user to update the PIN from its default value when performing configuration of the Content Control settings exposed by this cluster. The ResetPIN command can also be used to obtain the default PIN. */ + command UpdatePIN(UpdatePINRequest): DefaultSuccess = 0; + /** The purpose of this command is to reset the PIN. If this command is executed successfully, a ResetPINResponse command with a new PIN SHALL be returned. */ + command ResetPIN(): ResetPINResponse = 1; + /** The purpose of this command is to turn on the Content Control feature on a media device. On receipt of the Enable command, the media device SHALL set the Enabled attribute to TRUE. */ + command Enable(): DefaultSuccess = 3; + /** The purpose of this command is to turn off the Content Control feature on a media device. On receipt of the Disable command, the media device SHALL set the Enabled attribute to FALSE. */ + command Disable(): DefaultSuccess = 4; + /** The purpose of this command is to add the extra screen time for the user. If a client with Operate privilege invokes this command, the media device SHALL check whether the PINCode passed in the command matches the current PINCode value. If these match, then the RemainingScreenTime attribute SHALL be increased by the specified BonusTime value. If the PINs do not match, then a response with InvalidPINCode error status SHALL be returned, and no changes SHALL be made to RemainingScreenTime. If a client with Manage privilege or greater invokes this command, the media device SHALL ignore the PINCode field and directly increase the RemainingScreenTime attribute by the specified BonusTime value. A server that does not support the PM feature SHALL respond with InvalidPINCode to clients that only have Operate privilege unless: It has been provided with the PIN value to expect via an out of band mechanism, and The client has provided a PINCode that matches the expected PIN value. */ + command AddBonusTime(AddBonusTimeRequest): DefaultSuccess = 5; + /** The purpose of this command is to set the ScreenDailyTime attribute. On receipt of the SetScreenDailyTime command, the media device SHALL set the ScreenDailyTime attribute to the ScreenTime value. */ + command SetScreenDailyTime(SetScreenDailyTimeRequest): DefaultSuccess = 6; + /** The purpose of this command is to specify whether programs with no Content rating must be blocked by this media device. On receipt of the BlockUnratedContent command, the media device SHALL set the BlockUnrated attribute to TRUE. */ + command BlockUnratedContent(): DefaultSuccess = 7; + /** The purpose of this command is to specify whether programs with no Content rating must be blocked by this media device. On receipt of the UnblockUnratedContent command, the media device SHALL set the BlockUnrated attribute to FALSE. */ + command UnblockUnratedContent(): DefaultSuccess = 8; + /** The purpose of this command is to set the OnDemandRatingThreshold attribute. On receipt of the SetOnDemandRatingThreshold command, the media device SHALL check if the Rating field is one of values present in the OnDemandRatings attribute. If not, then a response with InvalidRating error status SHALL be returned. */ + command SetOnDemandRatingThreshold(SetOnDemandRatingThresholdRequest): DefaultSuccess = 9; + /** The purpose of this command is to set ScheduledContentRatingThreshold attribute. On receipt of the SetScheduledContentRatingThreshold command, the media device SHALL check if the Rating field is one of values present in the ScheduledContentRatings attribute. If not, then a response with InvalidRating error status SHALL be returned. */ + command SetScheduledContentRatingThreshold(SetScheduledContentRatingThresholdRequest): DefaultSuccess = 10; +} + +/** This cluster provides an interface for sending targeted commands to an Observer of a Content App on a Video Player device such as a Streaming Media Player, Smart TV or Smart Screen. The cluster server for Content App Observer is implemented by an endpoint that communicates with a Content App, such as a Casting Video Client. The cluster client for Content App Observer is implemented by a Content App endpoint. A Content App is informed of the NodeId of an Observer when a binding is set on the Content App. The Content App can then send the ContentAppMessage to the Observer (server cluster), and the Observer responds with a ContentAppMessageResponse. */ +cluster ContentAppObserver = 1296 { + revision 1; // NOTE: Default/not specifically set + + enum StatusEnum : enum8 { + kSuccess = 0; + kUnexpectedData = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ContentAppMessageRequest { + optional char_string data = 0; + char_string encodingHint = 1; + } + + response struct ContentAppMessageResponse = 1 { + optional StatusEnum status = 0; + char_string data = 1; + char_string encodingHint = 2; + } + + /** Upon receipt, the data field MAY be parsed and interpreted. Message encoding is specific to the Content App. A Content App MAY when possible read attributes from the Basic Information Cluster on the Observer and use this to determine the Message encoding. */ + command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0; } /** Attributes related to the electrical properties of a device. This cluster is used by power outlets and other devices that need to provide instantaneous data as opposed to metrology data which should be retrieved from the metering cluster.. */ diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index e0131169c1c4df..9d5ffd3f8f4885 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -47634,10 +47634,139 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, value, timedInvokeTimeoutMs); } + public void getProgramGuide(ProgramGuideResponseCallback callback, Optional startTime, Optional endTime, Optional> channelList, Optional pageToken, Optional recordingFlag, Optional> externalIDList, Optional data) { + getProgramGuide(callback, startTime, endTime, channelList, pageToken, recordingFlag, externalIDList, data, 0); + } + + public void getProgramGuide(ProgramGuideResponseCallback callback, Optional startTime, Optional endTime, Optional> channelList, Optional pageToken, Optional recordingFlag, Optional> externalIDList, Optional data, int timedInvokeTimeoutMs) { + final long commandId = 4L; + + ArrayList elements = new ArrayList<>(); + final long startTimeFieldID = 0L; + BaseTLVType startTimetlvValue = startTime.map((nonOptionalstartTime) -> new UIntType(nonOptionalstartTime)).orElse(new EmptyType()); + elements.add(new StructElement(startTimeFieldID, startTimetlvValue)); + + final long endTimeFieldID = 1L; + BaseTLVType endTimetlvValue = endTime.map((nonOptionalendTime) -> new UIntType(nonOptionalendTime)).orElse(new EmptyType()); + elements.add(new StructElement(endTimeFieldID, endTimetlvValue)); + + final long channelListFieldID = 2L; + BaseTLVType channelListtlvValue = channelList.map((nonOptionalchannelList) -> ArrayType.generateArrayType(nonOptionalchannelList, (elementnonOptionalchannelList) -> elementnonOptionalchannelList.encodeTlv())).orElse(new EmptyType()); + elements.add(new StructElement(channelListFieldID, channelListtlvValue)); + + final long pageTokenFieldID = 3L; + BaseTLVType pageTokentlvValue = pageToken.map((nonOptionalpageToken) -> nonOptionalpageToken.encodeTlv()).orElse(new EmptyType()); + elements.add(new StructElement(pageTokenFieldID, pageTokentlvValue)); + + final long recordingFlagFieldID = 4L; + BaseTLVType recordingFlagtlvValue = recordingFlag.map((nonOptionalrecordingFlag) -> new UIntType(nonOptionalrecordingFlag)).orElse(new EmptyType()); + elements.add(new StructElement(recordingFlagFieldID, recordingFlagtlvValue)); + + final long externalIDListFieldID = 5L; + BaseTLVType externalIDListtlvValue = externalIDList.map((nonOptionalexternalIDList) -> ArrayType.generateArrayType(nonOptionalexternalIDList, (elementnonOptionalexternalIDList) -> elementnonOptionalexternalIDList.encodeTlv())).orElse(new EmptyType()); + elements.add(new StructElement(externalIDListFieldID, externalIDListtlvValue)); + + final long dataFieldID = 6L; + BaseTLVType datatlvValue = data.map((nonOptionaldata) -> new ByteArrayType(nonOptionaldata)).orElse(new EmptyType()); + elements.add(new StructElement(dataFieldID, datatlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long channelPagingStructFieldID = 0L; + Integer channelPagingStruct = null; + final long programListFieldID = 1L; + ArrayList programList = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == channelPagingStructFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + channelPagingStruct = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == programListFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + programList = castingValue.map((elementcastingValue) -> ChipStructs.ChannelClusterProgramStruct.decodeTlv(elementcastingValue)); + } + } + } + callback.onSuccess(channelPagingStruct, programList); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void recordProgram(DefaultClusterCallback callback, String programIdentifier, Boolean shouldRecordSeries, ArrayList externalIDList, byte[] data) { + recordProgram(callback, programIdentifier, shouldRecordSeries, externalIDList, data, 0); + } + + public void recordProgram(DefaultClusterCallback callback, String programIdentifier, Boolean shouldRecordSeries, ArrayList externalIDList, byte[] data, int timedInvokeTimeoutMs) { + final long commandId = 6L; + + ArrayList elements = new ArrayList<>(); + final long programIdentifierFieldID = 0L; + BaseTLVType programIdentifiertlvValue = new StringType(programIdentifier); + elements.add(new StructElement(programIdentifierFieldID, programIdentifiertlvValue)); + + final long shouldRecordSeriesFieldID = 1L; + BaseTLVType shouldRecordSeriestlvValue = new BooleanType(shouldRecordSeries); + elements.add(new StructElement(shouldRecordSeriesFieldID, shouldRecordSeriestlvValue)); + + final long externalIDListFieldID = 2L; + BaseTLVType externalIDListtlvValue = ArrayType.generateArrayType(externalIDList, (elementexternalIDList) -> elementexternalIDList.encodeTlv()); + elements.add(new StructElement(externalIDListFieldID, externalIDListtlvValue)); + + final long dataFieldID = 3L; + BaseTLVType datatlvValue = new ByteArrayType(data); + elements.add(new StructElement(dataFieldID, datatlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void cancelRecordProgram(DefaultClusterCallback callback, String programIdentifier, Boolean shouldRecordSeries, ArrayList externalIDList, byte[] data) { + cancelRecordProgram(callback, programIdentifier, shouldRecordSeries, externalIDList, data, 0); + } + + public void cancelRecordProgram(DefaultClusterCallback callback, String programIdentifier, Boolean shouldRecordSeries, ArrayList externalIDList, byte[] data, int timedInvokeTimeoutMs) { + final long commandId = 7L; + + ArrayList elements = new ArrayList<>(); + final long programIdentifierFieldID = 0L; + BaseTLVType programIdentifiertlvValue = new StringType(programIdentifier); + elements.add(new StructElement(programIdentifierFieldID, programIdentifiertlvValue)); + + final long shouldRecordSeriesFieldID = 1L; + BaseTLVType shouldRecordSeriestlvValue = new BooleanType(shouldRecordSeries); + elements.add(new StructElement(shouldRecordSeriesFieldID, shouldRecordSeriestlvValue)); + + final long externalIDListFieldID = 2L; + BaseTLVType externalIDListtlvValue = ArrayType.generateArrayType(externalIDList, (elementexternalIDList) -> elementexternalIDList.encodeTlv()); + elements.add(new StructElement(externalIDListFieldID, externalIDListtlvValue)); + + final long dataFieldID = 3L; + BaseTLVType datatlvValue = new ByteArrayType(data); + elements.add(new StructElement(dataFieldID, datatlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + public interface ChangeChannelResponseCallback extends BaseClusterCallback { void onSuccess(Integer status, Optional data); } + public interface ProgramGuideResponseCallback extends BaseClusterCallback { + void onSuccess(Integer channelPagingStruct, ArrayList programList); + } + public interface ChannelListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } @@ -48190,6 +48319,10 @@ public static class MediaPlaybackCluster extends BaseChipCluster { private static final long PLAYBACK_SPEED_ATTRIBUTE_ID = 4L; private static final long SEEK_RANGE_END_ATTRIBUTE_ID = 5L; private static final long SEEK_RANGE_START_ATTRIBUTE_ID = 6L; + private static final long ACTIVE_AUDIO_TRACK_ATTRIBUTE_ID = 7L; + private static final long AVAILABLE_AUDIO_TRACKS_ATTRIBUTE_ID = 8L; + private static final long ACTIVE_TEXT_TRACK_ATTRIBUTE_ID = 9L; + private static final long AVAILABLE_TEXT_TRACKS_ATTRIBUTE_ID = 10L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -48405,14 +48538,18 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, value, timedInvokeTimeoutMs); } - public void rewind(PlaybackResponseCallback callback) { - rewind(callback, 0); + public void rewind(PlaybackResponseCallback callback, Optional audioAdvanceUnmuted) { + rewind(callback, audioAdvanceUnmuted, 0); } - public void rewind(PlaybackResponseCallback callback, int timedInvokeTimeoutMs) { + public void rewind(PlaybackResponseCallback callback, Optional audioAdvanceUnmuted, int timedInvokeTimeoutMs) { final long commandId = 6L; ArrayList elements = new ArrayList<>(); + final long audioAdvanceUnmutedFieldID = 0L; + BaseTLVType audioAdvanceUnmutedtlvValue = audioAdvanceUnmuted.map((nonOptionalaudioAdvanceUnmuted) -> new BooleanType(nonOptionalaudioAdvanceUnmuted)).orElse(new EmptyType()); + elements.add(new StructElement(audioAdvanceUnmutedFieldID, audioAdvanceUnmutedtlvValue)); + StructType value = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override @@ -48438,14 +48575,18 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, value, timedInvokeTimeoutMs); } - public void fastForward(PlaybackResponseCallback callback) { - fastForward(callback, 0); + public void fastForward(PlaybackResponseCallback callback, Optional audioAdvanceUnmuted) { + fastForward(callback, audioAdvanceUnmuted, 0); } - public void fastForward(PlaybackResponseCallback callback, int timedInvokeTimeoutMs) { + public void fastForward(PlaybackResponseCallback callback, Optional audioAdvanceUnmuted, int timedInvokeTimeoutMs) { final long commandId = 7L; ArrayList elements = new ArrayList<>(); + final long audioAdvanceUnmutedFieldID = 0L; + BaseTLVType audioAdvanceUnmutedtlvValue = audioAdvanceUnmuted.map((nonOptionalaudioAdvanceUnmuted) -> new BooleanType(nonOptionalaudioAdvanceUnmuted)).orElse(new EmptyType()); + elements.add(new StructElement(audioAdvanceUnmutedFieldID, audioAdvanceUnmutedtlvValue)); + StructType value = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override @@ -48582,6 +48723,66 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, value, timedInvokeTimeoutMs); } + public void activateAudioTrack(DefaultClusterCallback callback, String trackID, Integer audioOutputIndex) { + activateAudioTrack(callback, trackID, audioOutputIndex, 0); + } + + public void activateAudioTrack(DefaultClusterCallback callback, String trackID, Integer audioOutputIndex, int timedInvokeTimeoutMs) { + final long commandId = 12L; + + ArrayList elements = new ArrayList<>(); + final long trackIDFieldID = 0L; + BaseTLVType trackIDtlvValue = new StringType(trackID); + elements.add(new StructElement(trackIDFieldID, trackIDtlvValue)); + + final long audioOutputIndexFieldID = 1L; + BaseTLVType audioOutputIndextlvValue = new UIntType(audioOutputIndex); + elements.add(new StructElement(audioOutputIndexFieldID, audioOutputIndextlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void activateTextTrack(DefaultClusterCallback callback, String trackID) { + activateTextTrack(callback, trackID, 0); + } + + public void activateTextTrack(DefaultClusterCallback callback, String trackID, int timedInvokeTimeoutMs) { + final long commandId = 13L; + + ArrayList elements = new ArrayList<>(); + final long trackIDFieldID = 0L; + BaseTLVType trackIDtlvValue = new StringType(trackID); + elements.add(new StructElement(trackIDFieldID, trackIDtlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void deactivateTextTrack(DefaultClusterCallback callback) { + deactivateTextTrack(callback, 0); + } + + public void deactivateTextTrack(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 14L; + + ArrayList elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + public interface PlaybackResponseCallback extends BaseClusterCallback { void onSuccess(Integer status, Optional data); } @@ -48606,6 +48807,22 @@ public interface SeekRangeStartAttributeCallback extends BaseAttributeCallback { void onSuccess(@Nullable Long value); } + public interface ActiveAudioTrackAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.MediaPlaybackClusterTrackStruct value); + } + + public interface AvailableAudioTracksAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable List value); + } + + public interface ActiveTextTrackAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.MediaPlaybackClusterTrackStruct value); + } + + public interface AvailableTextTracksAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable List value); + } + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } @@ -48797,6 +49014,106 @@ public void onSuccess(byte[] tlv) { }, SEEK_RANGE_START_ATTRIBUTE_ID, minInterval, maxInterval); } + public void readActiveAudioTrackAttribute( + ActiveAudioTrackAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_AUDIO_TRACK_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.MediaPlaybackClusterTrackStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACTIVE_AUDIO_TRACK_ATTRIBUTE_ID, true); + } + + public void subscribeActiveAudioTrackAttribute( + ActiveAudioTrackAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_AUDIO_TRACK_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.MediaPlaybackClusterTrackStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ACTIVE_AUDIO_TRACK_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAvailableAudioTracksAttribute( + AvailableAudioTracksAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVAILABLE_AUDIO_TRACKS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, AVAILABLE_AUDIO_TRACKS_ATTRIBUTE_ID, true); + } + + public void subscribeAvailableAudioTracksAttribute( + AvailableAudioTracksAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVAILABLE_AUDIO_TRACKS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, AVAILABLE_AUDIO_TRACKS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readActiveTextTrackAttribute( + ActiveTextTrackAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_TEXT_TRACK_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.MediaPlaybackClusterTrackStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACTIVE_TEXT_TRACK_ATTRIBUTE_ID, true); + } + + public void subscribeActiveTextTrackAttribute( + ActiveTextTrackAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_TEXT_TRACK_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.MediaPlaybackClusterTrackStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ACTIVE_TEXT_TRACK_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAvailableTextTracksAttribute( + AvailableTextTracksAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVAILABLE_TEXT_TRACKS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, AVAILABLE_TEXT_TRACKS_ATTRIBUTE_ID, true); + } + + public void subscribeAvailableTextTracksAttribute( + AvailableTextTracksAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVAILABLE_TEXT_TRACKS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, AVAILABLE_TEXT_TRACKS_ATTRIBUTE_ID, minInterval, maxInterval); + } + public void readGeneratedCommandListAttribute( GeneratedCommandListAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); @@ -49713,11 +50030,11 @@ public long initWithDevice(long devicePtr, int endpointId) { return 0L; } - public void launchContent(LauncherResponseCallback callback, ChipStructs.ContentLauncherClusterContentSearchStruct search, Boolean autoPlay, Optional data) { - launchContent(callback, search, autoPlay, data, 0); + public void launchContent(LauncherResponseCallback callback, ChipStructs.ContentLauncherClusterContentSearchStruct search, Boolean autoPlay, Optional data, Optional playbackPreferences, Optional useCurrentContext) { + launchContent(callback, search, autoPlay, data, playbackPreferences, useCurrentContext, 0); } - public void launchContent(LauncherResponseCallback callback, ChipStructs.ContentLauncherClusterContentSearchStruct search, Boolean autoPlay, Optional data, int timedInvokeTimeoutMs) { + public void launchContent(LauncherResponseCallback callback, ChipStructs.ContentLauncherClusterContentSearchStruct search, Boolean autoPlay, Optional data, Optional playbackPreferences, Optional useCurrentContext, int timedInvokeTimeoutMs) { final long commandId = 0L; ArrayList elements = new ArrayList<>(); @@ -49733,6 +50050,14 @@ public void launchContent(LauncherResponseCallback callback, ChipStructs.Content BaseTLVType datatlvValue = data.map((nonOptionaldata) -> new StringType(nonOptionaldata)).orElse(new EmptyType()); elements.add(new StructElement(dataFieldID, datatlvValue)); + final long playbackPreferencesFieldID = 3L; + BaseTLVType playbackPreferencestlvValue = playbackPreferences.map((nonOptionalplaybackPreferences) -> nonOptionalplaybackPreferences.encodeTlv()).orElse(new EmptyType()); + elements.add(new StructElement(playbackPreferencesFieldID, playbackPreferencestlvValue)); + + final long useCurrentContextFieldID = 4L; + BaseTLVType useCurrentContexttlvValue = useCurrentContext.map((nonOptionaluseCurrentContext) -> new BooleanType(nonOptionaluseCurrentContext)).orElse(new EmptyType()); + elements.add(new StructElement(useCurrentContextFieldID, useCurrentContexttlvValue)); + StructType value = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override @@ -51132,7 +51457,7 @@ public void onResponse(StructType invokeStructValue) { } - public void login(DefaultClusterCallback callback, String tempAccountIdentifier, String setupPIN, int timedInvokeTimeoutMs) { + public void login(DefaultClusterCallback callback, String tempAccountIdentifier, String setupPIN, Optional node, int timedInvokeTimeoutMs) { final long commandId = 2L; ArrayList elements = new ArrayList<>(); @@ -51144,6 +51469,10 @@ public void login(DefaultClusterCallback callback, String tempAccountIdentifier, BaseTLVType setupPINtlvValue = new StringType(setupPIN); elements.add(new StructElement(setupPINFieldID, setupPINtlvValue)); + final long nodeFieldID = 2L; + BaseTLVType nodetlvValue = node.map((nonOptionalnode) -> new UIntType(nonOptionalnode)).orElse(new EmptyType()); + elements.add(new StructElement(nodeFieldID, nodetlvValue)); + StructType value = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override @@ -51153,10 +51482,14 @@ public void onResponse(StructType invokeStructValue) { } - public void logout(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + public void logout(DefaultClusterCallback callback, Optional node, int timedInvokeTimeoutMs) { final long commandId = 3L; ArrayList elements = new ArrayList<>(); + final long nodeFieldID = 0L; + BaseTLVType nodetlvValue = node.map((nonOptionalnode) -> new UIntType(nonOptionalnode)).orElse(new EmptyType()); + elements.add(new StructElement(nodeFieldID, nodetlvValue)); + StructType value = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override @@ -51336,6 +51669,850 @@ public void onSuccess(byte[] tlv) { } } + public static class ContentControlCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1295L; + + private static final long ENABLED_ATTRIBUTE_ID = 0L; + private static final long ON_DEMAND_RATINGS_ATTRIBUTE_ID = 1L; + private static final long ON_DEMAND_RATING_THRESHOLD_ATTRIBUTE_ID = 2L; + private static final long SCHEDULED_CONTENT_RATINGS_ATTRIBUTE_ID = 3L; + private static final long SCHEDULED_CONTENT_RATING_THRESHOLD_ATTRIBUTE_ID = 4L; + private static final long SCREEN_DAILY_TIME_ATTRIBUTE_ID = 5L; + private static final long REMAINING_SCREEN_TIME_ATTRIBUTE_ID = 6L; + private static final long BLOCK_UNRATED_ATTRIBUTE_ID = 7L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public ContentControlCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void updatePIN(DefaultClusterCallback callback, Optional oldPIN, String newPIN) { + updatePIN(callback, oldPIN, newPIN, 0); + } + + public void updatePIN(DefaultClusterCallback callback, Optional oldPIN, String newPIN, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + final long oldPINFieldID = 0L; + BaseTLVType oldPINtlvValue = oldPIN.map((nonOptionaloldPIN) -> new StringType(nonOptionaloldPIN)).orElse(new EmptyType()); + elements.add(new StructElement(oldPINFieldID, oldPINtlvValue)); + + final long newPINFieldID = 1L; + BaseTLVType newPINtlvValue = new StringType(newPIN); + elements.add(new StructElement(newPINFieldID, newPINtlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void resetPIN(ResetPINResponseCallback callback) { + resetPIN(callback, 0); + } + + public void resetPIN(ResetPINResponseCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 1L; + + ArrayList elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long PINCodeFieldID = 0L; + String PINCode = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == PINCodeFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + PINCode = castingValue.value(String.class); + } + } + } + callback.onSuccess(PINCode); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void enable(DefaultClusterCallback callback) { + enable(callback, 0); + } + + public void enable(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void disable(DefaultClusterCallback callback) { + disable(callback, 0); + } + + public void disable(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 4L; + + ArrayList elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void addBonusTime(DefaultClusterCallback callback, Optional PINCode, Optional bonusTime) { + addBonusTime(callback, PINCode, bonusTime, 0); + } + + public void addBonusTime(DefaultClusterCallback callback, Optional PINCode, Optional bonusTime, int timedInvokeTimeoutMs) { + final long commandId = 5L; + + ArrayList elements = new ArrayList<>(); + final long PINCodeFieldID = 0L; + BaseTLVType PINCodetlvValue = PINCode.map((nonOptionalPINCode) -> new StringType(nonOptionalPINCode)).orElse(new EmptyType()); + elements.add(new StructElement(PINCodeFieldID, PINCodetlvValue)); + + final long bonusTimeFieldID = 1L; + BaseTLVType bonusTimetlvValue = bonusTime.map((nonOptionalbonusTime) -> new UIntType(nonOptionalbonusTime)).orElse(new EmptyType()); + elements.add(new StructElement(bonusTimeFieldID, bonusTimetlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void setScreenDailyTime(DefaultClusterCallback callback, Long screenTime) { + setScreenDailyTime(callback, screenTime, 0); + } + + public void setScreenDailyTime(DefaultClusterCallback callback, Long screenTime, int timedInvokeTimeoutMs) { + final long commandId = 6L; + + ArrayList elements = new ArrayList<>(); + final long screenTimeFieldID = 0L; + BaseTLVType screenTimetlvValue = new UIntType(screenTime); + elements.add(new StructElement(screenTimeFieldID, screenTimetlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void blockUnratedContent(DefaultClusterCallback callback) { + blockUnratedContent(callback, 0); + } + + public void blockUnratedContent(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 7L; + + ArrayList elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void unblockUnratedContent(DefaultClusterCallback callback) { + unblockUnratedContent(callback, 0); + } + + public void unblockUnratedContent(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 8L; + + ArrayList elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void setOnDemandRatingThreshold(DefaultClusterCallback callback, String rating) { + setOnDemandRatingThreshold(callback, rating, 0); + } + + public void setOnDemandRatingThreshold(DefaultClusterCallback callback, String rating, int timedInvokeTimeoutMs) { + final long commandId = 9L; + + ArrayList elements = new ArrayList<>(); + final long ratingFieldID = 0L; + BaseTLVType ratingtlvValue = new StringType(rating); + elements.add(new StructElement(ratingFieldID, ratingtlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void setScheduledContentRatingThreshold(DefaultClusterCallback callback, String rating) { + setScheduledContentRatingThreshold(callback, rating, 0); + } + + public void setScheduledContentRatingThreshold(DefaultClusterCallback callback, String rating, int timedInvokeTimeoutMs) { + final long commandId = 10L; + + ArrayList elements = new ArrayList<>(); + final long ratingFieldID = 0L; + BaseTLVType ratingtlvValue = new StringType(rating); + elements.add(new StructElement(ratingFieldID, ratingtlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public interface ResetPINResponseCallback extends BaseClusterCallback { + void onSuccess(String PINCode); + } + + public interface OnDemandRatingsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface ScheduledContentRatingsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ENABLED_ATTRIBUTE_ID, true); + } + + public void subscribeEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readOnDemandRatingsAttribute( + OnDemandRatingsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_DEMAND_RATINGS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ON_DEMAND_RATINGS_ATTRIBUTE_ID, true); + } + + public void subscribeOnDemandRatingsAttribute( + OnDemandRatingsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_DEMAND_RATINGS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ON_DEMAND_RATINGS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readOnDemandRatingThresholdAttribute( + CharStringAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_DEMAND_RATING_THRESHOLD_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ON_DEMAND_RATING_THRESHOLD_ATTRIBUTE_ID, true); + } + + public void subscribeOnDemandRatingThresholdAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_DEMAND_RATING_THRESHOLD_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ON_DEMAND_RATING_THRESHOLD_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readScheduledContentRatingsAttribute( + ScheduledContentRatingsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SCHEDULED_CONTENT_RATINGS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SCHEDULED_CONTENT_RATINGS_ATTRIBUTE_ID, true); + } + + public void subscribeScheduledContentRatingsAttribute( + ScheduledContentRatingsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SCHEDULED_CONTENT_RATINGS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, SCHEDULED_CONTENT_RATINGS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readScheduledContentRatingThresholdAttribute( + CharStringAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SCHEDULED_CONTENT_RATING_THRESHOLD_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SCHEDULED_CONTENT_RATING_THRESHOLD_ATTRIBUTE_ID, true); + } + + public void subscribeScheduledContentRatingThresholdAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SCHEDULED_CONTENT_RATING_THRESHOLD_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, SCHEDULED_CONTENT_RATING_THRESHOLD_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readScreenDailyTimeAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SCREEN_DAILY_TIME_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SCREEN_DAILY_TIME_ATTRIBUTE_ID, true); + } + + public void subscribeScreenDailyTimeAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SCREEN_DAILY_TIME_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, SCREEN_DAILY_TIME_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readRemainingScreenTimeAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REMAINING_SCREEN_TIME_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, REMAINING_SCREEN_TIME_ATTRIBUTE_ID, true); + } + + public void subscribeRemainingScreenTimeAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REMAINING_SCREEN_TIME_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, REMAINING_SCREEN_TIME_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readBlockUnratedAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BLOCK_UNRATED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, BLOCK_UNRATED_ATTRIBUTE_ID, true); + } + + public void subscribeBlockUnratedAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BLOCK_UNRATED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, BLOCK_UNRATED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + + public static class ContentAppObserverCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1296L; + + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public ContentAppObserverCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void contentAppMessage(ContentAppMessageResponseCallback callback, Optional data, String encodingHint) { + contentAppMessage(callback, data, encodingHint, 0); + } + + public void contentAppMessage(ContentAppMessageResponseCallback callback, Optional data, String encodingHint, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + final long dataFieldID = 0L; + BaseTLVType datatlvValue = data.map((nonOptionaldata) -> new StringType(nonOptionaldata)).orElse(new EmptyType()); + elements.add(new StructElement(dataFieldID, datatlvValue)); + + final long encodingHintFieldID = 1L; + BaseTLVType encodingHinttlvValue = new StringType(encodingHint); + elements.add(new StructElement(encodingHintFieldID, encodingHinttlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long statusFieldID = 0L; + Optional status = Optional.empty(); + final long dataFieldID = 1L; + String data = null; + final long encodingHintFieldID = 2L; + String encodingHint = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == statusFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + status = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == dataFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + data = castingValue.value(String.class); + } + } else if (element.contextTagNum() == encodingHintFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + encodingHint = castingValue.value(String.class); + } + } + } + callback.onSuccess(status, data, encodingHint); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public interface ContentAppMessageResponseCallback extends BaseClusterCallback { + void onSuccess(Optional status, String data, String encodingHint); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + public static class ElectricalMeasurementCluster extends BaseChipCluster { public static final long CLUSTER_ID = 2820L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index db8d4ddc1bfc23..e44d68c3d07dfe 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -4182,6 +4182,294 @@ public String toString() { return output.toString(); } } +public static class TargetNavigatorClusterTargetUpdatedEvent { + public ArrayList targetList; + public Integer currentTarget; + public byte[] data; + private static final long TARGET_LIST_ID = 0L; + private static final long CURRENT_TARGET_ID = 1L; + private static final long DATA_ID = 2L; + + public TargetNavigatorClusterTargetUpdatedEvent( + ArrayList targetList, + Integer currentTarget, + byte[] data + ) { + this.targetList = targetList; + this.currentTarget = currentTarget; + this.data = data; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(TARGET_LIST_ID, ArrayType.generateArrayType(targetList, (elementtargetList) -> elementtargetList.encodeTlv()))); + values.add(new StructElement(CURRENT_TARGET_ID, new UIntType(currentTarget))); + values.add(new StructElement(DATA_ID, new ByteArrayType(data))); + + return new StructType(values); + } + + public static TargetNavigatorClusterTargetUpdatedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + ArrayList targetList = null; + Integer currentTarget = null; + byte[] data = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == TARGET_LIST_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + targetList = castingValue.map((elementcastingValue) -> ChipStructs.TargetNavigatorClusterTargetInfoStruct.decodeTlv(elementcastingValue)); + } + } else if (element.contextTagNum() == CURRENT_TARGET_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + currentTarget = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == DATA_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + data = castingValue.value(byte[].class); + } + } + } + return new TargetNavigatorClusterTargetUpdatedEvent( + targetList, + currentTarget, + data + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TargetNavigatorClusterTargetUpdatedEvent {\n"); + output.append("\ttargetList: "); + output.append(targetList); + output.append("\n"); + output.append("\tcurrentTarget: "); + output.append(currentTarget); + output.append("\n"); + output.append("\tdata: "); + output.append(Arrays.toString(data)); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class MediaPlaybackClusterStateChangedEvent { + public Integer currentState; + public Long startTime; + public Long duration; + public ChipStructs.MediaPlaybackClusterPlaybackPositionStruct sampledPosition; + public Float playbackSpeed; + public Long seekRangeEnd; + public Long seekRangeStart; + public Optional data; + public Boolean audioAdvanceUnmuted; + private static final long CURRENT_STATE_ID = 0L; + private static final long START_TIME_ID = 1L; + private static final long DURATION_ID = 2L; + private static final long SAMPLED_POSITION_ID = 3L; + private static final long PLAYBACK_SPEED_ID = 4L; + private static final long SEEK_RANGE_END_ID = 5L; + private static final long SEEK_RANGE_START_ID = 6L; + private static final long DATA_ID = 7L; + private static final long AUDIO_ADVANCE_UNMUTED_ID = 8L; + + public MediaPlaybackClusterStateChangedEvent( + Integer currentState, + Long startTime, + Long duration, + ChipStructs.MediaPlaybackClusterPlaybackPositionStruct sampledPosition, + Float playbackSpeed, + Long seekRangeEnd, + Long seekRangeStart, + Optional data, + Boolean audioAdvanceUnmuted + ) { + this.currentState = currentState; + this.startTime = startTime; + this.duration = duration; + this.sampledPosition = sampledPosition; + this.playbackSpeed = playbackSpeed; + this.seekRangeEnd = seekRangeEnd; + this.seekRangeStart = seekRangeStart; + this.data = data; + this.audioAdvanceUnmuted = audioAdvanceUnmuted; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CURRENT_STATE_ID, new UIntType(currentState))); + values.add(new StructElement(START_TIME_ID, new UIntType(startTime))); + values.add(new StructElement(DURATION_ID, new UIntType(duration))); + values.add(new StructElement(SAMPLED_POSITION_ID, sampledPosition.encodeTlv())); + values.add(new StructElement(PLAYBACK_SPEED_ID, new FloatType(playbackSpeed))); + values.add(new StructElement(SEEK_RANGE_END_ID, new UIntType(seekRangeEnd))); + values.add(new StructElement(SEEK_RANGE_START_ID, new UIntType(seekRangeStart))); + values.add(new StructElement(DATA_ID, data.map((nonOptionaldata) -> new ByteArrayType(nonOptionaldata)).orElse(new EmptyType()))); + values.add(new StructElement(AUDIO_ADVANCE_UNMUTED_ID, new BooleanType(audioAdvanceUnmuted))); + + return new StructType(values); + } + + public static MediaPlaybackClusterStateChangedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer currentState = null; + Long startTime = null; + Long duration = null; + ChipStructs.MediaPlaybackClusterPlaybackPositionStruct sampledPosition = null; + Float playbackSpeed = null; + Long seekRangeEnd = null; + Long seekRangeStart = null; + Optional data = Optional.empty(); + Boolean audioAdvanceUnmuted = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CURRENT_STATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + currentState = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == START_TIME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + startTime = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + duration = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == SAMPLED_POSITION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + sampledPosition = ChipStructs.MediaPlaybackClusterPlaybackPositionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == PLAYBACK_SPEED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Float) { + FloatType castingValue = element.value(FloatType.class); + playbackSpeed = castingValue.value(Float.class); + } + } else if (element.contextTagNum() == SEEK_RANGE_END_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + seekRangeEnd = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == SEEK_RANGE_START_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + seekRangeStart = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == DATA_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + data = Optional.of(castingValue.value(byte[].class)); + } + } else if (element.contextTagNum() == AUDIO_ADVANCE_UNMUTED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + audioAdvanceUnmuted = castingValue.value(Boolean.class); + } + } + } + return new MediaPlaybackClusterStateChangedEvent( + currentState, + startTime, + duration, + sampledPosition, + playbackSpeed, + seekRangeEnd, + seekRangeStart, + data, + audioAdvanceUnmuted + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("MediaPlaybackClusterStateChangedEvent {\n"); + output.append("\tcurrentState: "); + output.append(currentState); + output.append("\n"); + output.append("\tstartTime: "); + output.append(startTime); + output.append("\n"); + output.append("\tduration: "); + output.append(duration); + output.append("\n"); + output.append("\tsampledPosition: "); + output.append(sampledPosition); + output.append("\n"); + output.append("\tplaybackSpeed: "); + output.append(playbackSpeed); + output.append("\n"); + output.append("\tseekRangeEnd: "); + output.append(seekRangeEnd); + output.append("\n"); + output.append("\tseekRangeStart: "); + output.append(seekRangeStart); + output.append("\n"); + output.append("\tdata: "); + output.append(data.isPresent() ? Arrays.toString(data.get()) : ""); + output.append("\n"); + output.append("\taudioAdvanceUnmuted: "); + output.append(audioAdvanceUnmuted); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class AccountLoginClusterLoggedOutEvent { + public Optional node; + private static final long NODE_ID = 0L; + + public AccountLoginClusterLoggedOutEvent( + Optional node + ) { + this.node = node; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(NODE_ID, node.map((nonOptionalnode) -> new UIntType(nonOptionalnode)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static AccountLoginClusterLoggedOutEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional node = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == NODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + node = Optional.of(castingValue.value(Long.class)); + } + } + } + return new AccountLoginClusterLoggedOutEvent( + node + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("AccountLoginClusterLoggedOutEvent {\n"); + output.append("\tnode: "); + output.append(node); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class UnitTestingClusterTestEventEvent { public Integer arg1; public Integer arg2; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 740adecd59d598..f6c63ca6a40163 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -6309,107 +6309,834 @@ public String toString() { return output.toString(); } } +public static class ChannelClusterProgramCastStruct { + public String name; + public String role; + private static final long NAME_ID = 0L; + private static final long ROLE_ID = 1L; + + public ChannelClusterProgramCastStruct( + String name, + String role + ) { + this.name = name; + this.role = role; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(NAME_ID, new StringType(name))); + values.add(new StructElement(ROLE_ID, new StringType(role))); + + return new StructType(values); + } + + public static ChannelClusterProgramCastStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String name = null; + String role = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + name = castingValue.value(String.class); + } + } else if (element.contextTagNum() == ROLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + role = castingValue.value(String.class); + } + } + } + return new ChannelClusterProgramCastStruct( + name, + role + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ChannelClusterProgramCastStruct {\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("\trole: "); + output.append(role); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ChannelClusterProgramCategoryStruct { + public String category; + public Optional subCategory; + private static final long CATEGORY_ID = 0L; + private static final long SUB_CATEGORY_ID = 1L; + + public ChannelClusterProgramCategoryStruct( + String category, + Optional subCategory + ) { + this.category = category; + this.subCategory = subCategory; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CATEGORY_ID, new StringType(category))); + values.add(new StructElement(SUB_CATEGORY_ID, subCategory.map((nonOptionalsubCategory) -> new StringType(nonOptionalsubCategory)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static ChannelClusterProgramCategoryStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String category = null; + Optional subCategory = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CATEGORY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + category = castingValue.value(String.class); + } + } else if (element.contextTagNum() == SUB_CATEGORY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + subCategory = Optional.of(castingValue.value(String.class)); + } + } + } + return new ChannelClusterProgramCategoryStruct( + category, + subCategory + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ChannelClusterProgramCategoryStruct {\n"); + output.append("\tcategory: "); + output.append(category); + output.append("\n"); + output.append("\tsubCategory: "); + output.append(subCategory); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ChannelClusterSeriesInfoStruct { + public String season; + public String episode; + private static final long SEASON_ID = 0L; + private static final long EPISODE_ID = 1L; + + public ChannelClusterSeriesInfoStruct( + String season, + String episode + ) { + this.season = season; + this.episode = episode; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SEASON_ID, new StringType(season))); + values.add(new StructElement(EPISODE_ID, new StringType(episode))); + + return new StructType(values); + } + + public static ChannelClusterSeriesInfoStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String season = null; + String episode = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SEASON_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + season = castingValue.value(String.class); + } + } else if (element.contextTagNum() == EPISODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + episode = castingValue.value(String.class); + } + } + } + return new ChannelClusterSeriesInfoStruct( + season, + episode + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ChannelClusterSeriesInfoStruct {\n"); + output.append("\tseason: "); + output.append(season); + output.append("\n"); + output.append("\tepisode: "); + output.append(episode); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class ChannelClusterChannelInfoStruct { public Integer majorNumber; public Integer minorNumber; public Optional name; public Optional callSign; public Optional affiliateCallSign; + public Optional identifier; + public Optional type; private static final long MAJOR_NUMBER_ID = 0L; private static final long MINOR_NUMBER_ID = 1L; private static final long NAME_ID = 2L; private static final long CALL_SIGN_ID = 3L; private static final long AFFILIATE_CALL_SIGN_ID = 4L; + private static final long IDENTIFIER_ID = 5L; + private static final long TYPE_ID = 6L; + + public ChannelClusterChannelInfoStruct( + Integer majorNumber, + Integer minorNumber, + Optional name, + Optional callSign, + Optional affiliateCallSign, + Optional identifier, + Optional type + ) { + this.majorNumber = majorNumber; + this.minorNumber = minorNumber; + this.name = name; + this.callSign = callSign; + this.affiliateCallSign = affiliateCallSign; + this.identifier = identifier; + this.type = type; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(MAJOR_NUMBER_ID, new UIntType(majorNumber))); + values.add(new StructElement(MINOR_NUMBER_ID, new UIntType(minorNumber))); + values.add(new StructElement(NAME_ID, name.map((nonOptionalname) -> new StringType(nonOptionalname)).orElse(new EmptyType()))); + values.add(new StructElement(CALL_SIGN_ID, callSign.map((nonOptionalcallSign) -> new StringType(nonOptionalcallSign)).orElse(new EmptyType()))); + values.add(new StructElement(AFFILIATE_CALL_SIGN_ID, affiliateCallSign.map((nonOptionalaffiliateCallSign) -> new StringType(nonOptionalaffiliateCallSign)).orElse(new EmptyType()))); + values.add(new StructElement(IDENTIFIER_ID, identifier.map((nonOptionalidentifier) -> new StringType(nonOptionalidentifier)).orElse(new EmptyType()))); + values.add(new StructElement(TYPE_ID, type.map((nonOptionaltype) -> new UIntType(nonOptionaltype)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static ChannelClusterChannelInfoStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer majorNumber = null; + Integer minorNumber = null; + Optional name = Optional.empty(); + Optional callSign = Optional.empty(); + Optional affiliateCallSign = Optional.empty(); + Optional identifier = Optional.empty(); + Optional type = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == MAJOR_NUMBER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + majorNumber = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MINOR_NUMBER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minorNumber = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + name = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == CALL_SIGN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + callSign = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == AFFILIATE_CALL_SIGN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + affiliateCallSign = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == IDENTIFIER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + identifier = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + type = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new ChannelClusterChannelInfoStruct( + majorNumber, + minorNumber, + name, + callSign, + affiliateCallSign, + identifier, + type + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ChannelClusterChannelInfoStruct {\n"); + output.append("\tmajorNumber: "); + output.append(majorNumber); + output.append("\n"); + output.append("\tminorNumber: "); + output.append(minorNumber); + output.append("\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("\tcallSign: "); + output.append(callSign); + output.append("\n"); + output.append("\taffiliateCallSign: "); + output.append(affiliateCallSign); + output.append("\n"); + output.append("\tidentifier: "); + output.append(identifier); + output.append("\n"); + output.append("\ttype: "); + output.append(type); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ChannelClusterProgramStruct { + public String identifier; + public ChipStructs.ChannelClusterChannelInfoStruct channel; + public Long startTime; + public Long endTime; + public String title; + public Optional subtitle; + public Optional description; + public Optional> audioLanguages; + public Optional> ratings; + public Optional thumbnailUrl; + public Optional posterArtUrl; + public Optional dvbiUrl; + public Optional releaseDate; + public Optional parentalGuidanceText; + public Optional recordingFlag; + public @Nullable Optional seriesInfo; + public Optional> categoryList; + public Optional> castList; + public Optional> externalIDList; + private static final long IDENTIFIER_ID = 0L; + private static final long CHANNEL_ID = 1L; + private static final long START_TIME_ID = 2L; + private static final long END_TIME_ID = 3L; + private static final long TITLE_ID = 4L; + private static final long SUBTITLE_ID = 5L; + private static final long DESCRIPTION_ID = 6L; + private static final long AUDIO_LANGUAGES_ID = 7L; + private static final long RATINGS_ID = 8L; + private static final long THUMBNAIL_URL_ID = 9L; + private static final long POSTER_ART_URL_ID = 10L; + private static final long DVBI_URL_ID = 11L; + private static final long RELEASE_DATE_ID = 12L; + private static final long PARENTAL_GUIDANCE_TEXT_ID = 13L; + private static final long RECORDING_FLAG_ID = 14L; + private static final long SERIES_INFO_ID = 15L; + private static final long CATEGORY_LIST_ID = 16L; + private static final long CAST_LIST_ID = 17L; + private static final long EXTERNAL_I_D_LIST_ID = 18L; + + public ChannelClusterProgramStruct( + String identifier, + ChipStructs.ChannelClusterChannelInfoStruct channel, + Long startTime, + Long endTime, + String title, + Optional subtitle, + Optional description, + Optional> audioLanguages, + Optional> ratings, + Optional thumbnailUrl, + Optional posterArtUrl, + Optional dvbiUrl, + Optional releaseDate, + Optional parentalGuidanceText, + Optional recordingFlag, + @Nullable Optional seriesInfo, + Optional> categoryList, + Optional> castList, + Optional> externalIDList + ) { + this.identifier = identifier; + this.channel = channel; + this.startTime = startTime; + this.endTime = endTime; + this.title = title; + this.subtitle = subtitle; + this.description = description; + this.audioLanguages = audioLanguages; + this.ratings = ratings; + this.thumbnailUrl = thumbnailUrl; + this.posterArtUrl = posterArtUrl; + this.dvbiUrl = dvbiUrl; + this.releaseDate = releaseDate; + this.parentalGuidanceText = parentalGuidanceText; + this.recordingFlag = recordingFlag; + this.seriesInfo = seriesInfo; + this.categoryList = categoryList; + this.castList = castList; + this.externalIDList = externalIDList; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(IDENTIFIER_ID, new StringType(identifier))); + values.add(new StructElement(CHANNEL_ID, channel.encodeTlv())); + values.add(new StructElement(START_TIME_ID, new UIntType(startTime))); + values.add(new StructElement(END_TIME_ID, new UIntType(endTime))); + values.add(new StructElement(TITLE_ID, new StringType(title))); + values.add(new StructElement(SUBTITLE_ID, subtitle.map((nonOptionalsubtitle) -> new StringType(nonOptionalsubtitle)).orElse(new EmptyType()))); + values.add(new StructElement(DESCRIPTION_ID, description.map((nonOptionaldescription) -> new StringType(nonOptionaldescription)).orElse(new EmptyType()))); + values.add(new StructElement(AUDIO_LANGUAGES_ID, audioLanguages.map((nonOptionalaudioLanguages) -> ArrayType.generateArrayType(nonOptionalaudioLanguages, (elementnonOptionalaudioLanguages) -> new StringType(elementnonOptionalaudioLanguages))).orElse(new EmptyType()))); + values.add(new StructElement(RATINGS_ID, ratings.map((nonOptionalratings) -> ArrayType.generateArrayType(nonOptionalratings, (elementnonOptionalratings) -> new StringType(elementnonOptionalratings))).orElse(new EmptyType()))); + values.add(new StructElement(THUMBNAIL_URL_ID, thumbnailUrl.map((nonOptionalthumbnailUrl) -> new StringType(nonOptionalthumbnailUrl)).orElse(new EmptyType()))); + values.add(new StructElement(POSTER_ART_URL_ID, posterArtUrl.map((nonOptionalposterArtUrl) -> new StringType(nonOptionalposterArtUrl)).orElse(new EmptyType()))); + values.add(new StructElement(DVBI_URL_ID, dvbiUrl.map((nonOptionaldvbiUrl) -> new StringType(nonOptionaldvbiUrl)).orElse(new EmptyType()))); + values.add(new StructElement(RELEASE_DATE_ID, releaseDate.map((nonOptionalreleaseDate) -> new StringType(nonOptionalreleaseDate)).orElse(new EmptyType()))); + values.add(new StructElement(PARENTAL_GUIDANCE_TEXT_ID, parentalGuidanceText.map((nonOptionalparentalGuidanceText) -> new StringType(nonOptionalparentalGuidanceText)).orElse(new EmptyType()))); + values.add(new StructElement(RECORDING_FLAG_ID, recordingFlag.map((nonOptionalrecordingFlag) -> new UIntType(nonOptionalrecordingFlag)).orElse(new EmptyType()))); + values.add(new StructElement(SERIES_INFO_ID, seriesInfo != null ? seriesInfo.map((nonOptionalseriesInfo) -> nonOptionalseriesInfo.encodeTlv()).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(CATEGORY_LIST_ID, categoryList.map((nonOptionalcategoryList) -> ArrayType.generateArrayType(nonOptionalcategoryList, (elementnonOptionalcategoryList) -> elementnonOptionalcategoryList.encodeTlv())).orElse(new EmptyType()))); + values.add(new StructElement(CAST_LIST_ID, castList.map((nonOptionalcastList) -> ArrayType.generateArrayType(nonOptionalcastList, (elementnonOptionalcastList) -> elementnonOptionalcastList.encodeTlv())).orElse(new EmptyType()))); + values.add(new StructElement(EXTERNAL_I_D_LIST_ID, externalIDList.map((nonOptionalexternalIDList) -> ArrayType.generateArrayType(nonOptionalexternalIDList, (elementnonOptionalexternalIDList) -> elementnonOptionalexternalIDList.encodeTlv())).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static ChannelClusterProgramStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String identifier = null; + ChipStructs.ChannelClusterChannelInfoStruct channel = null; + Long startTime = null; + Long endTime = null; + String title = null; + Optional subtitle = Optional.empty(); + Optional description = Optional.empty(); + Optional> audioLanguages = Optional.empty(); + Optional> ratings = Optional.empty(); + Optional thumbnailUrl = Optional.empty(); + Optional posterArtUrl = Optional.empty(); + Optional dvbiUrl = Optional.empty(); + Optional releaseDate = Optional.empty(); + Optional parentalGuidanceText = Optional.empty(); + Optional recordingFlag = Optional.empty(); + @Nullable Optional seriesInfo = null; + Optional> categoryList = Optional.empty(); + Optional> castList = Optional.empty(); + Optional> externalIDList = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == IDENTIFIER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + identifier = castingValue.value(String.class); + } + } else if (element.contextTagNum() == CHANNEL_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + channel = ChipStructs.ChannelClusterChannelInfoStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == START_TIME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + startTime = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == END_TIME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + endTime = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == TITLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + title = castingValue.value(String.class); + } + } else if (element.contextTagNum() == SUBTITLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + subtitle = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == DESCRIPTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + description = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == AUDIO_LANGUAGES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + audioLanguages = Optional.of(castingValue.map((elementcastingValue) -> elementcastingValue.value(String.class))); + } + } else if (element.contextTagNum() == RATINGS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + ratings = Optional.of(castingValue.map((elementcastingValue) -> elementcastingValue.value(String.class))); + } + } else if (element.contextTagNum() == THUMBNAIL_URL_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + thumbnailUrl = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == POSTER_ART_URL_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + posterArtUrl = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == DVBI_URL_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + dvbiUrl = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == RELEASE_DATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + releaseDate = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == PARENTAL_GUIDANCE_TEXT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + parentalGuidanceText = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == RECORDING_FLAG_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + recordingFlag = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == SERIES_INFO_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + seriesInfo = Optional.of(ChipStructs.ChannelClusterSeriesInfoStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == CATEGORY_LIST_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + categoryList = Optional.of(castingValue.map((elementcastingValue) -> ChipStructs.ChannelClusterProgramCategoryStruct.decodeTlv(elementcastingValue))); + } + } else if (element.contextTagNum() == CAST_LIST_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + castList = Optional.of(castingValue.map((elementcastingValue) -> ChipStructs.ChannelClusterProgramCastStruct.decodeTlv(elementcastingValue))); + } + } else if (element.contextTagNum() == EXTERNAL_I_D_LIST_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + externalIDList = Optional.of(castingValue.map((elementcastingValue) -> ChipStructs.ChannelClusterProgramCastStruct.decodeTlv(elementcastingValue))); + } + } + } + return new ChannelClusterProgramStruct( + identifier, + channel, + startTime, + endTime, + title, + subtitle, + description, + audioLanguages, + ratings, + thumbnailUrl, + posterArtUrl, + dvbiUrl, + releaseDate, + parentalGuidanceText, + recordingFlag, + seriesInfo, + categoryList, + castList, + externalIDList + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ChannelClusterProgramStruct {\n"); + output.append("\tidentifier: "); + output.append(identifier); + output.append("\n"); + output.append("\tchannel: "); + output.append(channel); + output.append("\n"); + output.append("\tstartTime: "); + output.append(startTime); + output.append("\n"); + output.append("\tendTime: "); + output.append(endTime); + output.append("\n"); + output.append("\ttitle: "); + output.append(title); + output.append("\n"); + output.append("\tsubtitle: "); + output.append(subtitle); + output.append("\n"); + output.append("\tdescription: "); + output.append(description); + output.append("\n"); + output.append("\taudioLanguages: "); + output.append(audioLanguages); + output.append("\n"); + output.append("\tratings: "); + output.append(ratings); + output.append("\n"); + output.append("\tthumbnailUrl: "); + output.append(thumbnailUrl); + output.append("\n"); + output.append("\tposterArtUrl: "); + output.append(posterArtUrl); + output.append("\n"); + output.append("\tdvbiUrl: "); + output.append(dvbiUrl); + output.append("\n"); + output.append("\treleaseDate: "); + output.append(releaseDate); + output.append("\n"); + output.append("\tparentalGuidanceText: "); + output.append(parentalGuidanceText); + output.append("\n"); + output.append("\trecordingFlag: "); + output.append(recordingFlag); + output.append("\n"); + output.append("\tseriesInfo: "); + output.append(seriesInfo); + output.append("\n"); + output.append("\tcategoryList: "); + output.append(categoryList); + output.append("\n"); + output.append("\tcastList: "); + output.append(castList); + output.append("\n"); + output.append("\texternalIDList: "); + output.append(externalIDList); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ChannelClusterPageTokenStruct { + public Optional limit; + public Optional after; + public Optional before; + private static final long LIMIT_ID = 0L; + private static final long AFTER_ID = 1L; + private static final long BEFORE_ID = 2L; + + public ChannelClusterPageTokenStruct( + Optional limit, + Optional after, + Optional before + ) { + this.limit = limit; + this.after = after; + this.before = before; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(LIMIT_ID, limit.map((nonOptionallimit) -> new UIntType(nonOptionallimit)).orElse(new EmptyType()))); + values.add(new StructElement(AFTER_ID, after.map((nonOptionalafter) -> new StringType(nonOptionalafter)).orElse(new EmptyType()))); + values.add(new StructElement(BEFORE_ID, before.map((nonOptionalbefore) -> new StringType(nonOptionalbefore)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static ChannelClusterPageTokenStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional limit = Optional.empty(); + Optional after = Optional.empty(); + Optional before = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == LIMIT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + limit = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == AFTER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + after = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == BEFORE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + before = Optional.of(castingValue.value(String.class)); + } + } + } + return new ChannelClusterPageTokenStruct( + limit, + after, + before + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ChannelClusterPageTokenStruct {\n"); + output.append("\tlimit: "); + output.append(limit); + output.append("\n"); + output.append("\tafter: "); + output.append(after); + output.append("\n"); + output.append("\tbefore: "); + output.append(before); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ChannelClusterChannelPagingStruct { + public @Nullable Optional previousToken; + public @Nullable Optional nextToken; + private static final long PREVIOUS_TOKEN_ID = 0L; + private static final long NEXT_TOKEN_ID = 1L; + + public ChannelClusterChannelPagingStruct( + @Nullable Optional previousToken, + @Nullable Optional nextToken + ) { + this.previousToken = previousToken; + this.nextToken = nextToken; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PREVIOUS_TOKEN_ID, previousToken != null ? previousToken.map((nonOptionalpreviousToken) -> nonOptionalpreviousToken.encodeTlv()).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(NEXT_TOKEN_ID, nextToken != null ? nextToken.map((nonOptionalnextToken) -> nonOptionalnextToken.encodeTlv()).orElse(new EmptyType()) : new NullType())); + + return new StructType(values); + } + + public static ChannelClusterChannelPagingStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + @Nullable Optional previousToken = null; + @Nullable Optional nextToken = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PREVIOUS_TOKEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + previousToken = Optional.of(ChipStructs.ChannelClusterPageTokenStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == NEXT_TOKEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + nextToken = Optional.of(ChipStructs.ChannelClusterPageTokenStruct.decodeTlv(castingValue)); + } + } + } + return new ChannelClusterChannelPagingStruct( + previousToken, + nextToken + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ChannelClusterChannelPagingStruct {\n"); + output.append("\tpreviousToken: "); + output.append(previousToken); + output.append("\n"); + output.append("\tnextToken: "); + output.append(nextToken); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ChannelClusterAdditionalInfoStruct { + public String name; + public String value; + private static final long NAME_ID = 0L; + private static final long VALUE_ID = 1L; - public ChannelClusterChannelInfoStruct( - Integer majorNumber, - Integer minorNumber, - Optional name, - Optional callSign, - Optional affiliateCallSign + public ChannelClusterAdditionalInfoStruct( + String name, + String value ) { - this.majorNumber = majorNumber; - this.minorNumber = minorNumber; this.name = name; - this.callSign = callSign; - this.affiliateCallSign = affiliateCallSign; + this.value = value; } public StructType encodeTlv() { ArrayList values = new ArrayList<>(); - values.add(new StructElement(MAJOR_NUMBER_ID, new UIntType(majorNumber))); - values.add(new StructElement(MINOR_NUMBER_ID, new UIntType(minorNumber))); - values.add(new StructElement(NAME_ID, name.map((nonOptionalname) -> new StringType(nonOptionalname)).orElse(new EmptyType()))); - values.add(new StructElement(CALL_SIGN_ID, callSign.map((nonOptionalcallSign) -> new StringType(nonOptionalcallSign)).orElse(new EmptyType()))); - values.add(new StructElement(AFFILIATE_CALL_SIGN_ID, affiliateCallSign.map((nonOptionalaffiliateCallSign) -> new StringType(nonOptionalaffiliateCallSign)).orElse(new EmptyType()))); + values.add(new StructElement(NAME_ID, new StringType(name))); + values.add(new StructElement(VALUE_ID, new StringType(value))); return new StructType(values); } - public static ChannelClusterChannelInfoStruct decodeTlv(BaseTLVType tlvValue) { + public static ChannelClusterAdditionalInfoStruct decodeTlv(BaseTLVType tlvValue) { if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Integer majorNumber = null; - Integer minorNumber = null; - Optional name = Optional.empty(); - Optional callSign = Optional.empty(); - Optional affiliateCallSign = Optional.empty(); + String name = null; + String value = null; for (StructElement element: ((StructType)tlvValue).value()) { - if (element.contextTagNum() == MAJOR_NUMBER_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - majorNumber = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == MINOR_NUMBER_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - minorNumber = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == NAME_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.String) { - StringType castingValue = element.value(StringType.class); - name = Optional.of(castingValue.value(String.class)); - } - } else if (element.contextTagNum() == CALL_SIGN_ID) { + if (element.contextTagNum() == NAME_ID) { if (element.value(BaseTLVType.class).type() == TLVType.String) { StringType castingValue = element.value(StringType.class); - callSign = Optional.of(castingValue.value(String.class)); + name = castingValue.value(String.class); } - } else if (element.contextTagNum() == AFFILIATE_CALL_SIGN_ID) { + } else if (element.contextTagNum() == VALUE_ID) { if (element.value(BaseTLVType.class).type() == TLVType.String) { StringType castingValue = element.value(StringType.class); - affiliateCallSign = Optional.of(castingValue.value(String.class)); + value = castingValue.value(String.class); } } } - return new ChannelClusterChannelInfoStruct( - majorNumber, - minorNumber, + return new ChannelClusterAdditionalInfoStruct( name, - callSign, - affiliateCallSign + value ); } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("ChannelClusterChannelInfoStruct {\n"); - output.append("\tmajorNumber: "); - output.append(majorNumber); - output.append("\n"); - output.append("\tminorNumber: "); - output.append(minorNumber); - output.append("\n"); + output.append("ChannelClusterAdditionalInfoStruct {\n"); output.append("\tname: "); output.append(name); output.append("\n"); - output.append("\tcallSign: "); - output.append(callSign); - output.append("\n"); - output.append("\taffiliateCallSign: "); - output.append(affiliateCallSign); + output.append("\tvalue: "); + output.append(value); output.append("\n"); output.append("}\n"); return output.toString(); @@ -6567,6 +7294,128 @@ public String toString() { return output.toString(); } } +public static class MediaPlaybackClusterTrackAttributesStruct { + public String languageCode; + public @Nullable Optional displayName; + private static final long LANGUAGE_CODE_ID = 0L; + private static final long DISPLAY_NAME_ID = 1L; + + public MediaPlaybackClusterTrackAttributesStruct( + String languageCode, + @Nullable Optional displayName + ) { + this.languageCode = languageCode; + this.displayName = displayName; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(LANGUAGE_CODE_ID, new StringType(languageCode))); + values.add(new StructElement(DISPLAY_NAME_ID, displayName != null ? displayName.map((nonOptionaldisplayName) -> new StringType(nonOptionaldisplayName)).orElse(new EmptyType()) : new NullType())); + + return new StructType(values); + } + + public static MediaPlaybackClusterTrackAttributesStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String languageCode = null; + @Nullable Optional displayName = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == LANGUAGE_CODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + languageCode = castingValue.value(String.class); + } + } else if (element.contextTagNum() == DISPLAY_NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + displayName = Optional.of(castingValue.value(String.class)); + } + } + } + return new MediaPlaybackClusterTrackAttributesStruct( + languageCode, + displayName + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("MediaPlaybackClusterTrackAttributesStruct {\n"); + output.append("\tlanguageCode: "); + output.append(languageCode); + output.append("\n"); + output.append("\tdisplayName: "); + output.append(displayName); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class MediaPlaybackClusterTrackStruct { + public String id; + public @Nullable ChipStructs.MediaPlaybackClusterTrackAttributesStruct trackAttributes; + private static final long ID_ID = 0L; + private static final long TRACK_ATTRIBUTES_ID = 1L; + + public MediaPlaybackClusterTrackStruct( + String id, + @Nullable ChipStructs.MediaPlaybackClusterTrackAttributesStruct trackAttributes + ) { + this.id = id; + this.trackAttributes = trackAttributes; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ID_ID, new StringType(id))); + values.add(new StructElement(TRACK_ATTRIBUTES_ID, trackAttributes != null ? trackAttributes.encodeTlv() : new NullType())); + + return new StructType(values); + } + + public static MediaPlaybackClusterTrackStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String id = null; + @Nullable ChipStructs.MediaPlaybackClusterTrackAttributesStruct trackAttributes = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + id = castingValue.value(String.class); + } + } else if (element.contextTagNum() == TRACK_ATTRIBUTES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + trackAttributes = ChipStructs.MediaPlaybackClusterTrackAttributesStruct.decodeTlv(castingValue); + } + } + } + return new MediaPlaybackClusterTrackStruct( + id, + trackAttributes + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("MediaPlaybackClusterTrackStruct {\n"); + output.append("\tid: "); + output.append(id); + output.append("\n"); + output.append("\ttrackAttributes: "); + output.append(trackAttributes); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class MediaPlaybackClusterPlaybackPositionStruct { public Long updatedAt; public @Nullable Long position; @@ -6795,6 +7644,158 @@ public String toString() { return output.toString(); } } +public static class ContentLauncherClusterTrackPreferenceStruct { + public String languageCode; + public Optional> characteristics; + public Integer audioOutputIndex; + private static final long LANGUAGE_CODE_ID = 0L; + private static final long CHARACTERISTICS_ID = 1L; + private static final long AUDIO_OUTPUT_INDEX_ID = 2L; + + public ContentLauncherClusterTrackPreferenceStruct( + String languageCode, + Optional> characteristics, + Integer audioOutputIndex + ) { + this.languageCode = languageCode; + this.characteristics = characteristics; + this.audioOutputIndex = audioOutputIndex; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(LANGUAGE_CODE_ID, new StringType(languageCode))); + values.add(new StructElement(CHARACTERISTICS_ID, characteristics.map((nonOptionalcharacteristics) -> ArrayType.generateArrayType(nonOptionalcharacteristics, (elementnonOptionalcharacteristics) -> new UIntType(elementnonOptionalcharacteristics))).orElse(new EmptyType()))); + values.add(new StructElement(AUDIO_OUTPUT_INDEX_ID, new UIntType(audioOutputIndex))); + + return new StructType(values); + } + + public static ContentLauncherClusterTrackPreferenceStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String languageCode = null; + Optional> characteristics = Optional.empty(); + Integer audioOutputIndex = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == LANGUAGE_CODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + languageCode = castingValue.value(String.class); + } + } else if (element.contextTagNum() == CHARACTERISTICS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + characteristics = Optional.of(castingValue.map((elementcastingValue) -> elementcastingValue.value(Integer.class))); + } + } else if (element.contextTagNum() == AUDIO_OUTPUT_INDEX_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioOutputIndex = castingValue.value(Integer.class); + } + } + } + return new ContentLauncherClusterTrackPreferenceStruct( + languageCode, + characteristics, + audioOutputIndex + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ContentLauncherClusterTrackPreferenceStruct {\n"); + output.append("\tlanguageCode: "); + output.append(languageCode); + output.append("\n"); + output.append("\tcharacteristics: "); + output.append(characteristics); + output.append("\n"); + output.append("\taudioOutputIndex: "); + output.append(audioOutputIndex); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ContentLauncherClusterPlaybackPreferencesStruct { + public Long playbackPosition; + public ChipStructs.ContentLauncherClusterTrackPreferenceStruct textTrack; + public Optional> audioTracks; + private static final long PLAYBACK_POSITION_ID = 0L; + private static final long TEXT_TRACK_ID = 1L; + private static final long AUDIO_TRACKS_ID = 2L; + + public ContentLauncherClusterPlaybackPreferencesStruct( + Long playbackPosition, + ChipStructs.ContentLauncherClusterTrackPreferenceStruct textTrack, + Optional> audioTracks + ) { + this.playbackPosition = playbackPosition; + this.textTrack = textTrack; + this.audioTracks = audioTracks; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PLAYBACK_POSITION_ID, new UIntType(playbackPosition))); + values.add(new StructElement(TEXT_TRACK_ID, textTrack.encodeTlv())); + values.add(new StructElement(AUDIO_TRACKS_ID, audioTracks.map((nonOptionalaudioTracks) -> ArrayType.generateArrayType(nonOptionalaudioTracks, (elementnonOptionalaudioTracks) -> elementnonOptionalaudioTracks.encodeTlv())).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static ContentLauncherClusterPlaybackPreferencesStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Long playbackPosition = null; + ChipStructs.ContentLauncherClusterTrackPreferenceStruct textTrack = null; + Optional> audioTracks = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PLAYBACK_POSITION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + playbackPosition = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == TEXT_TRACK_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + textTrack = ChipStructs.ContentLauncherClusterTrackPreferenceStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == AUDIO_TRACKS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + audioTracks = Optional.of(castingValue.map((elementcastingValue) -> ChipStructs.ContentLauncherClusterTrackPreferenceStruct.decodeTlv(elementcastingValue))); + } + } + } + return new ContentLauncherClusterPlaybackPreferencesStruct( + playbackPosition, + textTrack, + audioTracks + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ContentLauncherClusterPlaybackPreferencesStruct {\n"); + output.append("\tplaybackPosition: "); + output.append(playbackPosition); + output.append("\n"); + output.append("\ttextTrack: "); + output.append(textTrack); + output.append("\n"); + output.append("\taudioTracks: "); + output.append(audioTracks); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class ContentLauncherClusterAdditionalInfoStruct { public String name; public String value; @@ -7434,6 +8435,67 @@ public String toString() { return output.toString(); } } +public static class ContentControlClusterRatingNameStruct { + public String ratingName; + public Optional ratingNameDesc; + private static final long RATING_NAME_ID = 0L; + private static final long RATING_NAME_DESC_ID = 1L; + + public ContentControlClusterRatingNameStruct( + String ratingName, + Optional ratingNameDesc + ) { + this.ratingName = ratingName; + this.ratingNameDesc = ratingNameDesc; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(RATING_NAME_ID, new StringType(ratingName))); + values.add(new StructElement(RATING_NAME_DESC_ID, ratingNameDesc.map((nonOptionalratingNameDesc) -> new StringType(nonOptionalratingNameDesc)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static ContentControlClusterRatingNameStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String ratingName = null; + Optional ratingNameDesc = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == RATING_NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + ratingName = castingValue.value(String.class); + } + } else if (element.contextTagNum() == RATING_NAME_DESC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + ratingNameDesc = Optional.of(castingValue.value(String.class)); + } + } + } + return new ContentControlClusterRatingNameStruct( + ratingName, + ratingNameDesc + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ContentControlClusterRatingNameStruct {\n"); + output.append("\tratingName: "); + output.append(ratingName); + output.append("\n"); + output.append("\tratingNameDesc: "); + output.append(ratingNameDesc); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class UnitTestingClusterSimpleStruct { public Integer a; public Boolean b; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 5a089cd25528ba..44485374612055 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -340,6 +340,12 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == AccountLogin.ID) { return new AccountLogin(); } + if (clusterId == ContentControl.ID) { + return new ContentControl(); + } + if (clusterId == ContentAppObserver.ID) { + return new ContentAppObserver(); + } if (clusterId == ElectricalMeasurement.ID) { return new ElectricalMeasurement(); } @@ -13319,7 +13325,10 @@ public static Event value(long id) throws NoSuchFieldError { public enum Command { ChangeChannel(0L), ChangeChannelByNumber(2L), - SkipChannel(3L),; + SkipChannel(3L), + GetProgramGuide(4L), + RecordProgram(6L), + CancelRecordProgram(7L),; private final long id; Command(long id) { this.id = id; @@ -13388,6 +13397,57 @@ public static SkipChannelCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } + }public enum GetProgramGuideCommandField {StartTime(0),EndTime(1),ChannelList(2),PageToken(3),RecordingFlag(4),ExternalIDList(5),Data(6),; + private final int id; + GetProgramGuideCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static GetProgramGuideCommandField value(int id) throws NoSuchFieldError { + for (GetProgramGuideCommandField field : GetProgramGuideCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum RecordProgramCommandField {ProgramIdentifier(0),ShouldRecordSeries(1),ExternalIDList(2),Data(3),; + private final int id; + RecordProgramCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static RecordProgramCommandField value(int id) throws NoSuchFieldError { + for (RecordProgramCommandField field : RecordProgramCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum CancelRecordProgramCommandField {ProgramIdentifier(0),ShouldRecordSeries(1),ExternalIDList(2),Data(3),; + private final int id; + CancelRecordProgramCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static CancelRecordProgramCommandField value(int id) throws NoSuchFieldError { + for (CancelRecordProgramCommandField field : CancelRecordProgramCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -13452,7 +13512,8 @@ public static Attribute value(long id) throws NoSuchFieldError { } } - public enum Event {; + public enum Event { + TargetUpdated(0L),; private final long id; Event(long id) { this.id = id; @@ -13552,6 +13613,10 @@ public enum Attribute { PlaybackSpeed(4L), SeekRangeEnd(5L), SeekRangeStart(6L), + ActiveAudioTrack(7L), + AvailableAudioTracks(8L), + ActiveTextTrack(9L), + AvailableTextTracks(10L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -13577,7 +13642,8 @@ public static Attribute value(long id) throws NoSuchFieldError { } } - public enum Event {; + public enum Event { + StateChanged(0L),; private final long id; Event(long id) { this.id = id; @@ -13608,7 +13674,10 @@ public enum Command { FastForward(7L), SkipForward(8L), SkipBackward(9L), - Seek(11L),; + Seek(11L), + ActivateAudioTrack(12L), + ActivateTextTrack(13L), + DeactivateTextTrack(14L),; private final long id; Command(long id) { this.id = id; @@ -13626,7 +13695,41 @@ public static Command value(long id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum SkipForwardCommandField {DeltaPositionMilliseconds(0),; + }public enum RewindCommandField {AudioAdvanceUnmuted(0),; + private final int id; + RewindCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static RewindCommandField value(int id) throws NoSuchFieldError { + for (RewindCommandField field : RewindCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum FastForwardCommandField {AudioAdvanceUnmuted(0),; + private final int id; + FastForwardCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static FastForwardCommandField value(int id) throws NoSuchFieldError { + for (FastForwardCommandField field : FastForwardCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SkipForwardCommandField {DeltaPositionMilliseconds(0),; private final int id; SkipForwardCommandField(int id) { this.id = id; @@ -13677,6 +13780,40 @@ public static SeekCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } + }public enum ActivateAudioTrackCommandField {TrackID(0),AudioOutputIndex(1),; + private final int id; + ActivateAudioTrackCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ActivateAudioTrackCommandField value(int id) throws NoSuchFieldError { + for (ActivateAudioTrackCommandField field : ActivateAudioTrackCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum ActivateTextTrackCommandField {TrackID(0),; + private final int id; + ActivateTextTrackCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ActivateTextTrackCommandField value(int id) throws NoSuchFieldError { + for (ActivateTextTrackCommandField field : ActivateTextTrackCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -14140,7 +14277,7 @@ public static Command value(long id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum LaunchContentCommandField {Search(0),AutoPlay(1),Data(2),; + }public enum LaunchContentCommandField {Search(0),AutoPlay(1),Data(2),PlaybackPreferences(3),UseCurrentContext(4),; private final int id; LaunchContentCommandField(int id) { this.id = id; @@ -14638,7 +14775,8 @@ public static Attribute value(long id) throws NoSuchFieldError { } } - public enum Event {; + public enum Event { + LoggedOut(0L),; private final long id; Event(long id) { this.id = id; @@ -14696,7 +14834,7 @@ public static GetSetupPINCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum LoginCommandField {TempAccountIdentifier(0),SetupPIN(1),; + }public enum LoginCommandField {TempAccountIdentifier(0),SetupPIN(1),Node(2),; private final int id; LoginCommandField(int id) { this.id = id; @@ -14713,6 +14851,345 @@ public static LoginCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } + }public enum LogoutCommandField {Node(0),; + private final int id; + LogoutCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static LogoutCommandField value(int id) throws NoSuchFieldError { + for (LogoutCommandField field : LogoutCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } + public static class ContentControl implements BaseCluster { + public static final long ID = 1295L; + public long getID() { + return ID; + } + + public enum Attribute { + Enabled(0L), + OnDemandRatings(1L), + OnDemandRatingThreshold(2L), + ScheduledContentRatings(3L), + ScheduledContentRatingThreshold(4L), + ScreenDailyTime(5L), + RemainingScreenTime(6L), + BlockUnrated(7L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event { + RemainingScreenTimeExpired(0L),; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + UpdatePIN(0L), + ResetPIN(1L), + Enable(3L), + Disable(4L), + AddBonusTime(5L), + SetScreenDailyTime(6L), + BlockUnratedContent(7L), + UnblockUnratedContent(8L), + SetOnDemandRatingThreshold(9L), + SetScheduledContentRatingThreshold(10L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum UpdatePINCommandField {OldPIN(0),NewPIN(1),; + private final int id; + UpdatePINCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static UpdatePINCommandField value(int id) throws NoSuchFieldError { + for (UpdatePINCommandField field : UpdatePINCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum AddBonusTimeCommandField {PINCode(0),BonusTime(1),; + private final int id; + AddBonusTimeCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static AddBonusTimeCommandField value(int id) throws NoSuchFieldError { + for (AddBonusTimeCommandField field : AddBonusTimeCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetScreenDailyTimeCommandField {ScreenTime(0),; + private final int id; + SetScreenDailyTimeCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetScreenDailyTimeCommandField value(int id) throws NoSuchFieldError { + for (SetScreenDailyTimeCommandField field : SetScreenDailyTimeCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetOnDemandRatingThresholdCommandField {Rating(0),; + private final int id; + SetOnDemandRatingThresholdCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetOnDemandRatingThresholdCommandField value(int id) throws NoSuchFieldError { + for (SetOnDemandRatingThresholdCommandField field : SetOnDemandRatingThresholdCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetScheduledContentRatingThresholdCommandField {Rating(0),; + private final int id; + SetScheduledContentRatingThresholdCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetScheduledContentRatingThresholdCommandField value(int id) throws NoSuchFieldError { + for (SetScheduledContentRatingThresholdCommandField field : SetScheduledContentRatingThresholdCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } + public static class ContentAppObserver implements BaseCluster { + public static final long ID = 1296L; + public long getID() { + return ID; + } + + public enum Attribute { + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + ContentAppMessage(0L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum ContentAppMessageCommandField {Data(0),EncodingHint(1),; + private final int id; + ContentAppMessageCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ContentAppMessageCommandField value(int id) throws NoSuchFieldError { + for (ContentAppMessageCommandField field : ContentAppMessageCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index b54bf0d5ffa116..eb4616451405ab 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -15592,6 +15592,31 @@ public void onError(Exception error) { callback.onFailure(error); } } + + public static class DelegatedChannelClusterProgramGuideResponseCallback implements ChipClusters.ChannelCluster.ProgramGuideResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer channelPagingStruct, ArrayList programList) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo channelPagingStructResponseValue = new CommandResponseInfo("channelPagingStruct", "Integer"); + responseValues.put(channelPagingStructResponseValue, channelPagingStruct); + // programList: ProgramStruct + // Conversion from this type to Java is not properly implemented yet + + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } public static class DelegatedChannelClusterChannelListAttributeCallback implements ChipClusters.ChannelCluster.ChannelListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -15997,6 +16022,90 @@ public void onError(Exception ex) { } } + public static class DelegatedMediaPlaybackClusterActiveAudioTrackAttributeCallback implements ChipClusters.MediaPlaybackCluster.ActiveAudioTrackAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.MediaPlaybackClusterTrackStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.MediaPlaybackClusterTrackStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMediaPlaybackClusterAvailableAudioTracksAttributeCallback implements ChipClusters.MediaPlaybackCluster.AvailableAudioTracksAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMediaPlaybackClusterActiveTextTrackAttributeCallback implements ChipClusters.MediaPlaybackCluster.ActiveTextTrackAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.MediaPlaybackClusterTrackStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.MediaPlaybackClusterTrackStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedMediaPlaybackClusterAvailableTextTracksAttributeCallback implements ChipClusters.MediaPlaybackCluster.AvailableTextTracksAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedMediaPlaybackClusterGeneratedCommandListAttributeCallback implements ChipClusters.MediaPlaybackCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -16992,6 +17101,264 @@ public void onError(Exception ex) { } } + + public static class DelegatedContentControlClusterResetPINResponseCallback implements ChipClusters.ContentControlCluster.ResetPINResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(String PINCode) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo PINCodeResponseValue = new CommandResponseInfo("PINCode", "String"); + responseValues.put(PINCodeResponseValue, PINCode); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + public static class DelegatedContentControlClusterOnDemandRatingsAttributeCallback implements ChipClusters.ContentControlCluster.OnDemandRatingsAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedContentControlClusterScheduledContentRatingsAttributeCallback implements ChipClusters.ContentControlCluster.ScheduledContentRatingsAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedContentControlClusterGeneratedCommandListAttributeCallback implements ChipClusters.ContentControlCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedContentControlClusterAcceptedCommandListAttributeCallback implements ChipClusters.ContentControlCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedContentControlClusterEventListAttributeCallback implements ChipClusters.ContentControlCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedContentControlClusterAttributeListAttributeCallback implements ChipClusters.ContentControlCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + + public static class DelegatedContentAppObserverClusterContentAppMessageResponseCallback implements ChipClusters.ContentAppObserverCluster.ContentAppMessageResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Optional status, String data, String encodingHint) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "Optional"); + responseValues.put(statusResponseValue, status); + CommandResponseInfo dataResponseValue = new CommandResponseInfo("data", "String"); + responseValues.put(dataResponseValue, data); + CommandResponseInfo encodingHintResponseValue = new CommandResponseInfo("encodingHint", "String"); + responseValues.put(encodingHintResponseValue, encodingHint); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + public static class DelegatedContentAppObserverClusterGeneratedCommandListAttributeCallback implements ChipClusters.ContentAppObserverCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedContentAppObserverClusterAcceptedCommandListAttributeCallback implements ChipClusters.ContentAppObserverCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedContentAppObserverClusterEventListAttributeCallback implements ChipClusters.ContentAppObserverCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedContentAppObserverClusterAttributeListAttributeCallback implements ChipClusters.ContentAppObserverCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedElectricalMeasurementClusterGeneratedCommandListAttributeCallback implements ChipClusters.ElectricalMeasurementCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -18965,6 +19332,14 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.AccountLoginCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("accountLogin", accountLoginClusterInfo); + ClusterInfo contentControlClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ContentControlCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("contentControl", contentControlClusterInfo); + + ClusterInfo contentAppObserverClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ContentAppObserverCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("contentAppObserver", contentAppObserverClusterInfo); + ClusterInfo electricalMeasurementClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.ElectricalMeasurementCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("electricalMeasurement", electricalMeasurementClusterInfo); @@ -19089,6 +19464,8 @@ public void combineCommand(Map destination, Map> getCommandMap() { ); channelClusterInteractionInfoMap.put("skipChannel", channelskipChannelInteractionInfo); + Map channelgetProgramGuideCommandParams = new LinkedHashMap(); + + CommandParameterInfo channelgetProgramGuidestartTimeCommandParameterInfo = new CommandParameterInfo("startTime", Optional.class, Long.class); + channelgetProgramGuideCommandParams.put("startTime",channelgetProgramGuidestartTimeCommandParameterInfo); + + CommandParameterInfo channelgetProgramGuideendTimeCommandParameterInfo = new CommandParameterInfo("endTime", Optional.class, Long.class); + channelgetProgramGuideCommandParams.put("endTime",channelgetProgramGuideendTimeCommandParameterInfo); + + + + CommandParameterInfo channelgetProgramGuiderecordingFlagCommandParameterInfo = new CommandParameterInfo("recordingFlag", Optional.class, Long.class); + channelgetProgramGuideCommandParams.put("recordingFlag",channelgetProgramGuiderecordingFlagCommandParameterInfo); + + + CommandParameterInfo channelgetProgramGuidedataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, byte[].class); + channelgetProgramGuideCommandParams.put("data",channelgetProgramGuidedataCommandParameterInfo); + InteractionInfo channelgetProgramGuideInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .getProgramGuide((ChipClusters.ChannelCluster.ProgramGuideResponseCallback) callback + , (Optional) + commandArguments.get("startTime") + + , (Optional) + commandArguments.get("endTime") + + , (Optional>) + commandArguments.get("channelList") + + , (Optional) + commandArguments.get("pageToken") + + , (Optional) + commandArguments.get("recordingFlag") + + , (Optional>) + commandArguments.get("externalIDList") + + , (Optional) + commandArguments.get("data") + + ); + }, + () -> new DelegatedChannelClusterProgramGuideResponseCallback(), + channelgetProgramGuideCommandParams + ); + channelClusterInteractionInfoMap.put("getProgramGuide", channelgetProgramGuideInteractionInfo); + + Map channelrecordProgramCommandParams = new LinkedHashMap(); + + CommandParameterInfo channelrecordProgramprogramIdentifierCommandParameterInfo = new CommandParameterInfo("programIdentifier", String.class, String.class); + channelrecordProgramCommandParams.put("programIdentifier",channelrecordProgramprogramIdentifierCommandParameterInfo); + + CommandParameterInfo channelrecordProgramshouldRecordSeriesCommandParameterInfo = new CommandParameterInfo("shouldRecordSeries", Boolean.class, Boolean.class); + channelrecordProgramCommandParams.put("shouldRecordSeries",channelrecordProgramshouldRecordSeriesCommandParameterInfo); + + + CommandParameterInfo channelrecordProgramdataCommandParameterInfo = new CommandParameterInfo("data", byte[].class, byte[].class); + channelrecordProgramCommandParams.put("data",channelrecordProgramdataCommandParameterInfo); + InteractionInfo channelrecordProgramInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .recordProgram((DefaultClusterCallback) callback + , (String) + commandArguments.get("programIdentifier") + , (Boolean) + commandArguments.get("shouldRecordSeries") + , (ArrayList) + commandArguments.get("externalIDList") + , (byte[]) + commandArguments.get("data") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + channelrecordProgramCommandParams + ); + channelClusterInteractionInfoMap.put("recordProgram", channelrecordProgramInteractionInfo); + + Map channelcancelRecordProgramCommandParams = new LinkedHashMap(); + + CommandParameterInfo channelcancelRecordProgramprogramIdentifierCommandParameterInfo = new CommandParameterInfo("programIdentifier", String.class, String.class); + channelcancelRecordProgramCommandParams.put("programIdentifier",channelcancelRecordProgramprogramIdentifierCommandParameterInfo); + + CommandParameterInfo channelcancelRecordProgramshouldRecordSeriesCommandParameterInfo = new CommandParameterInfo("shouldRecordSeries", Boolean.class, Boolean.class); + channelcancelRecordProgramCommandParams.put("shouldRecordSeries",channelcancelRecordProgramshouldRecordSeriesCommandParameterInfo); + + + CommandParameterInfo channelcancelRecordProgramdataCommandParameterInfo = new CommandParameterInfo("data", byte[].class, byte[].class); + channelcancelRecordProgramCommandParams.put("data",channelcancelRecordProgramdataCommandParameterInfo); + InteractionInfo channelcancelRecordProgramInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .cancelRecordProgram((DefaultClusterCallback) callback + , (String) + commandArguments.get("programIdentifier") + , (Boolean) + commandArguments.get("shouldRecordSeries") + , (ArrayList) + commandArguments.get("externalIDList") + , (byte[]) + commandArguments.get("data") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + channelcancelRecordProgramCommandParams + ); + channelClusterInteractionInfoMap.put("cancelRecordProgram", channelcancelRecordProgramInteractionInfo); + commandMap.put("channel", channelClusterInteractionInfoMap); Map targetNavigatorClusterInteractionInfoMap = new LinkedHashMap<>(); @@ -23855,10 +24340,16 @@ public Map> getCommandMap() { mediaPlaybackClusterInteractionInfoMap.put("next", mediaPlaybacknextInteractionInfo); Map mediaPlaybackrewindCommandParams = new LinkedHashMap(); + + CommandParameterInfo mediaPlaybackrewindaudioAdvanceUnmutedCommandParameterInfo = new CommandParameterInfo("audioAdvanceUnmuted", Optional.class, Boolean.class); + mediaPlaybackrewindCommandParams.put("audioAdvanceUnmuted",mediaPlaybackrewindaudioAdvanceUnmutedCommandParameterInfo); InteractionInfo mediaPlaybackrewindInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .rewind((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + , (Optional) + commandArguments.get("audioAdvanceUnmuted") + ); }, () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), @@ -23867,10 +24358,16 @@ public Map> getCommandMap() { mediaPlaybackClusterInteractionInfoMap.put("rewind", mediaPlaybackrewindInteractionInfo); Map mediaPlaybackfastForwardCommandParams = new LinkedHashMap(); + + CommandParameterInfo mediaPlaybackfastForwardaudioAdvanceUnmutedCommandParameterInfo = new CommandParameterInfo("audioAdvanceUnmuted", Optional.class, Boolean.class); + mediaPlaybackfastForwardCommandParams.put("audioAdvanceUnmuted",mediaPlaybackfastForwardaudioAdvanceUnmutedCommandParameterInfo); InteractionInfo mediaPlaybackfastForwardInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) .fastForward((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + , (Optional) + commandArguments.get("audioAdvanceUnmuted") + ); }, () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), @@ -23932,6 +24429,57 @@ public Map> getCommandMap() { ); mediaPlaybackClusterInteractionInfoMap.put("seek", mediaPlaybackseekInteractionInfo); + Map mediaPlaybackactivateAudioTrackCommandParams = new LinkedHashMap(); + + CommandParameterInfo mediaPlaybackactivateAudioTracktrackIDCommandParameterInfo = new CommandParameterInfo("trackID", String.class, String.class); + mediaPlaybackactivateAudioTrackCommandParams.put("trackID",mediaPlaybackactivateAudioTracktrackIDCommandParameterInfo); + + CommandParameterInfo mediaPlaybackactivateAudioTrackaudioOutputIndexCommandParameterInfo = new CommandParameterInfo("audioOutputIndex", Integer.class, Integer.class); + mediaPlaybackactivateAudioTrackCommandParams.put("audioOutputIndex",mediaPlaybackactivateAudioTrackaudioOutputIndexCommandParameterInfo); + InteractionInfo mediaPlaybackactivateAudioTrackInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .activateAudioTrack((DefaultClusterCallback) callback + , (String) + commandArguments.get("trackID") + , (Integer) + commandArguments.get("audioOutputIndex") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + mediaPlaybackactivateAudioTrackCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("activateAudioTrack", mediaPlaybackactivateAudioTrackInteractionInfo); + + Map mediaPlaybackactivateTextTrackCommandParams = new LinkedHashMap(); + + CommandParameterInfo mediaPlaybackactivateTextTracktrackIDCommandParameterInfo = new CommandParameterInfo("trackID", String.class, String.class); + mediaPlaybackactivateTextTrackCommandParams.put("trackID",mediaPlaybackactivateTextTracktrackIDCommandParameterInfo); + InteractionInfo mediaPlaybackactivateTextTrackInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .activateTextTrack((DefaultClusterCallback) callback + , (String) + commandArguments.get("trackID") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + mediaPlaybackactivateTextTrackCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("activateTextTrack", mediaPlaybackactivateTextTrackInteractionInfo); + + Map mediaPlaybackdeactivateTextTrackCommandParams = new LinkedHashMap(); + InteractionInfo mediaPlaybackdeactivateTextTrackInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .deactivateTextTrack((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + mediaPlaybackdeactivateTextTrackCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("deactivateTextTrack", mediaPlaybackdeactivateTextTrackInteractionInfo); + commandMap.put("mediaPlayback", mediaPlaybackClusterInteractionInfoMap); Map mediaInputClusterInteractionInfoMap = new LinkedHashMap<>(); @@ -24049,6 +24597,10 @@ public Map> getCommandMap() { CommandParameterInfo contentLauncherlaunchContentdataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, String.class); contentLauncherlaunchContentCommandParams.put("data",contentLauncherlaunchContentdataCommandParameterInfo); + + + CommandParameterInfo contentLauncherlaunchContentuseCurrentContextCommandParameterInfo = new CommandParameterInfo("useCurrentContext", Optional.class, Boolean.class); + contentLauncherlaunchContentCommandParams.put("useCurrentContext",contentLauncherlaunchContentuseCurrentContextCommandParameterInfo); InteractionInfo contentLauncherlaunchContentInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ContentLauncherCluster) cluster) @@ -24062,6 +24614,12 @@ public Map> getCommandMap() { , (Optional) commandArguments.get("data") + , (Optional) + commandArguments.get("playbackPreferences") + + , (Optional) + commandArguments.get("useCurrentContext") + ); }, () -> new DelegatedContentLauncherClusterLauncherResponseCallback(), @@ -24231,6 +24789,9 @@ public Map> getCommandMap() { CommandParameterInfo accountLoginloginsetupPINCommandParameterInfo = new CommandParameterInfo("setupPIN", String.class, String.class); accountLoginloginCommandParams.put("setupPIN",accountLoginloginsetupPINCommandParameterInfo); + + CommandParameterInfo accountLoginloginnodeCommandParameterInfo = new CommandParameterInfo("node", Optional.class, Long.class); + accountLoginloginCommandParams.put("node",accountLoginloginnodeCommandParameterInfo); InteractionInfo accountLoginloginInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AccountLoginCluster) cluster) @@ -24238,7 +24799,9 @@ public Map> getCommandMap() { , (String) commandArguments.get("tempAccountIdentifier") , (String) - commandArguments.get("setupPIN"), 10000 + commandArguments.get("setupPIN") + , (Optional) + commandArguments.get("node"), 10000 ); }, () -> new DelegatedDefaultClusterCallback(), @@ -24247,10 +24810,15 @@ public Map> getCommandMap() { accountLoginClusterInteractionInfoMap.put("login", accountLoginloginInteractionInfo); Map accountLoginlogoutCommandParams = new LinkedHashMap(); + + CommandParameterInfo accountLoginlogoutnodeCommandParameterInfo = new CommandParameterInfo("node", Optional.class, Long.class); + accountLoginlogoutCommandParams.put("node",accountLoginlogoutnodeCommandParameterInfo); InteractionInfo accountLoginlogoutInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AccountLoginCluster) cluster) - .logout((DefaultClusterCallback) callback, 10000 + .logout((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("node"), 10000 ); }, () -> new DelegatedDefaultClusterCallback(), @@ -24260,6 +24828,193 @@ public Map> getCommandMap() { commandMap.put("accountLogin", accountLoginClusterInteractionInfoMap); + Map contentControlClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map contentControlupdatePINCommandParams = new LinkedHashMap(); + + CommandParameterInfo contentControlupdatePINoldPINCommandParameterInfo = new CommandParameterInfo("oldPIN", Optional.class, String.class); + contentControlupdatePINCommandParams.put("oldPIN",contentControlupdatePINoldPINCommandParameterInfo); + + CommandParameterInfo contentControlupdatePINnewPINCommandParameterInfo = new CommandParameterInfo("newPIN", String.class, String.class); + contentControlupdatePINCommandParams.put("newPIN",contentControlupdatePINnewPINCommandParameterInfo); + InteractionInfo contentControlupdatePINInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .updatePIN((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("oldPIN") + , (String) + commandArguments.get("newPIN") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControlupdatePINCommandParams + ); + contentControlClusterInteractionInfoMap.put("updatePIN", contentControlupdatePINInteractionInfo); + + Map contentControlresetPINCommandParams = new LinkedHashMap(); + InteractionInfo contentControlresetPINInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .resetPIN((ChipClusters.ContentControlCluster.ResetPINResponseCallback) callback + ); + }, + () -> new DelegatedContentControlClusterResetPINResponseCallback(), + contentControlresetPINCommandParams + ); + contentControlClusterInteractionInfoMap.put("resetPIN", contentControlresetPINInteractionInfo); + + Map contentControlenableCommandParams = new LinkedHashMap(); + InteractionInfo contentControlenableInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .enable((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControlenableCommandParams + ); + contentControlClusterInteractionInfoMap.put("enable", contentControlenableInteractionInfo); + + Map contentControldisableCommandParams = new LinkedHashMap(); + InteractionInfo contentControldisableInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .disable((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControldisableCommandParams + ); + contentControlClusterInteractionInfoMap.put("disable", contentControldisableInteractionInfo); + + Map contentControladdBonusTimeCommandParams = new LinkedHashMap(); + + CommandParameterInfo contentControladdBonusTimePINCodeCommandParameterInfo = new CommandParameterInfo("PINCode", Optional.class, String.class); + contentControladdBonusTimeCommandParams.put("PINCode",contentControladdBonusTimePINCodeCommandParameterInfo); + + CommandParameterInfo contentControladdBonusTimebonusTimeCommandParameterInfo = new CommandParameterInfo("bonusTime", Optional.class, Long.class); + contentControladdBonusTimeCommandParams.put("bonusTime",contentControladdBonusTimebonusTimeCommandParameterInfo); + InteractionInfo contentControladdBonusTimeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .addBonusTime((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("PINCode") + , (Optional) + commandArguments.get("bonusTime") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControladdBonusTimeCommandParams + ); + contentControlClusterInteractionInfoMap.put("addBonusTime", contentControladdBonusTimeInteractionInfo); + + Map contentControlsetScreenDailyTimeCommandParams = new LinkedHashMap(); + + CommandParameterInfo contentControlsetScreenDailyTimescreenTimeCommandParameterInfo = new CommandParameterInfo("screenTime", Long.class, Long.class); + contentControlsetScreenDailyTimeCommandParams.put("screenTime",contentControlsetScreenDailyTimescreenTimeCommandParameterInfo); + InteractionInfo contentControlsetScreenDailyTimeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .setScreenDailyTime((DefaultClusterCallback) callback + , (Long) + commandArguments.get("screenTime") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControlsetScreenDailyTimeCommandParams + ); + contentControlClusterInteractionInfoMap.put("setScreenDailyTime", contentControlsetScreenDailyTimeInteractionInfo); + + Map contentControlblockUnratedContentCommandParams = new LinkedHashMap(); + InteractionInfo contentControlblockUnratedContentInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .blockUnratedContent((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControlblockUnratedContentCommandParams + ); + contentControlClusterInteractionInfoMap.put("blockUnratedContent", contentControlblockUnratedContentInteractionInfo); + + Map contentControlunblockUnratedContentCommandParams = new LinkedHashMap(); + InteractionInfo contentControlunblockUnratedContentInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .unblockUnratedContent((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControlunblockUnratedContentCommandParams + ); + contentControlClusterInteractionInfoMap.put("unblockUnratedContent", contentControlunblockUnratedContentInteractionInfo); + + Map contentControlsetOnDemandRatingThresholdCommandParams = new LinkedHashMap(); + + CommandParameterInfo contentControlsetOnDemandRatingThresholdratingCommandParameterInfo = new CommandParameterInfo("rating", String.class, String.class); + contentControlsetOnDemandRatingThresholdCommandParams.put("rating",contentControlsetOnDemandRatingThresholdratingCommandParameterInfo); + InteractionInfo contentControlsetOnDemandRatingThresholdInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .setOnDemandRatingThreshold((DefaultClusterCallback) callback + , (String) + commandArguments.get("rating") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControlsetOnDemandRatingThresholdCommandParams + ); + contentControlClusterInteractionInfoMap.put("setOnDemandRatingThreshold", contentControlsetOnDemandRatingThresholdInteractionInfo); + + Map contentControlsetScheduledContentRatingThresholdCommandParams = new LinkedHashMap(); + + CommandParameterInfo contentControlsetScheduledContentRatingThresholdratingCommandParameterInfo = new CommandParameterInfo("rating", String.class, String.class); + contentControlsetScheduledContentRatingThresholdCommandParams.put("rating",contentControlsetScheduledContentRatingThresholdratingCommandParameterInfo); + InteractionInfo contentControlsetScheduledContentRatingThresholdInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .setScheduledContentRatingThreshold((DefaultClusterCallback) callback + , (String) + commandArguments.get("rating") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControlsetScheduledContentRatingThresholdCommandParams + ); + contentControlClusterInteractionInfoMap.put("setScheduledContentRatingThreshold", contentControlsetScheduledContentRatingThresholdInteractionInfo); + + commandMap.put("contentControl", contentControlClusterInteractionInfoMap); + + Map contentAppObserverClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map contentAppObservercontentAppMessageCommandParams = new LinkedHashMap(); + + CommandParameterInfo contentAppObservercontentAppMessagedataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, String.class); + contentAppObservercontentAppMessageCommandParams.put("data",contentAppObservercontentAppMessagedataCommandParameterInfo); + + CommandParameterInfo contentAppObservercontentAppMessageencodingHintCommandParameterInfo = new CommandParameterInfo("encodingHint", String.class, String.class); + contentAppObservercontentAppMessageCommandParams.put("encodingHint",contentAppObservercontentAppMessageencodingHintCommandParameterInfo); + InteractionInfo contentAppObservercontentAppMessageInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentAppObserverCluster) cluster) + .contentAppMessage((ChipClusters.ContentAppObserverCluster.ContentAppMessageResponseCallback) callback + , (Optional) + commandArguments.get("data") + + , (String) + commandArguments.get("encodingHint") + + ); + }, + () -> new DelegatedContentAppObserverClusterContentAppMessageResponseCallback(), + contentAppObservercontentAppMessageCommandParams + ); + contentAppObserverClusterInteractionInfoMap.put("contentAppMessage", contentAppObservercontentAppMessageInteractionInfo); + + commandMap.put("contentAppObserver", contentAppObserverClusterInteractionInfoMap); + Map electricalMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); Map electricalMeasurementgetProfileInfoCommandCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 3397f9966c0920..1cdbced7a386ac 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -15575,6 +15575,28 @@ private static Map readMediaPlaybackInteractionInfo() { readMediaPlaybackSeekRangeStartCommandParams ); result.put("readSeekRangeStartAttribute", readMediaPlaybackSeekRangeStartAttributeInteractionInfo); + Map readMediaPlaybackAvailableAudioTracksCommandParams = new LinkedHashMap(); + InteractionInfo readMediaPlaybackAvailableAudioTracksAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster).readAvailableAudioTracksAttribute( + (ChipClusters.MediaPlaybackCluster.AvailableAudioTracksAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMediaPlaybackClusterAvailableAudioTracksAttributeCallback(), + readMediaPlaybackAvailableAudioTracksCommandParams + ); + result.put("readAvailableAudioTracksAttribute", readMediaPlaybackAvailableAudioTracksAttributeInteractionInfo); + Map readMediaPlaybackAvailableTextTracksCommandParams = new LinkedHashMap(); + InteractionInfo readMediaPlaybackAvailableTextTracksAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster).readAvailableTextTracksAttribute( + (ChipClusters.MediaPlaybackCluster.AvailableTextTracksAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMediaPlaybackClusterAvailableTextTracksAttributeCallback(), + readMediaPlaybackAvailableTextTracksCommandParams + ); + result.put("readAvailableTextTracksAttribute", readMediaPlaybackAvailableTextTracksAttributeInteractionInfo); Map readMediaPlaybackGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readMediaPlaybackGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { @@ -16358,6 +16380,234 @@ private static Map readAccountLoginInteractionInfo() { return result; } + private static Map readContentControlInteractionInfo() { + Map result = new LinkedHashMap<>();Map readContentControlEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readContentControlEnabledCommandParams + ); + result.put("readEnabledAttribute", readContentControlEnabledAttributeInteractionInfo); + Map readContentControlOnDemandRatingsCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlOnDemandRatingsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readOnDemandRatingsAttribute( + (ChipClusters.ContentControlCluster.OnDemandRatingsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedContentControlClusterOnDemandRatingsAttributeCallback(), + readContentControlOnDemandRatingsCommandParams + ); + result.put("readOnDemandRatingsAttribute", readContentControlOnDemandRatingsAttributeInteractionInfo); + Map readContentControlOnDemandRatingThresholdCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlOnDemandRatingThresholdAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readOnDemandRatingThresholdAttribute( + (ChipClusters.CharStringAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readContentControlOnDemandRatingThresholdCommandParams + ); + result.put("readOnDemandRatingThresholdAttribute", readContentControlOnDemandRatingThresholdAttributeInteractionInfo); + Map readContentControlScheduledContentRatingsCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlScheduledContentRatingsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readScheduledContentRatingsAttribute( + (ChipClusters.ContentControlCluster.ScheduledContentRatingsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedContentControlClusterScheduledContentRatingsAttributeCallback(), + readContentControlScheduledContentRatingsCommandParams + ); + result.put("readScheduledContentRatingsAttribute", readContentControlScheduledContentRatingsAttributeInteractionInfo); + Map readContentControlScheduledContentRatingThresholdCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlScheduledContentRatingThresholdAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readScheduledContentRatingThresholdAttribute( + (ChipClusters.CharStringAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readContentControlScheduledContentRatingThresholdCommandParams + ); + result.put("readScheduledContentRatingThresholdAttribute", readContentControlScheduledContentRatingThresholdAttributeInteractionInfo); + Map readContentControlScreenDailyTimeCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlScreenDailyTimeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readScreenDailyTimeAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readContentControlScreenDailyTimeCommandParams + ); + result.put("readScreenDailyTimeAttribute", readContentControlScreenDailyTimeAttributeInteractionInfo); + Map readContentControlRemainingScreenTimeCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlRemainingScreenTimeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readRemainingScreenTimeAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readContentControlRemainingScreenTimeCommandParams + ); + result.put("readRemainingScreenTimeAttribute", readContentControlRemainingScreenTimeAttributeInteractionInfo); + Map readContentControlBlockUnratedCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlBlockUnratedAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readBlockUnratedAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readContentControlBlockUnratedCommandParams + ); + result.put("readBlockUnratedAttribute", readContentControlBlockUnratedAttributeInteractionInfo); + Map readContentControlGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.ContentControlCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedContentControlClusterGeneratedCommandListAttributeCallback(), + readContentControlGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readContentControlGeneratedCommandListAttributeInteractionInfo); + Map readContentControlAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.ContentControlCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedContentControlClusterAcceptedCommandListAttributeCallback(), + readContentControlAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readContentControlAcceptedCommandListAttributeInteractionInfo); + Map readContentControlEventListCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readEventListAttribute( + (ChipClusters.ContentControlCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedContentControlClusterEventListAttributeCallback(), + readContentControlEventListCommandParams + ); + result.put("readEventListAttribute", readContentControlEventListAttributeInteractionInfo); + Map readContentControlAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readAttributeListAttribute( + (ChipClusters.ContentControlCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedContentControlClusterAttributeListAttributeCallback(), + readContentControlAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readContentControlAttributeListAttributeInteractionInfo); + Map readContentControlFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readContentControlFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readContentControlFeatureMapAttributeInteractionInfo); + Map readContentControlClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readContentControlClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readContentControlClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readContentControlClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readContentAppObserverInteractionInfo() { + Map result = new LinkedHashMap<>();Map readContentAppObserverGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readContentAppObserverGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentAppObserverCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.ContentAppObserverCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedContentAppObserverClusterGeneratedCommandListAttributeCallback(), + readContentAppObserverGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readContentAppObserverGeneratedCommandListAttributeInteractionInfo); + Map readContentAppObserverAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readContentAppObserverAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentAppObserverCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.ContentAppObserverCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedContentAppObserverClusterAcceptedCommandListAttributeCallback(), + readContentAppObserverAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readContentAppObserverAcceptedCommandListAttributeInteractionInfo); + Map readContentAppObserverEventListCommandParams = new LinkedHashMap(); + InteractionInfo readContentAppObserverEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentAppObserverCluster) cluster).readEventListAttribute( + (ChipClusters.ContentAppObserverCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedContentAppObserverClusterEventListAttributeCallback(), + readContentAppObserverEventListCommandParams + ); + result.put("readEventListAttribute", readContentAppObserverEventListAttributeInteractionInfo); + Map readContentAppObserverAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readContentAppObserverAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentAppObserverCluster) cluster).readAttributeListAttribute( + (ChipClusters.ContentAppObserverCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedContentAppObserverClusterAttributeListAttributeCallback(), + readContentAppObserverAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readContentAppObserverAttributeListAttributeInteractionInfo); + Map readContentAppObserverFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readContentAppObserverFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentAppObserverCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readContentAppObserverFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readContentAppObserverFeatureMapAttributeInteractionInfo); + Map readContentAppObserverClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readContentAppObserverClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentAppObserverCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readContentAppObserverClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readContentAppObserverClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readElectricalMeasurementInteractionInfo() { Map result = new LinkedHashMap<>();Map readElectricalMeasurementMeasurementTypeCommandParams = new LinkedHashMap(); InteractionInfo readElectricalMeasurementMeasurementTypeAttributeInteractionInfo = new InteractionInfo( @@ -19045,6 +19295,8 @@ public Map> getReadAttributeMap() { put("applicationLauncher", readApplicationLauncherInteractionInfo()); put("applicationBasic", readApplicationBasicInteractionInfo()); put("accountLogin", readAccountLoginInteractionInfo()); + put("contentControl", readContentControlInteractionInfo()); + put("contentAppObserver", readContentAppObserverInteractionInfo()); put("electricalMeasurement", readElectricalMeasurementInteractionInfo()); put("unitTesting", readUnitTestingInteractionInfo()); put("faultInjection", readFaultInjectionInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 03a11848b3a2f5..2fffad1f36f24b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3600,6 +3600,10 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("applicationBasic", writeApplicationBasicInteractionInfo); Map writeAccountLoginInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("accountLogin", writeAccountLoginInteractionInfo); + Map writeContentControlInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("contentControl", writeContentControlInteractionInfo); + Map writeContentAppObserverInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("contentAppObserver", writeContentAppObserverInteractionInfo); Map writeElectricalMeasurementInteractionInfo = new LinkedHashMap<>(); Map writeElectricalMeasurementAverageRmsVoltageMeasurementPeriodCommandParams = new LinkedHashMap(); CommandParameterInfo electricalMeasurementaverageRmsVoltageMeasurementPeriodCommandParameterInfo = diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccountLoginClusterLoggedOutEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccountLoginClusterLoggedOutEvent.kt new file mode 100644 index 00000000000000..5c1bf98d9c4f79 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccountLoginClusterLoggedOutEvent.kt @@ -0,0 +1,61 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class AccountLoginClusterLoggedOutEvent(val node: Optional) { + override fun toString(): String = buildString { + append("AccountLoginClusterLoggedOutEvent {\n") + append("\tnode : $node\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (node.isPresent) { + val optnode = node.get() + put(ContextSpecificTag(TAG_NODE), optnode) + } + endStructure() + } + } + + companion object { + private const val TAG_NODE = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): AccountLoginClusterLoggedOutEvent { + tlvReader.enterStructure(tlvTag) + val node = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NODE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_NODE))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return AccountLoginClusterLoggedOutEvent(node) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/MediaPlaybackClusterStateChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/MediaPlaybackClusterStateChangedEvent.kt new file mode 100644 index 00000000000000..8626f9daed4e01 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/MediaPlaybackClusterStateChangedEvent.kt @@ -0,0 +1,118 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class MediaPlaybackClusterStateChangedEvent( + val currentState: UInt, + val startTime: ULong, + val duration: ULong, + val sampledPosition: + chip.devicecontroller.cluster.structs.MediaPlaybackClusterPlaybackPositionStruct, + val playbackSpeed: Float, + val seekRangeEnd: ULong, + val seekRangeStart: ULong, + val data: Optional, + val audioAdvanceUnmuted: Boolean +) { + override fun toString(): String = buildString { + append("MediaPlaybackClusterStateChangedEvent {\n") + append("\tcurrentState : $currentState\n") + append("\tstartTime : $startTime\n") + append("\tduration : $duration\n") + append("\tsampledPosition : $sampledPosition\n") + append("\tplaybackSpeed : $playbackSpeed\n") + append("\tseekRangeEnd : $seekRangeEnd\n") + append("\tseekRangeStart : $seekRangeStart\n") + append("\tdata : $data\n") + append("\taudioAdvanceUnmuted : $audioAdvanceUnmuted\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CURRENT_STATE), currentState) + put(ContextSpecificTag(TAG_START_TIME), startTime) + put(ContextSpecificTag(TAG_DURATION), duration) + sampledPosition.toTlv(ContextSpecificTag(TAG_SAMPLED_POSITION), this) + put(ContextSpecificTag(TAG_PLAYBACK_SPEED), playbackSpeed) + put(ContextSpecificTag(TAG_SEEK_RANGE_END), seekRangeEnd) + put(ContextSpecificTag(TAG_SEEK_RANGE_START), seekRangeStart) + if (data.isPresent) { + val optdata = data.get() + put(ContextSpecificTag(TAG_DATA), optdata) + } + put(ContextSpecificTag(TAG_AUDIO_ADVANCE_UNMUTED), audioAdvanceUnmuted) + endStructure() + } + } + + companion object { + private const val TAG_CURRENT_STATE = 0 + private const val TAG_START_TIME = 1 + private const val TAG_DURATION = 2 + private const val TAG_SAMPLED_POSITION = 3 + private const val TAG_PLAYBACK_SPEED = 4 + private const val TAG_SEEK_RANGE_END = 5 + private const val TAG_SEEK_RANGE_START = 6 + private const val TAG_DATA = 7 + private const val TAG_AUDIO_ADVANCE_UNMUTED = 8 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MediaPlaybackClusterStateChangedEvent { + tlvReader.enterStructure(tlvTag) + val currentState = tlvReader.getUInt(ContextSpecificTag(TAG_CURRENT_STATE)) + val startTime = tlvReader.getULong(ContextSpecificTag(TAG_START_TIME)) + val duration = tlvReader.getULong(ContextSpecificTag(TAG_DURATION)) + val sampledPosition = + chip.devicecontroller.cluster.structs.MediaPlaybackClusterPlaybackPositionStruct.fromTlv( + ContextSpecificTag(TAG_SAMPLED_POSITION), + tlvReader + ) + val playbackSpeed = tlvReader.getFloat(ContextSpecificTag(TAG_PLAYBACK_SPEED)) + val seekRangeEnd = tlvReader.getULong(ContextSpecificTag(TAG_SEEK_RANGE_END)) + val seekRangeStart = tlvReader.getULong(ContextSpecificTag(TAG_SEEK_RANGE_START)) + val data = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DATA))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_DATA))) + } else { + Optional.empty() + } + val audioAdvanceUnmuted = tlvReader.getBoolean(ContextSpecificTag(TAG_AUDIO_ADVANCE_UNMUTED)) + + tlvReader.exitContainer() + + return MediaPlaybackClusterStateChangedEvent( + currentState, + startTime, + duration, + sampledPosition, + playbackSpeed, + seekRangeEnd, + seekRangeStart, + data, + audioAdvanceUnmuted + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt new file mode 100644 index 00000000000000..ce5bbb1df841c9 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt @@ -0,0 +1,82 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class TargetNavigatorClusterTargetUpdatedEvent( + val targetList: + List, + val currentTarget: UInt, + val data: ByteArray +) { + override fun toString(): String = buildString { + append("TargetNavigatorClusterTargetUpdatedEvent {\n") + append("\ttargetList : $targetList\n") + append("\tcurrentTarget : $currentTarget\n") + append("\tdata : $data\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_TARGET_LIST)) + for (item in targetList.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + put(ContextSpecificTag(TAG_CURRENT_TARGET), currentTarget) + put(ContextSpecificTag(TAG_DATA), data) + endStructure() + } + } + + companion object { + private const val TAG_TARGET_LIST = 0 + private const val TAG_CURRENT_TARGET = 1 + private const val TAG_DATA = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): TargetNavigatorClusterTargetUpdatedEvent { + tlvReader.enterStructure(tlvTag) + val targetList = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_TARGET_LIST)) + while (!tlvReader.isEndOfContainer()) { + this.add( + chip.devicecontroller.cluster.structs.TargetNavigatorClusterTargetInfoStruct.fromTlv( + AnonymousTag, + tlvReader + ) + ) + } + tlvReader.exitContainer() + } + val currentTarget = tlvReader.getUInt(ContextSpecificTag(TAG_CURRENT_TARGET)) + val data = tlvReader.getByteArray(ContextSpecificTag(TAG_DATA)) + + tlvReader.exitContainer() + + return TargetNavigatorClusterTargetUpdatedEvent(targetList, currentTarget, data) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 18552f76458513..3f6beda67231e4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -16,14 +16,24 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterLineupInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterPageTokenStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCastStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterContentSearchStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterDimensionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterParameterStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterPlaybackPreferencesStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterStyleInformationStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterTrackPreferenceStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DemandResponseLoadControlClusterAverageLoadControlStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DemandResponseLoadControlClusterDutyCycleControlStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DemandResponseLoadControlClusterHeatingSourceControlStruct.kt", @@ -50,6 +60,8 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackAttributesStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt", @@ -104,6 +116,7 @@ structs_sources = [ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlEntryChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlExtensionChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccountLoginClusterLoggedOutEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterActionFailedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterStateChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterLeaveEvent.kt", @@ -130,6 +143,7 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterRadioFaultChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/MediaPlaybackClusterStateChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationalErrorEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationCompletionEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterDownloadErrorEvent.kt", @@ -156,6 +170,7 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressOngoingEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt new file mode 100644 index 00000000000000..082ea9c5debbbc --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterAdditionalInfoStruct(val name: String, val value: String) { + override fun toString(): String = buildString { + append("ChannelClusterAdditionalInfoStruct {\n") + append("\tname : $name\n") + append("\tvalue : $value\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_NAME), name) + put(ContextSpecificTag(TAG_VALUE), value) + endStructure() + } + } + + companion object { + private const val TAG_NAME = 0 + private const val TAG_VALUE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterAdditionalInfoStruct { + tlvReader.enterStructure(tlvTag) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val value = tlvReader.getString(ContextSpecificTag(TAG_VALUE)) + + tlvReader.exitContainer() + + return ChannelClusterAdditionalInfoStruct(name, value) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt index f8ca194e2e444e..deb76c4fb0791c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt @@ -28,7 +28,9 @@ class ChannelClusterChannelInfoStruct( val minorNumber: UInt, val name: Optional, val callSign: Optional, - val affiliateCallSign: Optional + val affiliateCallSign: Optional, + val identifier: Optional, + val type: Optional ) { override fun toString(): String = buildString { append("ChannelClusterChannelInfoStruct {\n") @@ -37,6 +39,8 @@ class ChannelClusterChannelInfoStruct( append("\tname : $name\n") append("\tcallSign : $callSign\n") append("\taffiliateCallSign : $affiliateCallSign\n") + append("\tidentifier : $identifier\n") + append("\ttype : $type\n") append("}\n") } @@ -57,6 +61,14 @@ class ChannelClusterChannelInfoStruct( val optaffiliateCallSign = affiliateCallSign.get() put(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN), optaffiliateCallSign) } + if (identifier.isPresent) { + val optidentifier = identifier.get() + put(ContextSpecificTag(TAG_IDENTIFIER), optidentifier) + } + if (type.isPresent) { + val opttype = type.get() + put(ContextSpecificTag(TAG_TYPE), opttype) + } endStructure() } } @@ -67,6 +79,8 @@ class ChannelClusterChannelInfoStruct( private const val TAG_NAME = 2 private const val TAG_CALL_SIGN = 3 private const val TAG_AFFILIATE_CALL_SIGN = 4 + private const val TAG_IDENTIFIER = 5 + private const val TAG_TYPE = 6 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterChannelInfoStruct { tlvReader.enterStructure(tlvTag) @@ -90,6 +104,18 @@ class ChannelClusterChannelInfoStruct( } else { Optional.empty() } + val identifier = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_IDENTIFIER))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_IDENTIFIER))) + } else { + Optional.empty() + } + val type = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TYPE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_TYPE))) + } else { + Optional.empty() + } tlvReader.exitContainer() @@ -98,7 +124,9 @@ class ChannelClusterChannelInfoStruct( minorNumber, name, callSign, - affiliateCallSign + affiliateCallSign, + identifier, + type ) } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt new file mode 100644 index 00000000000000..64b035d2b02583 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt @@ -0,0 +1,101 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterChannelPagingStruct( + val previousToken: Optional?, + val nextToken: Optional? +) { + override fun toString(): String = buildString { + append("ChannelClusterChannelPagingStruct {\n") + append("\tpreviousToken : $previousToken\n") + append("\tnextToken : $nextToken\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousToken != null) { + if (previousToken.isPresent) { + val optpreviousToken = previousToken.get() + optpreviousToken.toTlv(ContextSpecificTag(TAG_PREVIOUS_TOKEN), this) + } + } else { + putNull(ContextSpecificTag(TAG_PREVIOUS_TOKEN)) + } + if (nextToken != null) { + if (nextToken.isPresent) { + val optnextToken = nextToken.get() + optnextToken.toTlv(ContextSpecificTag(TAG_NEXT_TOKEN), this) + } + } else { + putNull(ContextSpecificTag(TAG_NEXT_TOKEN)) + } + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_TOKEN = 0 + private const val TAG_NEXT_TOKEN = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterChannelPagingStruct { + tlvReader.enterStructure(tlvTag) + val previousToken = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_TOKEN))) { + Optional.of( + ChannelClusterPageTokenStruct.fromTlv( + ContextSpecificTag(TAG_PREVIOUS_TOKEN), + tlvReader + ) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PREVIOUS_TOKEN)) + null + } + val nextToken = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NEXT_TOKEN))) { + Optional.of( + ChannelClusterPageTokenStruct.fromTlv(ContextSpecificTag(TAG_NEXT_TOKEN), tlvReader) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NEXT_TOKEN)) + null + } + + tlvReader.exitContainer() + + return ChannelClusterChannelPagingStruct(previousToken, nextToken) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterPageTokenStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterPageTokenStruct.kt new file mode 100644 index 00000000000000..18e92f157a24d4 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterPageTokenStruct.kt @@ -0,0 +1,89 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterPageTokenStruct( + val limit: Optional, + val after: Optional, + val before: Optional +) { + override fun toString(): String = buildString { + append("ChannelClusterPageTokenStruct {\n") + append("\tlimit : $limit\n") + append("\tafter : $after\n") + append("\tbefore : $before\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (limit.isPresent) { + val optlimit = limit.get() + put(ContextSpecificTag(TAG_LIMIT), optlimit) + } + if (after.isPresent) { + val optafter = after.get() + put(ContextSpecificTag(TAG_AFTER), optafter) + } + if (before.isPresent) { + val optbefore = before.get() + put(ContextSpecificTag(TAG_BEFORE), optbefore) + } + endStructure() + } + } + + companion object { + private const val TAG_LIMIT = 0 + private const val TAG_AFTER = 1 + private const val TAG_BEFORE = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterPageTokenStruct { + tlvReader.enterStructure(tlvTag) + val limit = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_LIMIT))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_LIMIT))) + } else { + Optional.empty() + } + val after = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AFTER))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_AFTER))) + } else { + Optional.empty() + } + val before = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BEFORE))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_BEFORE))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ChannelClusterPageTokenStruct(limit, after, before) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCastStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCastStruct.kt new file mode 100644 index 00000000000000..b11edabf62f0b0 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCastStruct.kt @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterProgramCastStruct(val name: String, val role: String) { + override fun toString(): String = buildString { + append("ChannelClusterProgramCastStruct {\n") + append("\tname : $name\n") + append("\trole : $role\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_NAME), name) + put(ContextSpecificTag(TAG_ROLE), role) + endStructure() + } + } + + companion object { + private const val TAG_NAME = 0 + private const val TAG_ROLE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterProgramCastStruct { + tlvReader.enterStructure(tlvTag) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val role = tlvReader.getString(ContextSpecificTag(TAG_ROLE)) + + tlvReader.exitContainer() + + return ChannelClusterProgramCastStruct(name, role) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt new file mode 100644 index 00000000000000..d22742f8be42c5 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt @@ -0,0 +1,65 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterProgramCategoryStruct(val category: String, val subCategory: Optional) { + override fun toString(): String = buildString { + append("ChannelClusterProgramCategoryStruct {\n") + append("\tcategory : $category\n") + append("\tsubCategory : $subCategory\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CATEGORY), category) + if (subCategory.isPresent) { + val optsubCategory = subCategory.get() + put(ContextSpecificTag(TAG_SUB_CATEGORY), optsubCategory) + } + endStructure() + } + } + + companion object { + private const val TAG_CATEGORY = 0 + private const val TAG_SUB_CATEGORY = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterProgramCategoryStruct { + tlvReader.enterStructure(tlvTag) + val category = tlvReader.getString(ContextSpecificTag(TAG_CATEGORY)) + val subCategory = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SUB_CATEGORY))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_SUB_CATEGORY))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ChannelClusterProgramCategoryStruct(category, subCategory) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt new file mode 100644 index 00000000000000..5f5a7e48d1b8dc --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt @@ -0,0 +1,350 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterProgramStruct( + val identifier: String, + val channel: ChannelClusterChannelInfoStruct, + val startTime: ULong, + val endTime: ULong, + val title: String, + val subtitle: Optional, + val description: Optional, + val audioLanguages: Optional>, + val ratings: Optional>, + val thumbnailUrl: Optional, + val posterArtUrl: Optional, + val dvbiUrl: Optional, + val releaseDate: Optional, + val parentalGuidanceText: Optional, + val recordingFlag: Optional, + val seriesInfo: Optional?, + val categoryList: Optional>, + val castList: Optional>, + val externalIDList: Optional> +) { + override fun toString(): String = buildString { + append("ChannelClusterProgramStruct {\n") + append("\tidentifier : $identifier\n") + append("\tchannel : $channel\n") + append("\tstartTime : $startTime\n") + append("\tendTime : $endTime\n") + append("\ttitle : $title\n") + append("\tsubtitle : $subtitle\n") + append("\tdescription : $description\n") + append("\taudioLanguages : $audioLanguages\n") + append("\tratings : $ratings\n") + append("\tthumbnailUrl : $thumbnailUrl\n") + append("\tposterArtUrl : $posterArtUrl\n") + append("\tdvbiUrl : $dvbiUrl\n") + append("\treleaseDate : $releaseDate\n") + append("\tparentalGuidanceText : $parentalGuidanceText\n") + append("\trecordingFlag : $recordingFlag\n") + append("\tseriesInfo : $seriesInfo\n") + append("\tcategoryList : $categoryList\n") + append("\tcastList : $castList\n") + append("\texternalIDList : $externalIDList\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_IDENTIFIER), identifier) + channel.toTlv(ContextSpecificTag(TAG_CHANNEL), this) + put(ContextSpecificTag(TAG_START_TIME), startTime) + put(ContextSpecificTag(TAG_END_TIME), endTime) + put(ContextSpecificTag(TAG_TITLE), title) + if (subtitle.isPresent) { + val optsubtitle = subtitle.get() + put(ContextSpecificTag(TAG_SUBTITLE), optsubtitle) + } + if (description.isPresent) { + val optdescription = description.get() + put(ContextSpecificTag(TAG_DESCRIPTION), optdescription) + } + if (audioLanguages.isPresent) { + val optaudioLanguages = audioLanguages.get() + startArray(ContextSpecificTag(TAG_AUDIO_LANGUAGES)) + for (item in optaudioLanguages.iterator()) { + put(AnonymousTag, item) + } + endArray() + } + if (ratings.isPresent) { + val optratings = ratings.get() + startArray(ContextSpecificTag(TAG_RATINGS)) + for (item in optratings.iterator()) { + put(AnonymousTag, item) + } + endArray() + } + if (thumbnailUrl.isPresent) { + val optthumbnailUrl = thumbnailUrl.get() + put(ContextSpecificTag(TAG_THUMBNAIL_URL), optthumbnailUrl) + } + if (posterArtUrl.isPresent) { + val optposterArtUrl = posterArtUrl.get() + put(ContextSpecificTag(TAG_POSTER_ART_URL), optposterArtUrl) + } + if (dvbiUrl.isPresent) { + val optdvbiUrl = dvbiUrl.get() + put(ContextSpecificTag(TAG_DVBI_URL), optdvbiUrl) + } + if (releaseDate.isPresent) { + val optreleaseDate = releaseDate.get() + put(ContextSpecificTag(TAG_RELEASE_DATE), optreleaseDate) + } + if (parentalGuidanceText.isPresent) { + val optparentalGuidanceText = parentalGuidanceText.get() + put(ContextSpecificTag(TAG_PARENTAL_GUIDANCE_TEXT), optparentalGuidanceText) + } + if (recordingFlag.isPresent) { + val optrecordingFlag = recordingFlag.get() + put(ContextSpecificTag(TAG_RECORDING_FLAG), optrecordingFlag) + } + if (seriesInfo != null) { + if (seriesInfo.isPresent) { + val optseriesInfo = seriesInfo.get() + optseriesInfo.toTlv(ContextSpecificTag(TAG_SERIES_INFO), this) + } + } else { + putNull(ContextSpecificTag(TAG_SERIES_INFO)) + } + if (categoryList.isPresent) { + val optcategoryList = categoryList.get() + startArray(ContextSpecificTag(TAG_CATEGORY_LIST)) + for (item in optcategoryList.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } + if (castList.isPresent) { + val optcastList = castList.get() + startArray(ContextSpecificTag(TAG_CAST_LIST)) + for (item in optcastList.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } + if (externalIDList.isPresent) { + val optexternalIDList = externalIDList.get() + startArray(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) + for (item in optexternalIDList.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } + endStructure() + } + } + + companion object { + private const val TAG_IDENTIFIER = 0 + private const val TAG_CHANNEL = 1 + private const val TAG_START_TIME = 2 + private const val TAG_END_TIME = 3 + private const val TAG_TITLE = 4 + private const val TAG_SUBTITLE = 5 + private const val TAG_DESCRIPTION = 6 + private const val TAG_AUDIO_LANGUAGES = 7 + private const val TAG_RATINGS = 8 + private const val TAG_THUMBNAIL_URL = 9 + private const val TAG_POSTER_ART_URL = 10 + private const val TAG_DVBI_URL = 11 + private const val TAG_RELEASE_DATE = 12 + private const val TAG_PARENTAL_GUIDANCE_TEXT = 13 + private const val TAG_RECORDING_FLAG = 14 + private const val TAG_SERIES_INFO = 15 + private const val TAG_CATEGORY_LIST = 16 + private const val TAG_CAST_LIST = 17 + private const val TAG_EXTERNAL_I_D_LIST = 18 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterProgramStruct { + tlvReader.enterStructure(tlvTag) + val identifier = tlvReader.getString(ContextSpecificTag(TAG_IDENTIFIER)) + val channel = + ChannelClusterChannelInfoStruct.fromTlv(ContextSpecificTag(TAG_CHANNEL), tlvReader) + val startTime = tlvReader.getULong(ContextSpecificTag(TAG_START_TIME)) + val endTime = tlvReader.getULong(ContextSpecificTag(TAG_END_TIME)) + val title = tlvReader.getString(ContextSpecificTag(TAG_TITLE)) + val subtitle = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SUBTITLE))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_SUBTITLE))) + } else { + Optional.empty() + } + val description = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DESCRIPTION))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_DESCRIPTION))) + } else { + Optional.empty() + } + val audioLanguages = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_LANGUAGES))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_AUDIO_LANGUAGES)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getString(AnonymousTag)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val ratings = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_RATINGS))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_RATINGS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getString(AnonymousTag)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val thumbnailUrl = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_THUMBNAIL_URL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_THUMBNAIL_URL))) + } else { + Optional.empty() + } + val posterArtUrl = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_POSTER_ART_URL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_POSTER_ART_URL))) + } else { + Optional.empty() + } + val dvbiUrl = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DVBI_URL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_DVBI_URL))) + } else { + Optional.empty() + } + val releaseDate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_RELEASE_DATE))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_RELEASE_DATE))) + } else { + Optional.empty() + } + val parentalGuidanceText = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PARENTAL_GUIDANCE_TEXT))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_PARENTAL_GUIDANCE_TEXT))) + } else { + Optional.empty() + } + val recordingFlag = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_RECORDING_FLAG))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_RECORDING_FLAG))) + } else { + Optional.empty() + } + val seriesInfo = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SERIES_INFO))) { + Optional.of( + ChannelClusterSeriesInfoStruct.fromTlv(ContextSpecificTag(TAG_SERIES_INFO), tlvReader) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SERIES_INFO)) + null + } + val categoryList = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CATEGORY_LIST))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_CATEGORY_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(ChannelClusterProgramCategoryStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val castList = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CAST_LIST))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_CAST_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(ChannelClusterProgramCastStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val externalIDList = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(ChannelClusterProgramCastStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ChannelClusterProgramStruct( + identifier, + channel, + startTime, + endTime, + title, + subtitle, + description, + audioLanguages, + ratings, + thumbnailUrl, + posterArtUrl, + dvbiUrl, + releaseDate, + parentalGuidanceText, + recordingFlag, + seriesInfo, + categoryList, + castList, + externalIDList + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt new file mode 100644 index 00000000000000..eb06e3fe6dac2a --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterSeriesInfoStruct(val season: String, val episode: String) { + override fun toString(): String = buildString { + append("ChannelClusterSeriesInfoStruct {\n") + append("\tseason : $season\n") + append("\tepisode : $episode\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SEASON), season) + put(ContextSpecificTag(TAG_EPISODE), episode) + endStructure() + } + } + + companion object { + private const val TAG_SEASON = 0 + private const val TAG_EPISODE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterSeriesInfoStruct { + tlvReader.enterStructure(tlvTag) + val season = tlvReader.getString(ContextSpecificTag(TAG_SEASON)) + val episode = tlvReader.getString(ContextSpecificTag(TAG_EPISODE)) + + tlvReader.exitContainer() + + return ChannelClusterSeriesInfoStruct(season, episode) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt new file mode 100644 index 00000000000000..c22158cb36c3bd --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ContentControlClusterRatingNameStruct( + val ratingName: String, + val ratingNameDesc: Optional +) { + override fun toString(): String = buildString { + append("ContentControlClusterRatingNameStruct {\n") + append("\tratingName : $ratingName\n") + append("\tratingNameDesc : $ratingNameDesc\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_RATING_NAME), ratingName) + if (ratingNameDesc.isPresent) { + val optratingNameDesc = ratingNameDesc.get() + put(ContextSpecificTag(TAG_RATING_NAME_DESC), optratingNameDesc) + } + endStructure() + } + } + + companion object { + private const val TAG_RATING_NAME = 0 + private const val TAG_RATING_NAME_DESC = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ContentControlClusterRatingNameStruct { + tlvReader.enterStructure(tlvTag) + val ratingName = tlvReader.getString(ContextSpecificTag(TAG_RATING_NAME)) + val ratingNameDesc = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_RATING_NAME_DESC))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_RATING_NAME_DESC))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ContentControlClusterRatingNameStruct(ratingName, ratingNameDesc) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterPlaybackPreferencesStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterPlaybackPreferencesStruct.kt new file mode 100644 index 00000000000000..4199602517911f --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterPlaybackPreferencesStruct.kt @@ -0,0 +1,97 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ContentLauncherClusterPlaybackPreferencesStruct( + val playbackPosition: ULong, + val textTrack: ContentLauncherClusterTrackPreferenceStruct, + val audioTracks: Optional> +) { + override fun toString(): String = buildString { + append("ContentLauncherClusterPlaybackPreferencesStruct {\n") + append("\tplaybackPosition : $playbackPosition\n") + append("\ttextTrack : $textTrack\n") + append("\taudioTracks : $audioTracks\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_PLAYBACK_POSITION), playbackPosition) + textTrack.toTlv(ContextSpecificTag(TAG_TEXT_TRACK), this) + if (audioTracks.isPresent) { + val optaudioTracks = audioTracks.get() + startArray(ContextSpecificTag(TAG_AUDIO_TRACKS)) + for (item in optaudioTracks.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } + endStructure() + } + } + + companion object { + private const val TAG_PLAYBACK_POSITION = 0 + private const val TAG_TEXT_TRACK = 1 + private const val TAG_AUDIO_TRACKS = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader + ): ContentLauncherClusterPlaybackPreferencesStruct { + tlvReader.enterStructure(tlvTag) + val playbackPosition = tlvReader.getULong(ContextSpecificTag(TAG_PLAYBACK_POSITION)) + val textTrack = + ContentLauncherClusterTrackPreferenceStruct.fromTlv( + ContextSpecificTag(TAG_TEXT_TRACK), + tlvReader + ) + val audioTracks = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_TRACKS))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_AUDIO_TRACKS)) + while (!tlvReader.isEndOfContainer()) { + add(ContentLauncherClusterTrackPreferenceStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ContentLauncherClusterPlaybackPreferencesStruct( + playbackPosition, + textTrack, + audioTracks + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterTrackPreferenceStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterTrackPreferenceStruct.kt new file mode 100644 index 00000000000000..d5a3e09a859f73 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterTrackPreferenceStruct.kt @@ -0,0 +1,90 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ContentLauncherClusterTrackPreferenceStruct( + val languageCode: String, + val characteristics: Optional>, + val audioOutputIndex: UInt +) { + override fun toString(): String = buildString { + append("ContentLauncherClusterTrackPreferenceStruct {\n") + append("\tlanguageCode : $languageCode\n") + append("\tcharacteristics : $characteristics\n") + append("\taudioOutputIndex : $audioOutputIndex\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_LANGUAGE_CODE), languageCode) + if (characteristics.isPresent) { + val optcharacteristics = characteristics.get() + startArray(ContextSpecificTag(TAG_CHARACTERISTICS)) + for (item in optcharacteristics.iterator()) { + put(AnonymousTag, item) + } + endArray() + } + put(ContextSpecificTag(TAG_AUDIO_OUTPUT_INDEX), audioOutputIndex) + endStructure() + } + } + + companion object { + private const val TAG_LANGUAGE_CODE = 0 + private const val TAG_CHARACTERISTICS = 1 + private const val TAG_AUDIO_OUTPUT_INDEX = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ContentLauncherClusterTrackPreferenceStruct { + tlvReader.enterStructure(tlvTag) + val languageCode = tlvReader.getString(ContextSpecificTag(TAG_LANGUAGE_CODE)) + val characteristics = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CHARACTERISTICS))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_CHARACTERISTICS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val audioOutputIndex = tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_OUTPUT_INDEX)) + + tlvReader.exitContainer() + + return ContentLauncherClusterTrackPreferenceStruct( + languageCode, + characteristics, + audioOutputIndex + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackAttributesStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackAttributesStruct.kt new file mode 100644 index 00000000000000..1b991a4a051864 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackAttributesStruct.kt @@ -0,0 +1,77 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class MediaPlaybackClusterTrackAttributesStruct( + val languageCode: String, + val displayName: Optional? +) { + override fun toString(): String = buildString { + append("MediaPlaybackClusterTrackAttributesStruct {\n") + append("\tlanguageCode : $languageCode\n") + append("\tdisplayName : $displayName\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_LANGUAGE_CODE), languageCode) + if (displayName != null) { + if (displayName.isPresent) { + val optdisplayName = displayName.get() + put(ContextSpecificTag(TAG_DISPLAY_NAME), optdisplayName) + } + } else { + putNull(ContextSpecificTag(TAG_DISPLAY_NAME)) + } + endStructure() + } + } + + companion object { + private const val TAG_LANGUAGE_CODE = 0 + private const val TAG_DISPLAY_NAME = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MediaPlaybackClusterTrackAttributesStruct { + tlvReader.enterStructure(tlvTag) + val languageCode = tlvReader.getString(ContextSpecificTag(TAG_LANGUAGE_CODE)) + val displayName = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DISPLAY_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_DISPLAY_NAME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_DISPLAY_NAME)) + null + } + + tlvReader.exitContainer() + + return MediaPlaybackClusterTrackAttributesStruct(languageCode, displayName) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt new file mode 100644 index 00000000000000..087bc437a2a754 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class MediaPlaybackClusterTrackStruct( + val id: String, + val trackAttributes: MediaPlaybackClusterTrackAttributesStruct? +) { + override fun toString(): String = buildString { + append("MediaPlaybackClusterTrackStruct {\n") + append("\tid : $id\n") + append("\ttrackAttributes : $trackAttributes\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ID), id) + if (trackAttributes != null) { + trackAttributes.toTlv(ContextSpecificTag(TAG_TRACK_ATTRIBUTES), this) + } else { + putNull(ContextSpecificTag(TAG_TRACK_ATTRIBUTES)) + } + endStructure() + } + } + + companion object { + private const val TAG_ID = 0 + private const val TAG_TRACK_ATTRIBUTES = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MediaPlaybackClusterTrackStruct { + tlvReader.enterStructure(tlvTag) + val id = tlvReader.getString(ContextSpecificTag(TAG_ID)) + val trackAttributes = + if (!tlvReader.isNull()) { + MediaPlaybackClusterTrackAttributesStruct.fromTlv( + ContextSpecificTag(TAG_TRACK_ATTRIBUTES), + tlvReader + ) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TRACK_ATTRIBUTES)) + null + } + + tlvReader.exitContainer() + + return MediaPlaybackClusterTrackStruct(id, trackAttributes) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/AccountLoginCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/AccountLoginCluster.kt index 32bca8bbe97d6c..e11860c0ea53d2 100644 --- a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/AccountLoginCluster.kt +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/AccountLoginCluster.kt @@ -43,13 +43,18 @@ class AccountLoginCluster( // Implementation needs to be added here } - suspend fun login(tempAccountIdentifier: String, setupPIN: String, timedInvokeTimeoutMs: Int) { + suspend fun login( + tempAccountIdentifier: String, + setupPIN: String, + node: ULong?, + timedInvokeTimeoutMs: Int + ) { val commandId = 2L // Implementation needs to be added here } - suspend fun logout(timedInvokeTimeoutMs: Int) { + suspend fun logout(node: ULong?, timedInvokeTimeoutMs: Int) { val commandId = 3L // Implementation needs to be added here diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ChannelCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ChannelCluster.kt index 70cda55af0e17c..5396dd327550bd 100644 --- a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ChannelCluster.kt +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ChannelCluster.kt @@ -23,6 +23,11 @@ import matter.devicecontroller.cluster.structs.* class ChannelCluster(private val controller: MatterController, private val endpointId: UShort) { class ChangeChannelResponse(val status: UInt, val data: String?) + class ProgramGuideResponse( + val channelPagingStruct: Short, + val programList: List + ) + class ChannelListAttribute(val value: List?) class LineupAttribute(val value: ChannelClusterLineupInfoStruct?) @@ -74,6 +79,57 @@ class ChannelCluster(private val controller: MatterController, private val endpo } } + suspend fun getProgramGuide( + startTime: UInt?, + endTime: UInt?, + channelList: List?, + pageToken: ChannelClusterPageTokenStruct?, + recordingFlag: ULong?, + externalIDList: List?, + data: ByteArray?, + timedInvokeTimeoutMs: Int? = null + ): ProgramGuideResponse { + val commandId = 4L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun recordProgram( + programIdentifier: String, + shouldRecordSeries: Boolean, + externalIDList: List, + data: ByteArray, + timedInvokeTimeoutMs: Int? = null + ) { + val commandId = 6L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun cancelRecordProgram( + programIdentifier: String, + shouldRecordSeries: Boolean, + externalIDList: List, + data: ByteArray, + timedInvokeTimeoutMs: Int? = null + ) { + val commandId = 7L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + suspend fun readChannelListAttribute(): ChannelListAttribute { // Implementation needs to be added here } diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentAppObserverCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentAppObserverCluster.kt new file mode 100644 index 00000000000000..8c7f94fb3b3d99 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentAppObserverCluster.kt @@ -0,0 +1,111 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.devicecontroller.cluster.clusters + +import matter.controller.MatterController +import matter.devicecontroller.cluster.structs.* + +class ContentAppObserverCluster( + private val controller: MatterController, + private val endpointId: UShort +) { + class ContentAppMessageResponse(val status: UInt?, val data: String, val encodingHint: String) + + class GeneratedCommandListAttribute(val value: List) + + class AcceptedCommandListAttribute(val value: List) + + class EventListAttribute(val value: List) + + class AttributeListAttribute(val value: List) + + suspend fun contentAppMessage( + data: String?, + encodingHint: String, + timedInvokeTimeoutMs: Int? = null + ): ContentAppMessageResponse { + val commandId = 0L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int + ): GeneratedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int + ): AcceptedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun readEventListAttribute(): EventListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeEventListAttribute(minInterval: Int, maxInterval: Int): EventListAttribute { + // Implementation needs to be added here + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int + ): AttributeListAttribute { + // Implementation needs to be added here + } + + suspend fun readFeatureMapAttribute(): UInt { + // Implementation needs to be added here + } + + suspend fun subscribeFeatureMapAttribute(minInterval: Int, maxInterval: Int): UInt { + // Implementation needs to be added here + } + + suspend fun readClusterRevisionAttribute(): UShort { + // Implementation needs to be added here + } + + suspend fun subscribeClusterRevisionAttribute(minInterval: Int, maxInterval: Int): UShort { + // Implementation needs to be added here + } + + companion object { + const val CLUSTER_ID: UInt = 1296u + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentControlCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentControlCluster.kt new file mode 100644 index 00000000000000..16a9d6dfbfa009 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentControlCluster.kt @@ -0,0 +1,280 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.devicecontroller.cluster.clusters + +import matter.controller.MatterController +import matter.devicecontroller.cluster.structs.* + +class ContentControlCluster( + private val controller: MatterController, + private val endpointId: UShort +) { + class ResetPINResponse(val PINCode: String) + + class OnDemandRatingsAttribute(val value: List?) + + class ScheduledContentRatingsAttribute(val value: List?) + + class GeneratedCommandListAttribute(val value: List) + + class AcceptedCommandListAttribute(val value: List) + + class EventListAttribute(val value: List) + + class AttributeListAttribute(val value: List) + + suspend fun updatePIN(oldPIN: String?, newPIN: String, timedInvokeTimeoutMs: Int? = null) { + val commandId = 0L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun resetPIN(timedInvokeTimeoutMs: Int? = null): ResetPINResponse { + val commandId = 1L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun enable(timedInvokeTimeoutMs: Int? = null) { + val commandId = 3L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun disable(timedInvokeTimeoutMs: Int? = null) { + val commandId = 4L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun addBonusTime(PINCode: String?, bonusTime: UInt?, timedInvokeTimeoutMs: Int? = null) { + val commandId = 5L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun setScreenDailyTime(screenTime: UInt, timedInvokeTimeoutMs: Int? = null) { + val commandId = 6L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun blockUnratedContent(timedInvokeTimeoutMs: Int? = null) { + val commandId = 7L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun unblockUnratedContent(timedInvokeTimeoutMs: Int? = null) { + val commandId = 8L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun setOnDemandRatingThreshold(rating: String, timedInvokeTimeoutMs: Int? = null) { + val commandId = 9L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun setScheduledContentRatingThreshold( + rating: String, + timedInvokeTimeoutMs: Int? = null + ) { + val commandId = 10L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun readEnabledAttribute(): Boolean { + // Implementation needs to be added here + } + + suspend fun subscribeEnabledAttribute(minInterval: Int, maxInterval: Int): Boolean { + // Implementation needs to be added here + } + + suspend fun readOnDemandRatingsAttribute(): OnDemandRatingsAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeOnDemandRatingsAttribute( + minInterval: Int, + maxInterval: Int + ): OnDemandRatingsAttribute { + // Implementation needs to be added here + } + + suspend fun readOnDemandRatingThresholdAttribute(): CharString { + // Implementation needs to be added here + } + + suspend fun subscribeOnDemandRatingThresholdAttribute( + minInterval: Int, + maxInterval: Int + ): CharString { + // Implementation needs to be added here + } + + suspend fun readScheduledContentRatingsAttribute(): ScheduledContentRatingsAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeScheduledContentRatingsAttribute( + minInterval: Int, + maxInterval: Int + ): ScheduledContentRatingsAttribute { + // Implementation needs to be added here + } + + suspend fun readScheduledContentRatingThresholdAttribute(): CharString { + // Implementation needs to be added here + } + + suspend fun subscribeScheduledContentRatingThresholdAttribute( + minInterval: Int, + maxInterval: Int + ): CharString { + // Implementation needs to be added here + } + + suspend fun readScreenDailyTimeAttribute(): UInt { + // Implementation needs to be added here + } + + suspend fun subscribeScreenDailyTimeAttribute(minInterval: Int, maxInterval: Int): UInt { + // Implementation needs to be added here + } + + suspend fun readRemainingScreenTimeAttribute(): UInt { + // Implementation needs to be added here + } + + suspend fun subscribeRemainingScreenTimeAttribute(minInterval: Int, maxInterval: Int): UInt { + // Implementation needs to be added here + } + + suspend fun readBlockUnratedAttribute(): Boolean { + // Implementation needs to be added here + } + + suspend fun subscribeBlockUnratedAttribute(minInterval: Int, maxInterval: Int): Boolean { + // Implementation needs to be added here + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int + ): GeneratedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int + ): AcceptedCommandListAttribute { + // Implementation needs to be added here + } + + suspend fun readEventListAttribute(): EventListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeEventListAttribute(minInterval: Int, maxInterval: Int): EventListAttribute { + // Implementation needs to be added here + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int + ): AttributeListAttribute { + // Implementation needs to be added here + } + + suspend fun readFeatureMapAttribute(): UInt { + // Implementation needs to be added here + } + + suspend fun subscribeFeatureMapAttribute(minInterval: Int, maxInterval: Int): UInt { + // Implementation needs to be added here + } + + suspend fun readClusterRevisionAttribute(): UShort { + // Implementation needs to be added here + } + + suspend fun subscribeClusterRevisionAttribute(minInterval: Int, maxInterval: Int): UShort { + // Implementation needs to be added here + } + + companion object { + const val CLUSTER_ID: UInt = 1295u + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentLauncherCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentLauncherCluster.kt index d91c75e898b7ef..5db8509ec6034d 100644 --- a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentLauncherCluster.kt +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentLauncherCluster.kt @@ -40,6 +40,8 @@ class ContentLauncherCluster( search: ContentLauncherClusterContentSearchStruct, autoPlay: Boolean, data: String?, + playbackPreferences: ContentLauncherClusterPlaybackPreferencesStruct?, + useCurrentContext: Boolean?, timedInvokeTimeoutMs: Int? = null ): LauncherResponse { val commandId = 0L diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MediaPlaybackCluster.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MediaPlaybackCluster.kt index 9c38c74c79c543..486e87eff60d06 100644 --- a/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MediaPlaybackCluster.kt +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/MediaPlaybackCluster.kt @@ -36,6 +36,14 @@ class MediaPlaybackCluster( class SeekRangeStartAttribute(val value: ULong?) + class ActiveAudioTrackAttribute(val value: MediaPlaybackClusterTrackStruct?) + + class AvailableAudioTracksAttribute(val value: List?) + + class ActiveTextTrackAttribute(val value: MediaPlaybackClusterTrackStruct?) + + class AvailableTextTracksAttribute(val value: List?) + class GeneratedCommandListAttribute(val value: List) class AcceptedCommandListAttribute(val value: List) @@ -104,7 +112,10 @@ class MediaPlaybackCluster( } } - suspend fun rewind(timedInvokeTimeoutMs: Int? = null): PlaybackResponse { + suspend fun rewind( + audioAdvanceUnmuted: Boolean?, + timedInvokeTimeoutMs: Int? = null + ): PlaybackResponse { val commandId = 6L if (timedInvokeTimeoutMs != null) { @@ -114,7 +125,10 @@ class MediaPlaybackCluster( } } - suspend fun fastForward(timedInvokeTimeoutMs: Int? = null): PlaybackResponse { + suspend fun fastForward( + audioAdvanceUnmuted: Boolean?, + timedInvokeTimeoutMs: Int? = null + ): PlaybackResponse { val commandId = 7L if (timedInvokeTimeoutMs != null) { @@ -160,6 +174,40 @@ class MediaPlaybackCluster( } } + suspend fun activateAudioTrack( + trackID: String, + audioOutputIndex: UByte, + timedInvokeTimeoutMs: Int? = null + ) { + val commandId = 12L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun activateTextTrack(trackID: String, timedInvokeTimeoutMs: Int? = null) { + val commandId = 13L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + + suspend fun deactivateTextTrack(timedInvokeTimeoutMs: Int? = null) { + val commandId = 14L + + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } + suspend fun readCurrentStateAttribute(): UByte { // Implementation needs to be added here } @@ -225,6 +273,50 @@ class MediaPlaybackCluster( // Implementation needs to be added here } + suspend fun readActiveAudioTrackAttribute(): ActiveAudioTrackAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeActiveAudioTrackAttribute( + minInterval: Int, + maxInterval: Int + ): ActiveAudioTrackAttribute { + // Implementation needs to be added here + } + + suspend fun readAvailableAudioTracksAttribute(): AvailableAudioTracksAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeAvailableAudioTracksAttribute( + minInterval: Int, + maxInterval: Int + ): AvailableAudioTracksAttribute { + // Implementation needs to be added here + } + + suspend fun readActiveTextTrackAttribute(): ActiveTextTrackAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeActiveTextTrackAttribute( + minInterval: Int, + maxInterval: Int + ): ActiveTextTrackAttribute { + // Implementation needs to be added here + } + + suspend fun readAvailableTextTracksAttribute(): AvailableTextTracksAttribute { + // Implementation needs to be added here + } + + suspend fun subscribeAvailableTextTracksAttribute( + minInterval: Int, + maxInterval: Int + ): AvailableTextTracksAttribute { + // Implementation needs to be added here + } + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { // Implementation needs to be added here } diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/AccountLoginClusterLoggedOutEvent.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/AccountLoginClusterLoggedOutEvent.kt new file mode 100644 index 00000000000000..332ef0ac2dc29b --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/AccountLoginClusterLoggedOutEvent.kt @@ -0,0 +1,61 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.eventstructs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class AccountLoginClusterLoggedOutEvent(val node: Optional) { + override fun toString(): String = buildString { + append("AccountLoginClusterLoggedOutEvent {\n") + append("\tnode : $node\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (node.isPresent) { + val optnode = node.get() + put(ContextSpecificTag(TAG_NODE), optnode) + } + endStructure() + } + } + + companion object { + private const val TAG_NODE = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): AccountLoginClusterLoggedOutEvent { + tlvReader.enterStructure(tlvTag) + val node = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NODE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_NODE))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return AccountLoginClusterLoggedOutEvent(node) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/MediaPlaybackClusterStateChangedEvent.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/MediaPlaybackClusterStateChangedEvent.kt new file mode 100644 index 00000000000000..f024905661f04f --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/MediaPlaybackClusterStateChangedEvent.kt @@ -0,0 +1,118 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.eventstructs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class MediaPlaybackClusterStateChangedEvent( + val currentState: UInt, + val startTime: ULong, + val duration: ULong, + val sampledPosition: + matter.devicecontroller.cluster.structs.MediaPlaybackClusterPlaybackPositionStruct, + val playbackSpeed: Float, + val seekRangeEnd: ULong, + val seekRangeStart: ULong, + val data: Optional, + val audioAdvanceUnmuted: Boolean +) { + override fun toString(): String = buildString { + append("MediaPlaybackClusterStateChangedEvent {\n") + append("\tcurrentState : $currentState\n") + append("\tstartTime : $startTime\n") + append("\tduration : $duration\n") + append("\tsampledPosition : $sampledPosition\n") + append("\tplaybackSpeed : $playbackSpeed\n") + append("\tseekRangeEnd : $seekRangeEnd\n") + append("\tseekRangeStart : $seekRangeStart\n") + append("\tdata : $data\n") + append("\taudioAdvanceUnmuted : $audioAdvanceUnmuted\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CURRENT_STATE), currentState) + put(ContextSpecificTag(TAG_START_TIME), startTime) + put(ContextSpecificTag(TAG_DURATION), duration) + sampledPosition.toTlv(ContextSpecificTag(TAG_SAMPLED_POSITION), this) + put(ContextSpecificTag(TAG_PLAYBACK_SPEED), playbackSpeed) + put(ContextSpecificTag(TAG_SEEK_RANGE_END), seekRangeEnd) + put(ContextSpecificTag(TAG_SEEK_RANGE_START), seekRangeStart) + if (data.isPresent) { + val optdata = data.get() + put(ContextSpecificTag(TAG_DATA), optdata) + } + put(ContextSpecificTag(TAG_AUDIO_ADVANCE_UNMUTED), audioAdvanceUnmuted) + endStructure() + } + } + + companion object { + private const val TAG_CURRENT_STATE = 0 + private const val TAG_START_TIME = 1 + private const val TAG_DURATION = 2 + private const val TAG_SAMPLED_POSITION = 3 + private const val TAG_PLAYBACK_SPEED = 4 + private const val TAG_SEEK_RANGE_END = 5 + private const val TAG_SEEK_RANGE_START = 6 + private const val TAG_DATA = 7 + private const val TAG_AUDIO_ADVANCE_UNMUTED = 8 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MediaPlaybackClusterStateChangedEvent { + tlvReader.enterStructure(tlvTag) + val currentState = tlvReader.getUInt(ContextSpecificTag(TAG_CURRENT_STATE)) + val startTime = tlvReader.getULong(ContextSpecificTag(TAG_START_TIME)) + val duration = tlvReader.getULong(ContextSpecificTag(TAG_DURATION)) + val sampledPosition = + matter.devicecontroller.cluster.structs.MediaPlaybackClusterPlaybackPositionStruct.fromTlv( + ContextSpecificTag(TAG_SAMPLED_POSITION), + tlvReader + ) + val playbackSpeed = tlvReader.getFloat(ContextSpecificTag(TAG_PLAYBACK_SPEED)) + val seekRangeEnd = tlvReader.getULong(ContextSpecificTag(TAG_SEEK_RANGE_END)) + val seekRangeStart = tlvReader.getULong(ContextSpecificTag(TAG_SEEK_RANGE_START)) + val data = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DATA))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_DATA))) + } else { + Optional.empty() + } + val audioAdvanceUnmuted = tlvReader.getBoolean(ContextSpecificTag(TAG_AUDIO_ADVANCE_UNMUTED)) + + tlvReader.exitContainer() + + return MediaPlaybackClusterStateChangedEvent( + currentState, + startTime, + duration, + sampledPosition, + playbackSpeed, + seekRangeEnd, + seekRangeStart, + data, + audioAdvanceUnmuted + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt new file mode 100644 index 00000000000000..bfe84759bfb77b --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt @@ -0,0 +1,80 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.eventstructs + +import matter.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class TargetNavigatorClusterTargetUpdatedEvent( + val targetList: + List, + val currentTarget: UByte, + val data: ByteArray +) { + override fun toString(): String = buildString { + append("TargetNavigatorClusterTargetUpdatedEvent {\n") + append("\ttargetList : $targetList\n") + append("\tcurrentTarget : $currentTarget\n") + append("\tdata : $data\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_TARGET_LIST)) + for (item in targetList.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + put(ContextSpecificTag(TAG_CURRENT_TARGET), currentTarget) + put(ContextSpecificTag(TAG_DATA), data) + endStructure() + } + } + + companion object { + private const val TAG_TARGET_LIST = 0 + private const val TAG_CURRENT_TARGET = 1 + private const val TAG_DATA = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): TargetNavigatorClusterTargetUpdatedEvent { + tlvReader.enterStructure(tlvTag) + val targetList = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_TARGET_LIST)) + while (!tlvReader.isEndOfContainer()) { + this.add( + matter.devicecontroller.cluster.structs.TargetNavigatorClusterTargetInfoStruct + .fromTlv(AnonymousTag, tlvReader) + ) + } + tlvReader.exitContainer() + } + val currentTarget = tlvReader.getUByte(ContextSpecificTag(TAG_CURRENT_TARGET)) + val data = tlvReader.getByteArray(ContextSpecificTag(TAG_DATA)) + + tlvReader.exitContainer() + + return TargetNavigatorClusterTargetUpdatedEvent(targetList, currentTarget, data) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni index b5c3b1f2f2bf3b..993016c6e672ed 100644 --- a/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/files.gni @@ -16,14 +16,24 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterLineupInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterPageTokenStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramCastStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterContentSearchStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterDimensionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterParameterStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterPlaybackPreferencesStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterStyleInformationStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterTrackPreferenceStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/DemandResponseLoadControlClusterAverageLoadControlStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/DemandResponseLoadControlClusterDutyCycleControlStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/DemandResponseLoadControlClusterHeatingSourceControlStruct.kt", @@ -50,6 +60,8 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterTrackAttributesStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MicrowaveOvenModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt", @@ -104,6 +116,7 @@ matter_structs_sources = [ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlEntryChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlExtensionChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/AccountLoginClusterLoggedOutEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/ActionsClusterActionFailedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/ActionsClusterStateChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/BasicInformationClusterLeaveEvent.kt", @@ -130,6 +143,7 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterRadioFaultChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/MediaPlaybackClusterStateChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationalErrorEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationCompletionEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterDownloadErrorEvent.kt", @@ -156,6 +170,7 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressOngoingEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt", @@ -191,6 +206,8 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/CarbonMonoxideConcentrationMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ChannelCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ColorControlCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentAppObserverCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentControlCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/ContentLauncherCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/DemandResponseLoadControlCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/DescriptorCluster.kt", diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt new file mode 100644 index 00000000000000..0b79ff3eb596ad --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterAdditionalInfoStruct(val name: String, val value: String) { + override fun toString(): String = buildString { + append("ChannelClusterAdditionalInfoStruct {\n") + append("\tname : $name\n") + append("\tvalue : $value\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_NAME), name) + put(ContextSpecificTag(TAG_VALUE), value) + endStructure() + } + } + + companion object { + private const val TAG_NAME = 0 + private const val TAG_VALUE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterAdditionalInfoStruct { + tlvReader.enterStructure(tlvTag) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val value = tlvReader.getString(ContextSpecificTag(TAG_VALUE)) + + tlvReader.exitContainer() + + return ChannelClusterAdditionalInfoStruct(name, value) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt index 78dbdfba00b026..140a9efa1979ba 100644 --- a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt @@ -28,7 +28,9 @@ class ChannelClusterChannelInfoStruct( val minorNumber: UShort, val name: Optional, val callSign: Optional, - val affiliateCallSign: Optional + val affiliateCallSign: Optional, + val identifier: Optional, + val type: Optional ) { override fun toString(): String = buildString { append("ChannelClusterChannelInfoStruct {\n") @@ -37,6 +39,8 @@ class ChannelClusterChannelInfoStruct( append("\tname : $name\n") append("\tcallSign : $callSign\n") append("\taffiliateCallSign : $affiliateCallSign\n") + append("\tidentifier : $identifier\n") + append("\ttype : $type\n") append("}\n") } @@ -57,6 +61,14 @@ class ChannelClusterChannelInfoStruct( val optaffiliateCallSign = affiliateCallSign.get() put(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN), optaffiliateCallSign) } + if (identifier.isPresent) { + val optidentifier = identifier.get() + put(ContextSpecificTag(TAG_IDENTIFIER), optidentifier) + } + if (type.isPresent) { + val opttype = type.get() + put(ContextSpecificTag(TAG_TYPE), opttype) + } endStructure() } } @@ -67,6 +79,8 @@ class ChannelClusterChannelInfoStruct( private const val TAG_NAME = 2 private const val TAG_CALL_SIGN = 3 private const val TAG_AFFILIATE_CALL_SIGN = 4 + private const val TAG_IDENTIFIER = 5 + private const val TAG_TYPE = 6 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterChannelInfoStruct { tlvReader.enterStructure(tlvTag) @@ -90,6 +104,18 @@ class ChannelClusterChannelInfoStruct( } else { Optional.empty() } + val identifier = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_IDENTIFIER))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_IDENTIFIER))) + } else { + Optional.empty() + } + val type = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TYPE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_TYPE))) + } else { + Optional.empty() + } tlvReader.exitContainer() @@ -98,7 +124,9 @@ class ChannelClusterChannelInfoStruct( minorNumber, name, callSign, - affiliateCallSign + affiliateCallSign, + identifier, + type ) } } diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt new file mode 100644 index 00000000000000..8be6df885ae3e7 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt @@ -0,0 +1,101 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterChannelPagingStruct( + val previousToken: Optional?, + val nextToken: Optional? +) { + override fun toString(): String = buildString { + append("ChannelClusterChannelPagingStruct {\n") + append("\tpreviousToken : $previousToken\n") + append("\tnextToken : $nextToken\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousToken != null) { + if (previousToken.isPresent) { + val optpreviousToken = previousToken.get() + optpreviousToken.toTlv(ContextSpecificTag(TAG_PREVIOUS_TOKEN), this) + } + } else { + putNull(ContextSpecificTag(TAG_PREVIOUS_TOKEN)) + } + if (nextToken != null) { + if (nextToken.isPresent) { + val optnextToken = nextToken.get() + optnextToken.toTlv(ContextSpecificTag(TAG_NEXT_TOKEN), this) + } + } else { + putNull(ContextSpecificTag(TAG_NEXT_TOKEN)) + } + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_TOKEN = 0 + private const val TAG_NEXT_TOKEN = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterChannelPagingStruct { + tlvReader.enterStructure(tlvTag) + val previousToken = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_TOKEN))) { + Optional.of( + ChannelClusterPageTokenStruct.fromTlv( + ContextSpecificTag(TAG_PREVIOUS_TOKEN), + tlvReader + ) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PREVIOUS_TOKEN)) + null + } + val nextToken = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NEXT_TOKEN))) { + Optional.of( + ChannelClusterPageTokenStruct.fromTlv(ContextSpecificTag(TAG_NEXT_TOKEN), tlvReader) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NEXT_TOKEN)) + null + } + + tlvReader.exitContainer() + + return ChannelClusterChannelPagingStruct(previousToken, nextToken) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterPageTokenStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterPageTokenStruct.kt new file mode 100644 index 00000000000000..9a589addf25a34 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterPageTokenStruct.kt @@ -0,0 +1,89 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterPageTokenStruct( + val limit: Optional, + val after: Optional, + val before: Optional +) { + override fun toString(): String = buildString { + append("ChannelClusterPageTokenStruct {\n") + append("\tlimit : $limit\n") + append("\tafter : $after\n") + append("\tbefore : $before\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (limit.isPresent) { + val optlimit = limit.get() + put(ContextSpecificTag(TAG_LIMIT), optlimit) + } + if (after.isPresent) { + val optafter = after.get() + put(ContextSpecificTag(TAG_AFTER), optafter) + } + if (before.isPresent) { + val optbefore = before.get() + put(ContextSpecificTag(TAG_BEFORE), optbefore) + } + endStructure() + } + } + + companion object { + private const val TAG_LIMIT = 0 + private const val TAG_AFTER = 1 + private const val TAG_BEFORE = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterPageTokenStruct { + tlvReader.enterStructure(tlvTag) + val limit = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_LIMIT))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_LIMIT))) + } else { + Optional.empty() + } + val after = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AFTER))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_AFTER))) + } else { + Optional.empty() + } + val before = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BEFORE))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_BEFORE))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ChannelClusterPageTokenStruct(limit, after, before) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramCastStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramCastStruct.kt new file mode 100644 index 00000000000000..a5bc79e5602b86 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramCastStruct.kt @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterProgramCastStruct(val name: String, val role: String) { + override fun toString(): String = buildString { + append("ChannelClusterProgramCastStruct {\n") + append("\tname : $name\n") + append("\trole : $role\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_NAME), name) + put(ContextSpecificTag(TAG_ROLE), role) + endStructure() + } + } + + companion object { + private const val TAG_NAME = 0 + private const val TAG_ROLE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterProgramCastStruct { + tlvReader.enterStructure(tlvTag) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val role = tlvReader.getString(ContextSpecificTag(TAG_ROLE)) + + tlvReader.exitContainer() + + return ChannelClusterProgramCastStruct(name, role) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt new file mode 100644 index 00000000000000..9f0756a7e762af --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt @@ -0,0 +1,65 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterProgramCategoryStruct(val category: String, val subCategory: Optional) { + override fun toString(): String = buildString { + append("ChannelClusterProgramCategoryStruct {\n") + append("\tcategory : $category\n") + append("\tsubCategory : $subCategory\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CATEGORY), category) + if (subCategory.isPresent) { + val optsubCategory = subCategory.get() + put(ContextSpecificTag(TAG_SUB_CATEGORY), optsubCategory) + } + endStructure() + } + } + + companion object { + private const val TAG_CATEGORY = 0 + private const val TAG_SUB_CATEGORY = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterProgramCategoryStruct { + tlvReader.enterStructure(tlvTag) + val category = tlvReader.getString(ContextSpecificTag(TAG_CATEGORY)) + val subCategory = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SUB_CATEGORY))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_SUB_CATEGORY))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ChannelClusterProgramCategoryStruct(category, subCategory) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt new file mode 100644 index 00000000000000..434d64c9bc8ad4 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt @@ -0,0 +1,350 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterProgramStruct( + val identifier: String, + val channel: ChannelClusterChannelInfoStruct, + val startTime: UInt, + val endTime: UInt, + val title: String, + val subtitle: Optional, + val description: Optional, + val audioLanguages: Optional>, + val ratings: Optional>, + val thumbnailUrl: Optional, + val posterArtUrl: Optional, + val dvbiUrl: Optional, + val releaseDate: Optional, + val parentalGuidanceText: Optional, + val recordingFlag: Optional, + val seriesInfo: Optional?, + val categoryList: Optional>, + val castList: Optional>, + val externalIDList: Optional> +) { + override fun toString(): String = buildString { + append("ChannelClusterProgramStruct {\n") + append("\tidentifier : $identifier\n") + append("\tchannel : $channel\n") + append("\tstartTime : $startTime\n") + append("\tendTime : $endTime\n") + append("\ttitle : $title\n") + append("\tsubtitle : $subtitle\n") + append("\tdescription : $description\n") + append("\taudioLanguages : $audioLanguages\n") + append("\tratings : $ratings\n") + append("\tthumbnailUrl : $thumbnailUrl\n") + append("\tposterArtUrl : $posterArtUrl\n") + append("\tdvbiUrl : $dvbiUrl\n") + append("\treleaseDate : $releaseDate\n") + append("\tparentalGuidanceText : $parentalGuidanceText\n") + append("\trecordingFlag : $recordingFlag\n") + append("\tseriesInfo : $seriesInfo\n") + append("\tcategoryList : $categoryList\n") + append("\tcastList : $castList\n") + append("\texternalIDList : $externalIDList\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_IDENTIFIER), identifier) + channel.toTlv(ContextSpecificTag(TAG_CHANNEL), this) + put(ContextSpecificTag(TAG_START_TIME), startTime) + put(ContextSpecificTag(TAG_END_TIME), endTime) + put(ContextSpecificTag(TAG_TITLE), title) + if (subtitle.isPresent) { + val optsubtitle = subtitle.get() + put(ContextSpecificTag(TAG_SUBTITLE), optsubtitle) + } + if (description.isPresent) { + val optdescription = description.get() + put(ContextSpecificTag(TAG_DESCRIPTION), optdescription) + } + if (audioLanguages.isPresent) { + val optaudioLanguages = audioLanguages.get() + startArray(ContextSpecificTag(TAG_AUDIO_LANGUAGES)) + for (item in optaudioLanguages.iterator()) { + put(AnonymousTag, item) + } + endArray() + } + if (ratings.isPresent) { + val optratings = ratings.get() + startArray(ContextSpecificTag(TAG_RATINGS)) + for (item in optratings.iterator()) { + put(AnonymousTag, item) + } + endArray() + } + if (thumbnailUrl.isPresent) { + val optthumbnailUrl = thumbnailUrl.get() + put(ContextSpecificTag(TAG_THUMBNAIL_URL), optthumbnailUrl) + } + if (posterArtUrl.isPresent) { + val optposterArtUrl = posterArtUrl.get() + put(ContextSpecificTag(TAG_POSTER_ART_URL), optposterArtUrl) + } + if (dvbiUrl.isPresent) { + val optdvbiUrl = dvbiUrl.get() + put(ContextSpecificTag(TAG_DVBI_URL), optdvbiUrl) + } + if (releaseDate.isPresent) { + val optreleaseDate = releaseDate.get() + put(ContextSpecificTag(TAG_RELEASE_DATE), optreleaseDate) + } + if (parentalGuidanceText.isPresent) { + val optparentalGuidanceText = parentalGuidanceText.get() + put(ContextSpecificTag(TAG_PARENTAL_GUIDANCE_TEXT), optparentalGuidanceText) + } + if (recordingFlag.isPresent) { + val optrecordingFlag = recordingFlag.get() + put(ContextSpecificTag(TAG_RECORDING_FLAG), optrecordingFlag) + } + if (seriesInfo != null) { + if (seriesInfo.isPresent) { + val optseriesInfo = seriesInfo.get() + optseriesInfo.toTlv(ContextSpecificTag(TAG_SERIES_INFO), this) + } + } else { + putNull(ContextSpecificTag(TAG_SERIES_INFO)) + } + if (categoryList.isPresent) { + val optcategoryList = categoryList.get() + startArray(ContextSpecificTag(TAG_CATEGORY_LIST)) + for (item in optcategoryList.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } + if (castList.isPresent) { + val optcastList = castList.get() + startArray(ContextSpecificTag(TAG_CAST_LIST)) + for (item in optcastList.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } + if (externalIDList.isPresent) { + val optexternalIDList = externalIDList.get() + startArray(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) + for (item in optexternalIDList.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } + endStructure() + } + } + + companion object { + private const val TAG_IDENTIFIER = 0 + private const val TAG_CHANNEL = 1 + private const val TAG_START_TIME = 2 + private const val TAG_END_TIME = 3 + private const val TAG_TITLE = 4 + private const val TAG_SUBTITLE = 5 + private const val TAG_DESCRIPTION = 6 + private const val TAG_AUDIO_LANGUAGES = 7 + private const val TAG_RATINGS = 8 + private const val TAG_THUMBNAIL_URL = 9 + private const val TAG_POSTER_ART_URL = 10 + private const val TAG_DVBI_URL = 11 + private const val TAG_RELEASE_DATE = 12 + private const val TAG_PARENTAL_GUIDANCE_TEXT = 13 + private const val TAG_RECORDING_FLAG = 14 + private const val TAG_SERIES_INFO = 15 + private const val TAG_CATEGORY_LIST = 16 + private const val TAG_CAST_LIST = 17 + private const val TAG_EXTERNAL_I_D_LIST = 18 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterProgramStruct { + tlvReader.enterStructure(tlvTag) + val identifier = tlvReader.getString(ContextSpecificTag(TAG_IDENTIFIER)) + val channel = + ChannelClusterChannelInfoStruct.fromTlv(ContextSpecificTag(TAG_CHANNEL), tlvReader) + val startTime = tlvReader.getUInt(ContextSpecificTag(TAG_START_TIME)) + val endTime = tlvReader.getUInt(ContextSpecificTag(TAG_END_TIME)) + val title = tlvReader.getString(ContextSpecificTag(TAG_TITLE)) + val subtitle = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SUBTITLE))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_SUBTITLE))) + } else { + Optional.empty() + } + val description = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DESCRIPTION))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_DESCRIPTION))) + } else { + Optional.empty() + } + val audioLanguages = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_LANGUAGES))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_AUDIO_LANGUAGES)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getString(AnonymousTag)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val ratings = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_RATINGS))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_RATINGS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getString(AnonymousTag)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val thumbnailUrl = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_THUMBNAIL_URL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_THUMBNAIL_URL))) + } else { + Optional.empty() + } + val posterArtUrl = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_POSTER_ART_URL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_POSTER_ART_URL))) + } else { + Optional.empty() + } + val dvbiUrl = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DVBI_URL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_DVBI_URL))) + } else { + Optional.empty() + } + val releaseDate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_RELEASE_DATE))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_RELEASE_DATE))) + } else { + Optional.empty() + } + val parentalGuidanceText = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PARENTAL_GUIDANCE_TEXT))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_PARENTAL_GUIDANCE_TEXT))) + } else { + Optional.empty() + } + val recordingFlag = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_RECORDING_FLAG))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_RECORDING_FLAG))) + } else { + Optional.empty() + } + val seriesInfo = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SERIES_INFO))) { + Optional.of( + ChannelClusterSeriesInfoStruct.fromTlv(ContextSpecificTag(TAG_SERIES_INFO), tlvReader) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SERIES_INFO)) + null + } + val categoryList = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CATEGORY_LIST))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_CATEGORY_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(ChannelClusterProgramCategoryStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val castList = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CAST_LIST))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_CAST_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(ChannelClusterProgramCastStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val externalIDList = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(ChannelClusterProgramCastStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ChannelClusterProgramStruct( + identifier, + channel, + startTime, + endTime, + title, + subtitle, + description, + audioLanguages, + ratings, + thumbnailUrl, + posterArtUrl, + dvbiUrl, + releaseDate, + parentalGuidanceText, + recordingFlag, + seriesInfo, + categoryList, + castList, + externalIDList + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt new file mode 100644 index 00000000000000..0052c32a87ec6b --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChannelClusterSeriesInfoStruct(val season: String, val episode: String) { + override fun toString(): String = buildString { + append("ChannelClusterSeriesInfoStruct {\n") + append("\tseason : $season\n") + append("\tepisode : $episode\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SEASON), season) + put(ContextSpecificTag(TAG_EPISODE), episode) + endStructure() + } + } + + companion object { + private const val TAG_SEASON = 0 + private const val TAG_EPISODE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChannelClusterSeriesInfoStruct { + tlvReader.enterStructure(tlvTag) + val season = tlvReader.getString(ContextSpecificTag(TAG_SEASON)) + val episode = tlvReader.getString(ContextSpecificTag(TAG_EPISODE)) + + tlvReader.exitContainer() + + return ChannelClusterSeriesInfoStruct(season, episode) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt new file mode 100644 index 00000000000000..af2a6a33a9048e --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ContentControlClusterRatingNameStruct( + val ratingName: String, + val ratingNameDesc: Optional +) { + override fun toString(): String = buildString { + append("ContentControlClusterRatingNameStruct {\n") + append("\tratingName : $ratingName\n") + append("\tratingNameDesc : $ratingNameDesc\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_RATING_NAME), ratingName) + if (ratingNameDesc.isPresent) { + val optratingNameDesc = ratingNameDesc.get() + put(ContextSpecificTag(TAG_RATING_NAME_DESC), optratingNameDesc) + } + endStructure() + } + } + + companion object { + private const val TAG_RATING_NAME = 0 + private const val TAG_RATING_NAME_DESC = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ContentControlClusterRatingNameStruct { + tlvReader.enterStructure(tlvTag) + val ratingName = tlvReader.getString(ContextSpecificTag(TAG_RATING_NAME)) + val ratingNameDesc = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_RATING_NAME_DESC))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_RATING_NAME_DESC))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ContentControlClusterRatingNameStruct(ratingName, ratingNameDesc) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterPlaybackPreferencesStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterPlaybackPreferencesStruct.kt new file mode 100644 index 00000000000000..66cd44f198e5f8 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterPlaybackPreferencesStruct.kt @@ -0,0 +1,97 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ContentLauncherClusterPlaybackPreferencesStruct( + val playbackPosition: ULong, + val textTrack: ContentLauncherClusterTrackPreferenceStruct, + val audioTracks: Optional> +) { + override fun toString(): String = buildString { + append("ContentLauncherClusterPlaybackPreferencesStruct {\n") + append("\tplaybackPosition : $playbackPosition\n") + append("\ttextTrack : $textTrack\n") + append("\taudioTracks : $audioTracks\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_PLAYBACK_POSITION), playbackPosition) + textTrack.toTlv(ContextSpecificTag(TAG_TEXT_TRACK), this) + if (audioTracks.isPresent) { + val optaudioTracks = audioTracks.get() + startArray(ContextSpecificTag(TAG_AUDIO_TRACKS)) + for (item in optaudioTracks.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } + endStructure() + } + } + + companion object { + private const val TAG_PLAYBACK_POSITION = 0 + private const val TAG_TEXT_TRACK = 1 + private const val TAG_AUDIO_TRACKS = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader + ): ContentLauncherClusterPlaybackPreferencesStruct { + tlvReader.enterStructure(tlvTag) + val playbackPosition = tlvReader.getULong(ContextSpecificTag(TAG_PLAYBACK_POSITION)) + val textTrack = + ContentLauncherClusterTrackPreferenceStruct.fromTlv( + ContextSpecificTag(TAG_TEXT_TRACK), + tlvReader + ) + val audioTracks = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_TRACKS))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_AUDIO_TRACKS)) + while (!tlvReader.isEndOfContainer()) { + add(ContentLauncherClusterTrackPreferenceStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ContentLauncherClusterPlaybackPreferencesStruct( + playbackPosition, + textTrack, + audioTracks + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterTrackPreferenceStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterTrackPreferenceStruct.kt new file mode 100644 index 00000000000000..3dc13d4aed478e --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/ContentLauncherClusterTrackPreferenceStruct.kt @@ -0,0 +1,90 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ContentLauncherClusterTrackPreferenceStruct( + val languageCode: String, + val characteristics: Optional>, + val audioOutputIndex: UByte +) { + override fun toString(): String = buildString { + append("ContentLauncherClusterTrackPreferenceStruct {\n") + append("\tlanguageCode : $languageCode\n") + append("\tcharacteristics : $characteristics\n") + append("\taudioOutputIndex : $audioOutputIndex\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_LANGUAGE_CODE), languageCode) + if (characteristics.isPresent) { + val optcharacteristics = characteristics.get() + startArray(ContextSpecificTag(TAG_CHARACTERISTICS)) + for (item in optcharacteristics.iterator()) { + put(AnonymousTag, item) + } + endArray() + } + put(ContextSpecificTag(TAG_AUDIO_OUTPUT_INDEX), audioOutputIndex) + endStructure() + } + } + + companion object { + private const val TAG_LANGUAGE_CODE = 0 + private const val TAG_CHARACTERISTICS = 1 + private const val TAG_AUDIO_OUTPUT_INDEX = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ContentLauncherClusterTrackPreferenceStruct { + tlvReader.enterStructure(tlvTag) + val languageCode = tlvReader.getString(ContextSpecificTag(TAG_LANGUAGE_CODE)) + val characteristics = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CHARACTERISTICS))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_CHARACTERISTICS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val audioOutputIndex = tlvReader.getUByte(ContextSpecificTag(TAG_AUDIO_OUTPUT_INDEX)) + + tlvReader.exitContainer() + + return ContentLauncherClusterTrackPreferenceStruct( + languageCode, + characteristics, + audioOutputIndex + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterTrackAttributesStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterTrackAttributesStruct.kt new file mode 100644 index 00000000000000..2f0004844a3996 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterTrackAttributesStruct.kt @@ -0,0 +1,77 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import java.util.Optional +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class MediaPlaybackClusterTrackAttributesStruct( + val languageCode: String, + val displayName: Optional? +) { + override fun toString(): String = buildString { + append("MediaPlaybackClusterTrackAttributesStruct {\n") + append("\tlanguageCode : $languageCode\n") + append("\tdisplayName : $displayName\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_LANGUAGE_CODE), languageCode) + if (displayName != null) { + if (displayName.isPresent) { + val optdisplayName = displayName.get() + put(ContextSpecificTag(TAG_DISPLAY_NAME), optdisplayName) + } + } else { + putNull(ContextSpecificTag(TAG_DISPLAY_NAME)) + } + endStructure() + } + } + + companion object { + private const val TAG_LANGUAGE_CODE = 0 + private const val TAG_DISPLAY_NAME = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MediaPlaybackClusterTrackAttributesStruct { + tlvReader.enterStructure(tlvTag) + val languageCode = tlvReader.getString(ContextSpecificTag(TAG_LANGUAGE_CODE)) + val displayName = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DISPLAY_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_DISPLAY_NAME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_DISPLAY_NAME)) + null + } + + tlvReader.exitContainer() + + return MediaPlaybackClusterTrackAttributesStruct(languageCode, displayName) + } + } +} diff --git a/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt new file mode 100644 index 00000000000000..347b99dd6b0245 --- /dev/null +++ b/src/controller/java/generated/java/matter/devicecontroller/cluster/structs/MediaPlaybackClusterTrackStruct.kt @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.devicecontroller.cluster.structs + +import matter.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class MediaPlaybackClusterTrackStruct( + val id: String, + val trackAttributes: MediaPlaybackClusterTrackAttributesStruct? +) { + override fun toString(): String = buildString { + append("MediaPlaybackClusterTrackStruct {\n") + append("\tid : $id\n") + append("\ttrackAttributes : $trackAttributes\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ID), id) + if (trackAttributes != null) { + trackAttributes.toTlv(ContextSpecificTag(TAG_TRACK_ATTRIBUTES), this) + } else { + putNull(ContextSpecificTag(TAG_TRACK_ATTRIBUTES)) + } + endStructure() + } + } + + companion object { + private const val TAG_ID = 0 + private const val TAG_TRACK_ATTRIBUTES = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): MediaPlaybackClusterTrackStruct { + tlvReader.enterStructure(tlvTag) + val id = tlvReader.getString(ContextSpecificTag(TAG_ID)) + val trackAttributes = + if (!tlvReader.isNull()) { + MediaPlaybackClusterTrackAttributesStruct.fromTlv( + ContextSpecificTag(TAG_TRACK_ATTRIBUTES), + tlvReader + ) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TRACK_ATTRIBUTES)) + null + } + + tlvReader.exitContainer() + + return MediaPlaybackClusterTrackStruct(id, trackAttributes) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 97a9dbfde50f2f..f8378c15aaf01c 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -31894,6 +31894,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_affiliateCallSignInsideOptional, newElement_0_affiliateCallSign); } + jobject newElement_0_identifier; + if (!entry_0.identifier.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_identifier); + } + else + { + jobject newElement_0_identifierInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.identifier.Value(), + newElement_0_identifierInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_identifierInsideOptional, + newElement_0_identifier); + } + jobject newElement_0_type; + if (!entry_0.type.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_type); + } + else + { + jobject newElement_0_typeInsideOptional; + std::string newElement_0_typeInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_typeInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_typeInsideOptional = static_cast(entry_0.type.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_typeInsideOptionalClassName.c_str(), newElement_0_typeInsideOptionalCtorSignature.c_str(), + jninewElement_0_typeInsideOptional, newElement_0_typeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_typeInsideOptional, newElement_0_type); + } jclass channelInfoStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -31903,18 +31932,20 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); return nullptr; } - jmethodID channelInfoStructStructCtor_1 = env->GetMethodID( - channelInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); + jmethodID channelInfoStructStructCtor_1 = + env->GetMethodID(channelInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); if (channelInfoStructStructCtor_1 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); return nullptr; } - newElement_0 = env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, - newElement_0_majorNumber, newElement_0_minorNumber, newElement_0_name, - newElement_0_callSign, newElement_0_affiliateCallSign); + newElement_0 = + env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, newElement_0_majorNumber, + newElement_0_minorNumber, newElement_0_name, newElement_0_callSign, + newElement_0_affiliateCallSign, newElement_0_identifier, newElement_0_type); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -32057,6 +32088,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_affiliateCallSignInsideOptional, value_affiliateCallSign); } + jobject value_identifier; + if (!cppValue.Value().identifier.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_identifier); + } + else + { + jobject value_identifierInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().identifier.Value(), + value_identifierInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_identifierInsideOptional, value_identifier); + } + jobject value_type; + if (!cppValue.Value().type.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_type); + } + else + { + jobject value_typeInsideOptional; + std::string value_typeInsideOptionalClassName = "java/lang/Integer"; + std::string value_typeInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_typeInsideOptional = static_cast(cppValue.Value().type.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_typeInsideOptionalClassName.c_str(), value_typeInsideOptionalCtorSignature.c_str(), + jnivalue_typeInsideOptional, value_typeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_typeInsideOptional, value_type); + } jclass channelInfoStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -32066,9 +32125,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); return nullptr; } - jmethodID channelInfoStructStructCtor_1 = env->GetMethodID( - channelInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); + jmethodID channelInfoStructStructCtor_1 = + env->GetMethodID(channelInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); if (channelInfoStructStructCtor_1 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); @@ -32076,7 +32136,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } value = env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, value_majorNumber, - value_minorNumber, value_name, value_callSign, value_affiliateCallSign); + value_minorNumber, value_name, value_callSign, value_affiliateCallSign, value_identifier, + value_type); } return value; } @@ -32609,6 +32670,392 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } + case Attributes::ActiveAudioTrack::Id: { + using TypeInfo = Attributes::ActiveAudioTrack::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jobject value_id; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().id, value_id)); + jobject value_trackAttributes; + if (cppValue.Value().trackAttributes.IsNull()) + { + value_trackAttributes = nullptr; + } + else + { + jobject value_trackAttributes_languageCode; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.Value().trackAttributes.Value().languageCode, value_trackAttributes_languageCode)); + jobject value_trackAttributes_displayName; + if (!cppValue.Value().trackAttributes.Value().displayName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_trackAttributes_displayName); + } + else + { + jobject value_trackAttributes_displayNameInsideOptional; + if (cppValue.Value().trackAttributes.Value().displayName.Value().IsNull()) + { + value_trackAttributes_displayNameInsideOptional = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.Value().trackAttributes.Value().displayName.Value().Value(), + value_trackAttributes_displayNameInsideOptional)); + } + chip::JniReferences::GetInstance().CreateOptional(value_trackAttributes_displayNameInsideOptional, + value_trackAttributes_displayName); + } + + jclass trackAttributesStructStructClass_3; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + jmethodID trackAttributesStructStructCtor_3 = + env->GetMethodID(trackAttributesStructStructClass_3, "", "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (trackAttributesStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + value_trackAttributes = env->NewObject(trackAttributesStructStructClass_3, trackAttributesStructStructCtor_3, + value_trackAttributes_languageCode, value_trackAttributes_displayName); + } + + jclass trackStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); + return nullptr; + } + jmethodID trackStructStructCtor_1 = env->GetMethodID( + trackStructStructClass_1, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V"); + if (trackStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); + return nullptr; + } + + value = env->NewObject(trackStructStructClass_1, trackStructStructCtor_1, value_id, value_trackAttributes); + } + return value; + } + case Attributes::AvailableAudioTracks::Id: { + using TypeInfo = Attributes::AvailableAudioTracks::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_1 = cppValue.Value().begin(); + while (iter_value_1.Next()) + { + auto & entry_1 = iter_value_1.GetValue(); + jobject newElement_1; + jobject newElement_1_id; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.id, newElement_1_id)); + jobject newElement_1_trackAttributes; + if (entry_1.trackAttributes.IsNull()) + { + newElement_1_trackAttributes = nullptr; + } + else + { + jobject newElement_1_trackAttributes_languageCode; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_1.trackAttributes.Value().languageCode, newElement_1_trackAttributes_languageCode)); + jobject newElement_1_trackAttributes_displayName; + if (!entry_1.trackAttributes.Value().displayName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_1_trackAttributes_displayName); + } + else + { + jobject newElement_1_trackAttributes_displayNameInsideOptional; + if (entry_1.trackAttributes.Value().displayName.Value().IsNull()) + { + newElement_1_trackAttributes_displayNameInsideOptional = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_1.trackAttributes.Value().displayName.Value().Value(), + newElement_1_trackAttributes_displayNameInsideOptional)); + } + chip::JniReferences::GetInstance().CreateOptional( + newElement_1_trackAttributes_displayNameInsideOptional, newElement_1_trackAttributes_displayName); + } + + jclass trackAttributesStructStructClass_4; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + jmethodID trackAttributesStructStructCtor_4 = env->GetMethodID(trackAttributesStructStructClass_4, "", + "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (trackAttributesStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + newElement_1_trackAttributes = + env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, + newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); + } + + jclass trackStructStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); + return nullptr; + } + jmethodID trackStructStructCtor_2 = env->GetMethodID( + trackStructStructClass_2, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V"); + if (trackStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); + return nullptr; + } + + newElement_1 = env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, + newElement_1_trackAttributes); + chip::JniReferences::GetInstance().AddToList(value, newElement_1); + } + } + return value; + } + case Attributes::ActiveTextTrack::Id: { + using TypeInfo = Attributes::ActiveTextTrack::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jobject value_id; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().id, value_id)); + jobject value_trackAttributes; + if (cppValue.Value().trackAttributes.IsNull()) + { + value_trackAttributes = nullptr; + } + else + { + jobject value_trackAttributes_languageCode; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.Value().trackAttributes.Value().languageCode, value_trackAttributes_languageCode)); + jobject value_trackAttributes_displayName; + if (!cppValue.Value().trackAttributes.Value().displayName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_trackAttributes_displayName); + } + else + { + jobject value_trackAttributes_displayNameInsideOptional; + if (cppValue.Value().trackAttributes.Value().displayName.Value().IsNull()) + { + value_trackAttributes_displayNameInsideOptional = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.Value().trackAttributes.Value().displayName.Value().Value(), + value_trackAttributes_displayNameInsideOptional)); + } + chip::JniReferences::GetInstance().CreateOptional(value_trackAttributes_displayNameInsideOptional, + value_trackAttributes_displayName); + } + + jclass trackAttributesStructStructClass_3; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + jmethodID trackAttributesStructStructCtor_3 = + env->GetMethodID(trackAttributesStructStructClass_3, "", "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (trackAttributesStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + value_trackAttributes = env->NewObject(trackAttributesStructStructClass_3, trackAttributesStructStructCtor_3, + value_trackAttributes_languageCode, value_trackAttributes_displayName); + } + + jclass trackStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); + return nullptr; + } + jmethodID trackStructStructCtor_1 = env->GetMethodID( + trackStructStructClass_1, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V"); + if (trackStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); + return nullptr; + } + + value = env->NewObject(trackStructStructClass_1, trackStructStructCtor_1, value_id, value_trackAttributes); + } + return value; + } + case Attributes::AvailableTextTracks::Id: { + using TypeInfo = Attributes::AvailableTextTracks::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_1 = cppValue.Value().begin(); + while (iter_value_1.Next()) + { + auto & entry_1 = iter_value_1.GetValue(); + jobject newElement_1; + jobject newElement_1_id; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.id, newElement_1_id)); + jobject newElement_1_trackAttributes; + if (entry_1.trackAttributes.IsNull()) + { + newElement_1_trackAttributes = nullptr; + } + else + { + jobject newElement_1_trackAttributes_languageCode; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_1.trackAttributes.Value().languageCode, newElement_1_trackAttributes_languageCode)); + jobject newElement_1_trackAttributes_displayName; + if (!entry_1.trackAttributes.Value().displayName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_1_trackAttributes_displayName); + } + else + { + jobject newElement_1_trackAttributes_displayNameInsideOptional; + if (entry_1.trackAttributes.Value().displayName.Value().IsNull()) + { + newElement_1_trackAttributes_displayNameInsideOptional = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_1.trackAttributes.Value().displayName.Value().Value(), + newElement_1_trackAttributes_displayNameInsideOptional)); + } + chip::JniReferences::GetInstance().CreateOptional( + newElement_1_trackAttributes_displayNameInsideOptional, newElement_1_trackAttributes_displayName); + } + + jclass trackAttributesStructStructClass_4; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + jmethodID trackAttributesStructStructCtor_4 = env->GetMethodID(trackAttributesStructStructClass_4, "", + "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (trackAttributesStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + newElement_1_trackAttributes = + env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, + newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); + } + + jclass trackStructStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); + return nullptr; + } + jmethodID trackStructStructCtor_2 = env->GetMethodID( + trackStructStructClass_2, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V"); + if (trackStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); + return nullptr; + } + + newElement_1 = env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, + newElement_1_trackAttributes); + chip::JniReferences::GetInstance().AddToList(value, newElement_1); + } + } + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -34325,6 +34772,486 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::ContentControl::Id: { + using namespace app::Clusters::ContentControl; + switch (aPath.mAttributeId) + { + case Attributes::Enabled::Id: { + using TypeInfo = Attributes::Enabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::OnDemandRatings::Id: { + using TypeInfo = Attributes::OnDemandRatings::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_ratingName; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.ratingName, newElement_0_ratingName)); + jobject newElement_0_ratingNameDesc; + if (!entry_0.ratingNameDesc.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_ratingNameDesc); + } + else + { + jobject newElement_0_ratingNameDescInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.ratingNameDesc.Value(), newElement_0_ratingNameDescInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_ratingNameDescInsideOptional, + newElement_0_ratingNameDesc); + } + + jclass ratingNameStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", ratingNameStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); + return nullptr; + } + jmethodID ratingNameStructStructCtor_1 = + env->GetMethodID(ratingNameStructStructClass_1, "", "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (ratingNameStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, newElement_0_ratingName, + newElement_0_ratingNameDesc); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::OnDemandRatingThreshold::Id: { + using TypeInfo = Attributes::OnDemandRatingThreshold::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::ScheduledContentRatings::Id: { + using TypeInfo = Attributes::ScheduledContentRatings::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_ratingName; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.ratingName, newElement_0_ratingName)); + jobject newElement_0_ratingNameDesc; + if (!entry_0.ratingNameDesc.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_ratingNameDesc); + } + else + { + jobject newElement_0_ratingNameDescInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.ratingNameDesc.Value(), newElement_0_ratingNameDescInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_ratingNameDescInsideOptional, + newElement_0_ratingNameDesc); + } + + jclass ratingNameStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", ratingNameStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); + return nullptr; + } + jmethodID ratingNameStructStructCtor_1 = + env->GetMethodID(ratingNameStructStructClass_1, "", "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (ratingNameStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, newElement_0_ratingName, + newElement_0_ratingNameDesc); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::ScheduledContentRatingThreshold::Id: { + using TypeInfo = Attributes::ScheduledContentRatingThreshold::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::ScreenDailyTime::Id: { + using TypeInfo = Attributes::ScreenDailyTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::RemainingScreenTime::Id: { + using TypeInfo = Attributes::RemainingScreenTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::BlockUnrated::Id: { + using TypeInfo = Attributes::BlockUnrated::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::ContentAppObserver::Id: { + using namespace app::Clusters::ContentAppObserver; + switch (aPath.mAttributeId) + { + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::ElectricalMeasurement::Id: { using namespace app::Clusters::ElectricalMeasurement; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index 719e2592192f60..b319be9c1bafb3 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -988,6 +988,14 @@ typedef void (*TargetNavigatorEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*TargetNavigatorAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*MediaPlaybackAvailableAudioTracksListAttributeCallback)( + void * context, + const chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> & data); +typedef void (*MediaPlaybackAvailableTextTracksListAttributeCallback)( + void * context, + const chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> & data); typedef void (*MediaPlaybackGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*MediaPlaybackAcceptedCommandListListAttributeCallback)( @@ -1072,6 +1080,30 @@ typedef void (*AccountLoginEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AccountLoginAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*ContentControlOnDemandRatingsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +typedef void (*ContentControlScheduledContentRatingsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +typedef void (*ContentControlGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*ContentControlAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*ContentControlEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*ContentControlAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*ContentAppObserverGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*ContentAppObserverAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*ContentAppObserverEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*ContentAppObserverAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ElectricalMeasurementGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ElectricalMeasurementAcceptedCommandListListAttributeCallback)( diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 0101a65b66a52f..12c10ac9ecd6d3 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -5870,6 +5870,87 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & using namespace app::Clusters::TargetNavigator; switch (aPath.mEventId) { + case Events::TargetUpdated::Id: { + Events::TargetUpdated::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_targetList; + chip::JniReferences::GetInstance().CreateArrayList(value_targetList); + + auto iter_value_targetList_0 = cppValue.targetList.begin(); + while (iter_value_targetList_0.Next()) + { + auto & entry_0 = iter_value_targetList_0.GetValue(); + jobject newElement_0; + jobject newElement_0_identifier; + std::string newElement_0_identifierClassName = "java/lang/Integer"; + std::string newElement_0_identifierCtorSignature = "(I)V"; + jint jninewElement_0_identifier = static_cast(entry_0.identifier); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_identifierClassName.c_str(), + newElement_0_identifierCtorSignature.c_str(), + jninewElement_0_identifier, newElement_0_identifier); + jobject newElement_0_name; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); + + jclass targetInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TargetNavigatorClusterTargetInfoStruct", targetInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfoStruct"); + return nullptr; + } + jmethodID targetInfoStructStructCtor_1 = + env->GetMethodID(targetInfoStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (targetInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TargetNavigatorClusterTargetInfoStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(targetInfoStructStructClass_1, targetInfoStructStructCtor_1, newElement_0_identifier, + newElement_0_name); + chip::JniReferences::GetInstance().AddToList(value_targetList, newElement_0); + } + + jobject value_currentTarget; + std::string value_currentTargetClassName = "java/lang/Integer"; + std::string value_currentTargetCtorSignature = "(I)V"; + jint jnivalue_currentTarget = static_cast(cppValue.currentTarget); + chip::JniReferences::GetInstance().CreateBoxedObject(value_currentTargetClassName.c_str(), + value_currentTargetCtorSignature.c_str(), + jnivalue_currentTarget, value_currentTarget); + + jobject value_data; + jbyteArray value_dataByteArray = env->NewByteArray(static_cast(cppValue.data.size())); + env->SetByteArrayRegion(value_dataByteArray, 0, static_cast(cppValue.data.size()), + reinterpret_cast(cppValue.data.data())); + value_data = value_dataByteArray; + + jclass targetUpdatedStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TargetNavigatorClusterTargetUpdatedEvent", targetUpdatedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TargetNavigatorClusterTargetUpdatedEvent"); + return nullptr; + } + jmethodID targetUpdatedStructCtor = + env->GetMethodID(targetUpdatedStructClass, "", "(Ljava/util/ArrayList;Ljava/lang/Integer;[B)V"); + if (targetUpdatedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$TargetNavigatorClusterTargetUpdatedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(targetUpdatedStructClass, targetUpdatedStructCtor, value_targetList, value_currentTarget, + value_data); + + return value; + } default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; @@ -5880,6 +5961,150 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & using namespace app::Clusters::MediaPlayback; switch (aPath.mEventId) { + case Events::StateChanged::Id: { + Events::StateChanged::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_currentState; + std::string value_currentStateClassName = "java/lang/Integer"; + std::string value_currentStateCtorSignature = "(I)V"; + jint jnivalue_currentState = static_cast(cppValue.currentState); + chip::JniReferences::GetInstance().CreateBoxedObject(value_currentStateClassName.c_str(), + value_currentStateCtorSignature.c_str(), + jnivalue_currentState, value_currentState); + + jobject value_startTime; + std::string value_startTimeClassName = "java/lang/Long"; + std::string value_startTimeCtorSignature = "(J)V"; + jlong jnivalue_startTime = static_cast(cppValue.startTime); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_startTimeClassName.c_str(), value_startTimeCtorSignature.c_str(), jnivalue_startTime, value_startTime); + + jobject value_duration; + std::string value_durationClassName = "java/lang/Long"; + std::string value_durationCtorSignature = "(J)V"; + jlong jnivalue_duration = static_cast(cppValue.duration); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_durationClassName.c_str(), value_durationCtorSignature.c_str(), jnivalue_duration, value_duration); + + jobject value_sampledPosition; + jobject value_sampledPosition_updatedAt; + std::string value_sampledPosition_updatedAtClassName = "java/lang/Long"; + std::string value_sampledPosition_updatedAtCtorSignature = "(J)V"; + jlong jnivalue_sampledPosition_updatedAt = static_cast(cppValue.sampledPosition.updatedAt); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_sampledPosition_updatedAtClassName.c_str(), value_sampledPosition_updatedAtCtorSignature.c_str(), + jnivalue_sampledPosition_updatedAt, value_sampledPosition_updatedAt); + jobject value_sampledPosition_position; + if (cppValue.sampledPosition.position.IsNull()) + { + value_sampledPosition_position = nullptr; + } + else + { + std::string value_sampledPosition_positionClassName = "java/lang/Long"; + std::string value_sampledPosition_positionCtorSignature = "(J)V"; + jlong jnivalue_sampledPosition_position = static_cast(cppValue.sampledPosition.position.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_sampledPosition_positionClassName.c_str(), value_sampledPosition_positionCtorSignature.c_str(), + jnivalue_sampledPosition_position, value_sampledPosition_position); + } + + jclass playbackPositionStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterPlaybackPositionStruct", + playbackPositionStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterPlaybackPositionStruct"); + return nullptr; + } + jmethodID playbackPositionStructStructCtor_0 = + env->GetMethodID(playbackPositionStructStructClass_0, "", "(Ljava/lang/Long;Ljava/lang/Long;)V"); + if (playbackPositionStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterPlaybackPositionStruct constructor"); + return nullptr; + } + + value_sampledPosition = env->NewObject(playbackPositionStructStructClass_0, playbackPositionStructStructCtor_0, + value_sampledPosition_updatedAt, value_sampledPosition_position); + + jobject value_playbackSpeed; + std::string value_playbackSpeedClassName = "java/lang/Float"; + std::string value_playbackSpeedCtorSignature = "(F)V"; + jfloat jnivalue_playbackSpeed = static_cast(cppValue.playbackSpeed); + chip::JniReferences::GetInstance().CreateBoxedObject(value_playbackSpeedClassName.c_str(), + value_playbackSpeedCtorSignature.c_str(), + jnivalue_playbackSpeed, value_playbackSpeed); + + jobject value_seekRangeEnd; + std::string value_seekRangeEndClassName = "java/lang/Long"; + std::string value_seekRangeEndCtorSignature = "(J)V"; + jlong jnivalue_seekRangeEnd = static_cast(cppValue.seekRangeEnd); + chip::JniReferences::GetInstance().CreateBoxedObject(value_seekRangeEndClassName.c_str(), + value_seekRangeEndCtorSignature.c_str(), + jnivalue_seekRangeEnd, value_seekRangeEnd); + + jobject value_seekRangeStart; + std::string value_seekRangeStartClassName = "java/lang/Long"; + std::string value_seekRangeStartCtorSignature = "(J)V"; + jlong jnivalue_seekRangeStart = static_cast(cppValue.seekRangeStart); + chip::JniReferences::GetInstance().CreateBoxedObject(value_seekRangeStartClassName.c_str(), + value_seekRangeStartCtorSignature.c_str(), + jnivalue_seekRangeStart, value_seekRangeStart); + + jobject value_data; + if (!cppValue.data.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_data); + } + else + { + jobject value_dataInsideOptional; + jbyteArray value_dataInsideOptionalByteArray = env->NewByteArray(static_cast(cppValue.data.Value().size())); + env->SetByteArrayRegion(value_dataInsideOptionalByteArray, 0, static_cast(cppValue.data.Value().size()), + reinterpret_cast(cppValue.data.Value().data())); + value_dataInsideOptional = value_dataInsideOptionalByteArray; + chip::JniReferences::GetInstance().CreateOptional(value_dataInsideOptional, value_data); + } + + jobject value_audioAdvanceUnmuted; + std::string value_audioAdvanceUnmutedClassName = "java/lang/Boolean"; + std::string value_audioAdvanceUnmutedCtorSignature = "(Z)V"; + jboolean jnivalue_audioAdvanceUnmuted = static_cast(cppValue.audioAdvanceUnmuted); + chip::JniReferences::GetInstance().CreateBoxedObject(value_audioAdvanceUnmutedClassName.c_str(), + value_audioAdvanceUnmutedCtorSignature.c_str(), + jnivalue_audioAdvanceUnmuted, value_audioAdvanceUnmuted); + + jclass stateChangedStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$MediaPlaybackClusterStateChangedEvent", stateChangedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$MediaPlaybackClusterStateChangedEvent"); + return nullptr; + } + jmethodID stateChangedStructCtor = + env->GetMethodID(stateChangedStructClass, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Lchip/devicecontroller/" + "ChipStructs$MediaPlaybackClusterPlaybackPositionStruct;Ljava/lang/Float;Ljava/lang/Long;Ljava/" + "lang/Long;Ljava/util/Optional;Ljava/lang/Boolean;)V"); + if (stateChangedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$MediaPlaybackClusterStateChangedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(stateChangedStructClass, stateChangedStructCtor, value_currentState, value_startTime, + value_duration, value_sampledPosition, value_playbackSpeed, value_seekRangeEnd, + value_seekRangeStart, value_data, value_audioAdvanceUnmuted); + + return value; + } default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; @@ -5960,6 +6185,98 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & using namespace app::Clusters::AccountLogin; switch (aPath.mEventId) { + case Events::LoggedOut::Id: { + Events::LoggedOut::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_node; + if (!cppValue.node.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_node); + } + else + { + jobject value_nodeInsideOptional; + std::string value_nodeInsideOptionalClassName = "java/lang/Long"; + std::string value_nodeInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_nodeInsideOptional = static_cast(cppValue.node.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(value_nodeInsideOptionalClassName.c_str(), + value_nodeInsideOptionalCtorSignature.c_str(), + jnivalue_nodeInsideOptional, value_nodeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_nodeInsideOptional, value_node); + } + + jclass loggedOutStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$AccountLoginClusterLoggedOutEvent", loggedOutStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$AccountLoginClusterLoggedOutEvent"); + return nullptr; + } + jmethodID loggedOutStructCtor = env->GetMethodID(loggedOutStructClass, "", "(Ljava/util/Optional;)V"); + if (loggedOutStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$AccountLoginClusterLoggedOutEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(loggedOutStructClass, loggedOutStructCtor, value_node); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::ContentControl::Id: { + using namespace app::Clusters::ContentControl; + switch (aPath.mEventId) + { + case Events::RemainingScreenTimeExpired::Id: { + Events::RemainingScreenTimeExpired::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass remainingScreenTimeExpiredStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$ContentControlClusterRemainingScreenTimeExpiredEvent", + remainingScreenTimeExpiredStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ContentControlClusterRemainingScreenTimeExpiredEvent"); + return nullptr; + } + jmethodID remainingScreenTimeExpiredStructCtor = + env->GetMethodID(remainingScreenTimeExpiredStructClass, "", "()V"); + if (remainingScreenTimeExpiredStructCtor == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipEventStructs$ContentControlClusterRemainingScreenTimeExpiredEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(remainingScreenTimeExpiredStructClass, remainingScreenTimeExpiredStructCtor); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::ContentAppObserver::Id: { + using namespace app::Clusters::ContentAppObserver; + switch (aPath.mEventId) + { default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 1fd6b07d2068a0..6b14927999f48a 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -5044,6 +5044,554 @@ void CHIPChannelClusterChangeChannelResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data); } +CHIPChannelClusterProgramGuideResponseCallback::CHIPChannelClusterProgramGuideResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPChannelClusterProgramGuideResponseCallback::~CHIPChannelClusterProgramGuideResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPChannelClusterProgramGuideResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Channel::Commands::ProgramGuideResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/ArrayList;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject ChannelPagingStruct; + std::string ChannelPagingStructClassName = "java/lang/Integer"; + std::string ChannelPagingStructCtorSignature = "(I)V"; + jint jniChannelPagingStruct = static_cast(dataResponse.channelPagingStruct); + chip::JniReferences::GetInstance().CreateBoxedObject(ChannelPagingStructClassName.c_str(), + ChannelPagingStructCtorSignature.c_str(), jniChannelPagingStruct, + ChannelPagingStruct); + jobject ProgramList; + chip::JniReferences::GetInstance().CreateArrayList(ProgramList); + + auto iter_ProgramList_0 = dataResponse.programList.begin(); + while (iter_ProgramList_0.Next()) + { + auto & entry_0 = iter_ProgramList_0.GetValue(); + jobject newElement_0; + jobject newElement_0_identifier; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.identifier, newElement_0_identifier)); + jobject newElement_0_channel; + jobject newElement_0_channel_majorNumber; + std::string newElement_0_channel_majorNumberClassName = "java/lang/Integer"; + std::string newElement_0_channel_majorNumberCtorSignature = "(I)V"; + jint jninewElement_0_channel_majorNumber = static_cast(entry_0.channel.majorNumber); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_channel_majorNumberClassName.c_str(), newElement_0_channel_majorNumberCtorSignature.c_str(), + jninewElement_0_channel_majorNumber, newElement_0_channel_majorNumber); + jobject newElement_0_channel_minorNumber; + std::string newElement_0_channel_minorNumberClassName = "java/lang/Integer"; + std::string newElement_0_channel_minorNumberCtorSignature = "(I)V"; + jint jninewElement_0_channel_minorNumber = static_cast(entry_0.channel.minorNumber); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_channel_minorNumberClassName.c_str(), newElement_0_channel_minorNumberCtorSignature.c_str(), + jninewElement_0_channel_minorNumber, newElement_0_channel_minorNumber); + jobject newElement_0_channel_name; + if (!entry_0.channel.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_channel_name); + } + else + { + jobject newElement_0_channel_nameInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.channel.name.Value(), + newElement_0_channel_nameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_channel_nameInsideOptional, newElement_0_channel_name); + } + jobject newElement_0_channel_callSign; + if (!entry_0.channel.callSign.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_channel_callSign); + } + else + { + jobject newElement_0_channel_callSignInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.channel.callSign.Value(), + newElement_0_channel_callSignInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_channel_callSignInsideOptional, + newElement_0_channel_callSign); + } + jobject newElement_0_channel_affiliateCallSign; + if (!entry_0.channel.affiliateCallSign.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_channel_affiliateCallSign); + } + else + { + jobject newElement_0_channel_affiliateCallSignInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.channel.affiliateCallSign.Value(), newElement_0_channel_affiliateCallSignInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_channel_affiliateCallSignInsideOptional, + newElement_0_channel_affiliateCallSign); + } + jobject newElement_0_channel_identifier; + if (!entry_0.channel.identifier.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_channel_identifier); + } + else + { + jobject newElement_0_channel_identifierInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.channel.identifier.Value(), + newElement_0_channel_identifierInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_channel_identifierInsideOptional, + newElement_0_channel_identifier); + } + jobject newElement_0_channel_type; + if (!entry_0.channel.type.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_channel_type); + } + else + { + jobject newElement_0_channel_typeInsideOptional; + std::string newElement_0_channel_typeInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_channel_typeInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_channel_typeInsideOptional = static_cast(entry_0.channel.type.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_channel_typeInsideOptionalClassName.c_str(), + newElement_0_channel_typeInsideOptionalCtorSignature.c_str(), + jninewElement_0_channel_typeInsideOptional, + newElement_0_channel_typeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_channel_typeInsideOptional, newElement_0_channel_type); + } + + jclass channelInfoStructStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfoStruct", channelInfoStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); + return; + } + jmethodID channelInfoStructStructCtor_2 = + env->GetMethodID(channelInfoStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (channelInfoStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); + return; + } + + newElement_0_channel = + env->NewObject(channelInfoStructStructClass_2, channelInfoStructStructCtor_2, newElement_0_channel_majorNumber, + newElement_0_channel_minorNumber, newElement_0_channel_name, newElement_0_channel_callSign, + newElement_0_channel_affiliateCallSign, newElement_0_channel_identifier, newElement_0_channel_type); + jobject newElement_0_startTime; + std::string newElement_0_startTimeClassName = "java/lang/Long"; + std::string newElement_0_startTimeCtorSignature = "(J)V"; + jlong jninewElement_0_startTime = static_cast(entry_0.startTime); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_startTimeClassName.c_str(), + newElement_0_startTimeCtorSignature.c_str(), + jninewElement_0_startTime, newElement_0_startTime); + jobject newElement_0_endTime; + std::string newElement_0_endTimeClassName = "java/lang/Long"; + std::string newElement_0_endTimeCtorSignature = "(J)V"; + jlong jninewElement_0_endTime = static_cast(entry_0.endTime); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_endTimeClassName.c_str(), + newElement_0_endTimeCtorSignature.c_str(), + jninewElement_0_endTime, newElement_0_endTime); + jobject newElement_0_title; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.title, newElement_0_title)); + jobject newElement_0_subtitle; + if (!entry_0.subtitle.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_subtitle); + } + else + { + jobject newElement_0_subtitleInsideOptional; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.subtitle.Value(), newElement_0_subtitleInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_subtitleInsideOptional, newElement_0_subtitle); + } + jobject newElement_0_description; + if (!entry_0.description.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_description); + } + else + { + jobject newElement_0_descriptionInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.description.Value(), + newElement_0_descriptionInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_descriptionInsideOptional, newElement_0_description); + } + jobject newElement_0_audioLanguages; + if (!entry_0.audioLanguages.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_audioLanguages); + } + else + { + jobject newElement_0_audioLanguagesInsideOptional; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_audioLanguagesInsideOptional); + + auto iter_newElement_0_audioLanguagesInsideOptional_3 = entry_0.audioLanguages.Value().begin(); + while (iter_newElement_0_audioLanguagesInsideOptional_3.Next()) + { + auto & entry_3 = iter_newElement_0_audioLanguagesInsideOptional_3.GetValue(); + jobject newElement_3; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_3, newElement_3)); + chip::JniReferences::GetInstance().AddToList(newElement_0_audioLanguagesInsideOptional, newElement_3); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_0_audioLanguagesInsideOptional, + newElement_0_audioLanguages); + } + jobject newElement_0_ratings; + if (!entry_0.ratings.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_ratings); + } + else + { + jobject newElement_0_ratingsInsideOptional; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_ratingsInsideOptional); + + auto iter_newElement_0_ratingsInsideOptional_3 = entry_0.ratings.Value().begin(); + while (iter_newElement_0_ratingsInsideOptional_3.Next()) + { + auto & entry_3 = iter_newElement_0_ratingsInsideOptional_3.GetValue(); + jobject newElement_3; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_3, newElement_3)); + chip::JniReferences::GetInstance().AddToList(newElement_0_ratingsInsideOptional, newElement_3); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_0_ratingsInsideOptional, newElement_0_ratings); + } + jobject newElement_0_thumbnailUrl; + if (!entry_0.thumbnailUrl.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_thumbnailUrl); + } + else + { + jobject newElement_0_thumbnailUrlInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.thumbnailUrl.Value(), + newElement_0_thumbnailUrlInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_thumbnailUrlInsideOptional, newElement_0_thumbnailUrl); + } + jobject newElement_0_posterArtUrl; + if (!entry_0.posterArtUrl.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_posterArtUrl); + } + else + { + jobject newElement_0_posterArtUrlInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.posterArtUrl.Value(), + newElement_0_posterArtUrlInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_posterArtUrlInsideOptional, newElement_0_posterArtUrl); + } + jobject newElement_0_dvbiUrl; + if (!entry_0.dvbiUrl.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_dvbiUrl); + } + else + { + jobject newElement_0_dvbiUrlInsideOptional; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.dvbiUrl.Value(), newElement_0_dvbiUrlInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_dvbiUrlInsideOptional, newElement_0_dvbiUrl); + } + jobject newElement_0_releaseDate; + if (!entry_0.releaseDate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_releaseDate); + } + else + { + jobject newElement_0_releaseDateInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.releaseDate.Value(), + newElement_0_releaseDateInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_releaseDateInsideOptional, newElement_0_releaseDate); + } + jobject newElement_0_parentalGuidanceText; + if (!entry_0.parentalGuidanceText.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_parentalGuidanceText); + } + else + { + jobject newElement_0_parentalGuidanceTextInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.parentalGuidanceText.Value(), + newElement_0_parentalGuidanceTextInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_parentalGuidanceTextInsideOptional, + newElement_0_parentalGuidanceText); + } + jobject newElement_0_recordingFlag; + if (!entry_0.recordingFlag.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_recordingFlag); + } + else + { + jobject newElement_0_recordingFlagInsideOptional; + std::string newElement_0_recordingFlagInsideOptionalClassName = "java/lang/Long"; + std::string newElement_0_recordingFlagInsideOptionalCtorSignature = "(J)V"; + jlong jninewElement_0_recordingFlagInsideOptional = static_cast(entry_0.recordingFlag.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_recordingFlagInsideOptionalClassName.c_str(), + newElement_0_recordingFlagInsideOptionalCtorSignature.c_str(), jninewElement_0_recordingFlagInsideOptional, + newElement_0_recordingFlagInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_recordingFlagInsideOptional, newElement_0_recordingFlag); + } + jobject newElement_0_seriesInfo; + if (!entry_0.seriesInfo.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_seriesInfo); + } + else + { + jobject newElement_0_seriesInfoInsideOptional; + if (entry_0.seriesInfo.Value().IsNull()) + { + newElement_0_seriesInfoInsideOptional = nullptr; + } + else + { + jobject newElement_0_seriesInfoInsideOptional_season; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.seriesInfo.Value().Value().season, + newElement_0_seriesInfoInsideOptional_season)); + jobject newElement_0_seriesInfoInsideOptional_episode; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.seriesInfo.Value().Value().episode, newElement_0_seriesInfoInsideOptional_episode)); + + jclass seriesInfoStructStructClass_4; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterSeriesInfoStruct", seriesInfoStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterSeriesInfoStruct"); + return; + } + jmethodID seriesInfoStructStructCtor_4 = + env->GetMethodID(seriesInfoStructStructClass_4, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (seriesInfoStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterSeriesInfoStruct constructor"); + return; + } + + newElement_0_seriesInfoInsideOptional = + env->NewObject(seriesInfoStructStructClass_4, seriesInfoStructStructCtor_4, + newElement_0_seriesInfoInsideOptional_season, newElement_0_seriesInfoInsideOptional_episode); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_0_seriesInfoInsideOptional, newElement_0_seriesInfo); + } + jobject newElement_0_categoryList; + if (!entry_0.categoryList.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_categoryList); + } + else + { + jobject newElement_0_categoryListInsideOptional; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_categoryListInsideOptional); + + auto iter_newElement_0_categoryListInsideOptional_3 = entry_0.categoryList.Value().begin(); + while (iter_newElement_0_categoryListInsideOptional_3.Next()) + { + auto & entry_3 = iter_newElement_0_categoryListInsideOptional_3.GetValue(); + jobject newElement_3; + jobject newElement_3_category; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_3.category, newElement_3_category)); + jobject newElement_3_subCategory; + if (!entry_3.subCategory.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_subCategory); + } + else + { + jobject newElement_3_subCategoryInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_3.subCategory.Value(), + newElement_3_subCategoryInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_3_subCategoryInsideOptional, + newElement_3_subCategory); + } + + jclass programCategoryStructStructClass_4; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterProgramCategoryStruct", + programCategoryStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterProgramCategoryStruct"); + return; + } + jmethodID programCategoryStructStructCtor_4 = + env->GetMethodID(programCategoryStructStructClass_4, "", "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (programCategoryStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterProgramCategoryStruct constructor"); + return; + } + + newElement_3 = env->NewObject(programCategoryStructStructClass_4, programCategoryStructStructCtor_4, + newElement_3_category, newElement_3_subCategory); + chip::JniReferences::GetInstance().AddToList(newElement_0_categoryListInsideOptional, newElement_3); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_0_categoryListInsideOptional, newElement_0_categoryList); + } + jobject newElement_0_castList; + if (!entry_0.castList.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_castList); + } + else + { + jobject newElement_0_castListInsideOptional; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_castListInsideOptional); + + auto iter_newElement_0_castListInsideOptional_3 = entry_0.castList.Value().begin(); + while (iter_newElement_0_castListInsideOptional_3.Next()) + { + auto & entry_3 = iter_newElement_0_castListInsideOptional_3.GetValue(); + jobject newElement_3; + jobject newElement_3_name; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_3.name, newElement_3_name)); + jobject newElement_3_role; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_3.role, newElement_3_role)); + + jclass programCastStructStructClass_4; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterProgramCastStruct", programCastStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterProgramCastStruct"); + return; + } + jmethodID programCastStructStructCtor_4 = + env->GetMethodID(programCastStructStructClass_4, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (programCastStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterProgramCastStruct constructor"); + return; + } + + newElement_3 = env->NewObject(programCastStructStructClass_4, programCastStructStructCtor_4, newElement_3_name, + newElement_3_role); + chip::JniReferences::GetInstance().AddToList(newElement_0_castListInsideOptional, newElement_3); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_0_castListInsideOptional, newElement_0_castList); + } + jobject newElement_0_externalIDList; + if (!entry_0.externalIDList.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_externalIDList); + } + else + { + jobject newElement_0_externalIDListInsideOptional; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_externalIDListInsideOptional); + + auto iter_newElement_0_externalIDListInsideOptional_3 = entry_0.externalIDList.Value().begin(); + while (iter_newElement_0_externalIDListInsideOptional_3.Next()) + { + auto & entry_3 = iter_newElement_0_externalIDListInsideOptional_3.GetValue(); + jobject newElement_3; + jobject newElement_3_name; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_3.name, newElement_3_name)); + jobject newElement_3_role; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_3.role, newElement_3_role)); + + jclass programCastStructStructClass_4; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterProgramCastStruct", programCastStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterProgramCastStruct"); + return; + } + jmethodID programCastStructStructCtor_4 = + env->GetMethodID(programCastStructStructClass_4, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (programCastStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterProgramCastStruct constructor"); + return; + } + + newElement_3 = env->NewObject(programCastStructStructClass_4, programCastStructStructCtor_4, newElement_3_name, + newElement_3_role); + chip::JniReferences::GetInstance().AddToList(newElement_0_externalIDListInsideOptional, newElement_3); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_0_externalIDListInsideOptional, + newElement_0_externalIDList); + } + + jclass programStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$ChannelClusterProgramStruct", + programStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterProgramStruct"); + return; + } + jmethodID programStructStructCtor_1 = env->GetMethodID( + programStructStructClass_1, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$ChannelClusterChannelInfoStruct;Ljava/lang/Long;Ljava/lang/" + "Long;Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (programStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterProgramStruct constructor"); + return; + } + + newElement_0 = env->NewObject( + programStructStructClass_1, programStructStructCtor_1, newElement_0_identifier, newElement_0_channel, + newElement_0_startTime, newElement_0_endTime, newElement_0_title, newElement_0_subtitle, newElement_0_description, + newElement_0_audioLanguages, newElement_0_ratings, newElement_0_thumbnailUrl, newElement_0_posterArtUrl, + newElement_0_dvbiUrl, newElement_0_releaseDate, newElement_0_parentalGuidanceText, newElement_0_recordingFlag, + newElement_0_seriesInfo, newElement_0_categoryList, newElement_0_castList, newElement_0_externalIDList); + chip::JniReferences::GetInstance().AddToList(ProgramList, newElement_0); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, ChannelPagingStruct, ProgramList); +} CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CHIPTargetNavigatorClusterNavigateTargetResponseCallback( jobject javaCallback) : Callback::Callback(CallbackFn, this) { @@ -5455,6 +6003,140 @@ void CHIPAccountLoginClusterGetSetupPINResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, SetupPIN); } +CHIPContentControlClusterResetPINResponseCallback::CHIPContentControlClusterResetPINResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentControlClusterResetPINResponseCallback::~CHIPContentControlClusterResetPINResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPContentControlClusterResetPINResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::ContentControl::Commands::ResetPINResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject PINCode; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.PINCode, PINCode)); + + env->CallVoidMethod(javaCallbackRef, javaMethod, PINCode); +} +CHIPContentAppObserverClusterContentAppMessageResponseCallback::CHIPContentAppObserverClusterContentAppMessageResponseCallback( + jobject javaCallback) : Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentAppObserverClusterContentAppMessageResponseCallback::~CHIPContentAppObserverClusterContentAppMessageResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPContentAppObserverClusterContentAppMessageResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/util/Optional;Ljava/lang/String;Ljava/lang/String;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject Status; + if (!dataResponse.status.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, Status); + } + else + { + jobject StatusInsideOptional; + std::string StatusInsideOptionalClassName = "java/lang/Integer"; + std::string StatusInsideOptionalCtorSignature = "(I)V"; + jint jniStatusInsideOptional = static_cast(dataResponse.status.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(StatusInsideOptionalClassName.c_str(), + StatusInsideOptionalCtorSignature.c_str(), + jniStatusInsideOptional, StatusInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(StatusInsideOptional, Status); + } + jobject Data; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.data, Data)); + jobject EncodingHint; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.encodingHint, EncodingHint)); + + env->CallVoidMethod(javaCallbackRef, javaMethod, Status, Data, EncodingHint); +} CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback:: CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index e280da36f6237b..23b691e07a332b 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -781,6 +781,20 @@ class CHIPChannelClusterChangeChannelResponseCallback jobject javaCallbackRef; }; +class CHIPChannelClusterProgramGuideResponseCallback : public Callback::Callback +{ +public: + CHIPChannelClusterProgramGuideResponseCallback(jobject javaCallback); + + ~CHIPChannelClusterProgramGuideResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::Channel::Commands::ProgramGuideResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPTargetNavigatorClusterNavigateTargetResponseCallback : public Callback::Callback { @@ -869,6 +883,37 @@ class CHIPAccountLoginClusterGetSetupPINResponseCallback jobject javaCallbackRef; }; +class CHIPContentControlClusterResetPINResponseCallback + : public Callback::Callback +{ +public: + CHIPContentControlClusterResetPINResponseCallback(jobject javaCallback); + + ~CHIPContentControlClusterResetPINResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::ContentControl::Commands::ResetPINResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPContentAppObserverClusterContentAppMessageResponseCallback + : public Callback::Callback +{ +public: + CHIPContentAppObserverClusterContentAppMessageResponseCallback(jobject javaCallback); + + ~CHIPContentAppObserverClusterContentAppMessageResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPElectricalMeasurementClusterGetProfileInfoResponseCommandCallback : public Callback::Callback { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 7d1ed3695fe5ab..7437f04c99f4bc 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -49742,6 +49742,34 @@ void CHIPChannelChannelListAttributeCallback::CallbackFn( chip::JniReferences::GetInstance().CreateOptional(newElement_0_affiliateCallSignInsideOptional, newElement_0_affiliateCallSign); } + jobject newElement_0_identifier; + if (!entry_0.identifier.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_identifier); + } + else + { + jobject newElement_0_identifierInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.identifier.Value(), + newElement_0_identifierInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_identifierInsideOptional, newElement_0_identifier); + } + jobject newElement_0_type; + if (!entry_0.type.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_type); + } + else + { + jobject newElement_0_typeInsideOptional; + std::string newElement_0_typeInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_typeInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_typeInsideOptional = static_cast(entry_0.type.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_typeInsideOptionalClassName.c_str(), newElement_0_typeInsideOptionalCtorSignature.c_str(), + jninewElement_0_typeInsideOptional, newElement_0_typeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_typeInsideOptional, newElement_0_type); + } jclass channelInfoStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -49751,18 +49779,19 @@ void CHIPChannelChannelListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); return; } - jmethodID channelInfoStructStructCtor_1 = env->GetMethodID( - channelInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); + jmethodID channelInfoStructStructCtor_1 = + env->GetMethodID(channelInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V"); if (channelInfoStructStructCtor_1 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); return; } - newElement_0 = - env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, newElement_0_majorNumber, - newElement_0_minorNumber, newElement_0_name, newElement_0_callSign, newElement_0_affiliateCallSign); + newElement_0 = env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, newElement_0_majorNumber, + newElement_0_minorNumber, newElement_0_name, newElement_0_callSign, + newElement_0_affiliateCallSign, newElement_0_identifier, newElement_0_type); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -50697,6 +50726,308 @@ void CHIPMediaPlaybackSeekRangeStartAttributeCallback::CallbackFn(void * context env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } +CHIPMediaPlaybackAvailableAudioTracksAttributeCallback::CHIPMediaPlaybackAvailableAudioTracksAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackAvailableAudioTracksAttributeCallback::~CHIPMediaPlaybackAvailableAudioTracksAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPMediaPlaybackAvailableAudioTracksAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + if (list.IsNull()) + { + arrayListObj = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_1 = list.Value().begin(); + while (iter_arrayListObj_1.Next()) + { + auto & entry_1 = iter_arrayListObj_1.GetValue(); + jobject newElement_1; + jobject newElement_1_id; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.id, newElement_1_id)); + jobject newElement_1_trackAttributes; + if (entry_1.trackAttributes.IsNull()) + { + newElement_1_trackAttributes = nullptr; + } + else + { + jobject newElement_1_trackAttributes_languageCode; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.trackAttributes.Value().languageCode, + newElement_1_trackAttributes_languageCode)); + jobject newElement_1_trackAttributes_displayName; + if (!entry_1.trackAttributes.Value().displayName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_1_trackAttributes_displayName); + } + else + { + jobject newElement_1_trackAttributes_displayNameInsideOptional; + if (entry_1.trackAttributes.Value().displayName.Value().IsNull()) + { + newElement_1_trackAttributes_displayNameInsideOptional = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_1.trackAttributes.Value().displayName.Value().Value(), + newElement_1_trackAttributes_displayNameInsideOptional)); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_1_trackAttributes_displayNameInsideOptional, + newElement_1_trackAttributes_displayName); + } + + jclass trackAttributesStructStructClass_4; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return; + } + jmethodID trackAttributesStructStructCtor_4 = + env->GetMethodID(trackAttributesStructStructClass_4, "", "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (trackAttributesStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return; + } + + newElement_1_trackAttributes = + env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, + newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); + } + + jclass trackStructStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); + return; + } + jmethodID trackStructStructCtor_2 = env->GetMethodID( + trackStructStructClass_2, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V"); + if (trackStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); + return; + } + + newElement_1 = + env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, newElement_1_trackAttributes); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_1); + } + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPMediaPlaybackAvailableTextTracksAttributeCallback::CHIPMediaPlaybackAvailableTextTracksAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPMediaPlaybackAvailableTextTracksAttributeCallback::~CHIPMediaPlaybackAvailableTextTracksAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPMediaPlaybackAvailableTextTracksAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + if (list.IsNull()) + { + arrayListObj = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_1 = list.Value().begin(); + while (iter_arrayListObj_1.Next()) + { + auto & entry_1 = iter_arrayListObj_1.GetValue(); + jobject newElement_1; + jobject newElement_1_id; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.id, newElement_1_id)); + jobject newElement_1_trackAttributes; + if (entry_1.trackAttributes.IsNull()) + { + newElement_1_trackAttributes = nullptr; + } + else + { + jobject newElement_1_trackAttributes_languageCode; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.trackAttributes.Value().languageCode, + newElement_1_trackAttributes_languageCode)); + jobject newElement_1_trackAttributes_displayName; + if (!entry_1.trackAttributes.Value().displayName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_1_trackAttributes_displayName); + } + else + { + jobject newElement_1_trackAttributes_displayNameInsideOptional; + if (entry_1.trackAttributes.Value().displayName.Value().IsNull()) + { + newElement_1_trackAttributes_displayNameInsideOptional = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_1.trackAttributes.Value().displayName.Value().Value(), + newElement_1_trackAttributes_displayNameInsideOptional)); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_1_trackAttributes_displayNameInsideOptional, + newElement_1_trackAttributes_displayName); + } + + jclass trackAttributesStructStructClass_4; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return; + } + jmethodID trackAttributesStructStructCtor_4 = + env->GetMethodID(trackAttributesStructStructClass_4, "", "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (trackAttributesStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return; + } + + newElement_1_trackAttributes = + env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, + newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); + } + + jclass trackStructStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); + return; + } + jmethodID trackStructStructCtor_2 = env->GetMethodID( + trackStructStructClass_2, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V"); + if (trackStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); + return; + } + + newElement_1 = + env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, newElement_1_trackAttributes); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_1); + } + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPMediaPlaybackGeneratedCommandListAttributeCallback::CHIPMediaPlaybackGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), @@ -53670,6 +54001,781 @@ void CHIPAccountLoginAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPContentControlOnDemandRatingsAttributeCallback::CHIPContentControlOnDemandRatingsAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentControlOnDemandRatingsAttributeCallback::~CHIPContentControlOnDemandRatingsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentControlOnDemandRatingsAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_ratingName; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.ratingName, newElement_0_ratingName)); + jobject newElement_0_ratingNameDesc; + if (!entry_0.ratingNameDesc.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_ratingNameDesc); + } + else + { + jobject newElement_0_ratingNameDescInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.ratingNameDesc.Value(), + newElement_0_ratingNameDescInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_ratingNameDescInsideOptional, + newElement_0_ratingNameDesc); + } + + jclass ratingNameStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", ratingNameStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); + return; + } + jmethodID ratingNameStructStructCtor_1 = + env->GetMethodID(ratingNameStructStructClass_1, "", "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (ratingNameStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); + return; + } + + newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, newElement_0_ratingName, + newElement_0_ratingNameDesc); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPContentControlScheduledContentRatingsAttributeCallback::CHIPContentControlScheduledContentRatingsAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentControlScheduledContentRatingsAttributeCallback::~CHIPContentControlScheduledContentRatingsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentControlScheduledContentRatingsAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_ratingName; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.ratingName, newElement_0_ratingName)); + jobject newElement_0_ratingNameDesc; + if (!entry_0.ratingNameDesc.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_ratingNameDesc); + } + else + { + jobject newElement_0_ratingNameDescInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.ratingNameDesc.Value(), + newElement_0_ratingNameDescInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_ratingNameDescInsideOptional, + newElement_0_ratingNameDesc); + } + + jclass ratingNameStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", ratingNameStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); + return; + } + jmethodID ratingNameStructStructCtor_1 = + env->GetMethodID(ratingNameStructStructClass_1, "", "(Ljava/lang/String;Ljava/util/Optional;)V"); + if (ratingNameStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); + return; + } + + newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, newElement_0_ratingName, + newElement_0_ratingNameDesc); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPContentControlGeneratedCommandListAttributeCallback::CHIPContentControlGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentControlGeneratedCommandListAttributeCallback::~CHIPContentControlGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentControlGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPContentControlAcceptedCommandListAttributeCallback::CHIPContentControlAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentControlAcceptedCommandListAttributeCallback::~CHIPContentControlAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentControlAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPContentControlEventListAttributeCallback::CHIPContentControlEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentControlEventListAttributeCallback::~CHIPContentControlEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentControlEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPContentControlAttributeListAttributeCallback::CHIPContentControlAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentControlAttributeListAttributeCallback::~CHIPContentControlAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentControlAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPContentAppObserverGeneratedCommandListAttributeCallback::CHIPContentAppObserverGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentAppObserverGeneratedCommandListAttributeCallback::~CHIPContentAppObserverGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentAppObserverGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPContentAppObserverAcceptedCommandListAttributeCallback::CHIPContentAppObserverAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentAppObserverAcceptedCommandListAttributeCallback::~CHIPContentAppObserverAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentAppObserverAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPContentAppObserverEventListAttributeCallback::CHIPContentAppObserverEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentAppObserverEventListAttributeCallback::~CHIPContentAppObserverEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentAppObserverEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPContentAppObserverAttributeListAttributeCallback::CHIPContentAppObserverAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentAppObserverAttributeListAttributeCallback::~CHIPContentAppObserverAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentAppObserverAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPElectricalMeasurementGeneratedCommandListAttributeCallback::CHIPElectricalMeasurementGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index d3414d28c842e8..3a63b5141721e8 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -10675,6 +10675,39 @@ class ChipClusters: "count": "int", }, }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "GetProgramGuide", + "args": { + "startTime": "int", + "endTime": "int", + "channelList": "ChannelInfoStruct", + "pageToken": "PageTokenStruct", + "recordingFlag": "int", + "externalIDList": "AdditionalInfoStruct", + "data": "bytes", + }, + }, + 0x00000006: { + "commandId": 0x00000006, + "commandName": "RecordProgram", + "args": { + "programIdentifier": "str", + "shouldRecordSeries": "bool", + "externalIDList": "AdditionalInfoStruct", + "data": "bytes", + }, + }, + 0x00000007: { + "commandId": 0x00000007, + "commandName": "CancelRecordProgram", + "args": { + "programIdentifier": "str", + "shouldRecordSeries": "bool", + "externalIDList": "AdditionalInfoStruct", + "data": "bytes", + }, + }, }, "attributes": { 0x00000000: { @@ -10841,12 +10874,14 @@ class ChipClusters: "commandId": 0x00000006, "commandName": "Rewind", "args": { + "audioAdvanceUnmuted": "bool", }, }, 0x00000007: { "commandId": 0x00000007, "commandName": "FastForward", "args": { + "audioAdvanceUnmuted": "bool", }, }, 0x00000008: { @@ -10870,6 +10905,27 @@ class ChipClusters: "position": "int", }, }, + 0x0000000C: { + "commandId": 0x0000000C, + "commandName": "ActivateAudioTrack", + "args": { + "trackID": "str", + "audioOutputIndex": "int", + }, + }, + 0x0000000D: { + "commandId": 0x0000000D, + "commandName": "ActivateTextTrack", + "args": { + "trackID": "str", + }, + }, + 0x0000000E: { + "commandId": 0x0000000E, + "commandName": "DeactivateTextTrack", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -10914,6 +10970,30 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x00000007: { + "attributeName": "ActiveAudioTrack", + "attributeId": 0x00000007, + "type": "", + "reportable": True, + }, + 0x00000008: { + "attributeName": "AvailableAudioTracks", + "attributeId": 0x00000008, + "type": "", + "reportable": True, + }, + 0x00000009: { + "attributeName": "ActiveTextTrack", + "attributeId": 0x00000009, + "type": "", + "reportable": True, + }, + 0x0000000A: { + "attributeName": "AvailableTextTracks", + "attributeId": 0x0000000A, + "type": "", + "reportable": True, + }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, @@ -11147,6 +11227,8 @@ class ChipClusters: "search": "ContentSearchStruct", "autoPlay": "bool", "data": "str", + "playbackPreferences": "PlaybackPreferencesStruct", + "useCurrentContext": "bool", }, }, 0x00000001: { @@ -11468,12 +11550,225 @@ class ChipClusters: "args": { "tempAccountIdentifier": "str", "setupPIN": "str", + "node": "int", }, }, 0x00000003: { "commandId": 0x00000003, "commandName": "Logout", "args": { + "node": "int", + }, + }, + }, + "attributes": { + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _CONTENT_CONTROL_CLUSTER_INFO = { + "clusterName": "ContentControl", + "clusterId": 0x0000050F, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "UpdatePIN", + "args": { + "oldPIN": "str", + "newPIN": "str", + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "ResetPIN", + "args": { + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "Enable", + "args": { + }, + }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "Disable", + "args": { + }, + }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "AddBonusTime", + "args": { + "PINCode": "str", + "bonusTime": "int", + }, + }, + 0x00000006: { + "commandId": 0x00000006, + "commandName": "SetScreenDailyTime", + "args": { + "screenTime": "int", + }, + }, + 0x00000007: { + "commandId": 0x00000007, + "commandName": "BlockUnratedContent", + "args": { + }, + }, + 0x00000008: { + "commandId": 0x00000008, + "commandName": "UnblockUnratedContent", + "args": { + }, + }, + 0x00000009: { + "commandId": 0x00000009, + "commandName": "SetOnDemandRatingThreshold", + "args": { + "rating": "str", + }, + }, + 0x0000000A: { + "commandId": 0x0000000A, + "commandName": "SetScheduledContentRatingThreshold", + "args": { + "rating": "str", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "Enabled", + "attributeId": 0x00000000, + "type": "bool", + "reportable": True, + }, + 0x00000001: { + "attributeName": "OnDemandRatings", + "attributeId": 0x00000001, + "type": "", + "reportable": True, + }, + 0x00000002: { + "attributeName": "OnDemandRatingThreshold", + "attributeId": 0x00000002, + "type": "str", + "reportable": True, + }, + 0x00000003: { + "attributeName": "ScheduledContentRatings", + "attributeId": 0x00000003, + "type": "", + "reportable": True, + }, + 0x00000004: { + "attributeName": "ScheduledContentRatingThreshold", + "attributeId": 0x00000004, + "type": "str", + "reportable": True, + }, + 0x00000005: { + "attributeName": "ScreenDailyTime", + "attributeId": 0x00000005, + "type": "int", + "reportable": True, + }, + 0x00000006: { + "attributeName": "RemainingScreenTime", + "attributeId": 0x00000006, + "type": "int", + "reportable": True, + }, + 0x00000007: { + "attributeName": "BlockUnrated", + "attributeId": 0x00000007, + "type": "bool", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _CONTENT_APP_OBSERVER_CLUSTER_INFO = { + "clusterName": "ContentAppObserver", + "clusterId": 0x00000510, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ContentAppMessage", + "args": { + "data": "str", + "encodingHint": "str", }, }, }, @@ -13373,6 +13668,8 @@ class ChipClusters: 0x0000050C: _APPLICATION_LAUNCHER_CLUSTER_INFO, 0x0000050D: _APPLICATION_BASIC_CLUSTER_INFO, 0x0000050E: _ACCOUNT_LOGIN_CLUSTER_INFO, + 0x0000050F: _CONTENT_CONTROL_CLUSTER_INFO, + 0x00000510: _CONTENT_APP_OBSERVER_CLUSTER_INFO, 0x00000B04: _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, 0xFFF1FC05: _UNIT_TESTING_CLUSTER_INFO, 0xFFF1FC06: _FAULT_INJECTION_CLUSTER_INFO, @@ -13484,6 +13781,8 @@ class ChipClusters: "ApplicationLauncher": _APPLICATION_LAUNCHER_CLUSTER_INFO, "ApplicationBasic": _APPLICATION_BASIC_CLUSTER_INFO, "AccountLogin": _ACCOUNT_LOGIN_CLUSTER_INFO, + "ContentControl": _CONTENT_CONTROL_CLUSTER_INFO, + "ContentAppObserver": _CONTENT_APP_OBSERVER_CLUSTER_INFO, "ElectricalMeasurement": _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, "UnitTesting": _UNIT_TESTING_CLUSTER_INFO, "FaultInjection": _FAULT_INJECTION_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index cfe1bbb4714149..9401e9653c15d1 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -36596,6 +36596,16 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: + class ChannelTypeEnum(MatterIntEnum): + kSatellite = 0x00 + kCable = 0x01 + kTerrestrial = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, + class LineupInfoTypeEnum(MatterIntEnum): kMso = 0x00 # All received enum values that are not listed above will be mapped @@ -36618,8 +36628,54 @@ class Bitmaps: class Feature(IntFlag): kChannelList = 0x1 kLineupInfo = 0x2 + kElectronicGuide = 0x3 + kRecordProgram = 0x4 + + class RecordingFlagBitmap(IntFlag): + kScheduled = 0x1 + kRecordSeries = 0x2 + kRecorded = 0x3 class Structs: + @dataclass + class ProgramCastStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="role", Tag=1, Type=str), + ]) + + name: 'str' = "" + role: 'str' = "" + + @dataclass + class ProgramCategoryStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="category", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="subCategory", Tag=1, Type=typing.Optional[str]), + ]) + + category: 'str' = "" + subCategory: 'typing.Optional[str]' = None + + @dataclass + class SeriesInfoStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="season", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="episode", Tag=1, Type=str), + ]) + + season: 'str' = "" + episode: 'str' = "" + @dataclass class ChannelInfoStruct(ClusterObject): @ChipUtility.classproperty @@ -36631,6 +36687,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="callSign", Tag=3, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="affiliateCallSign", Tag=4, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="identifier", Tag=5, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="type", Tag=6, Type=typing.Optional[Channel.Enums.ChannelTypeEnum]), ]) majorNumber: 'uint' = 0 @@ -36638,6 +36696,96 @@ def descriptor(cls) -> ClusterObjectDescriptor: name: 'typing.Optional[str]' = None callSign: 'typing.Optional[str]' = None affiliateCallSign: 'typing.Optional[str]' = None + identifier: 'typing.Optional[str]' = None + type: 'typing.Optional[Channel.Enums.ChannelTypeEnum]' = None + + @dataclass + class ProgramStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="identifier", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="channel", Tag=1, Type=Channel.Structs.ChannelInfoStruct), + ClusterObjectFieldDescriptor(Label="startTime", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="endTime", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="title", Tag=4, Type=str), + ClusterObjectFieldDescriptor(Label="subtitle", Tag=5, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="description", Tag=6, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="audioLanguages", Tag=7, Type=typing.Optional[typing.List[str]]), + ClusterObjectFieldDescriptor(Label="ratings", Tag=8, Type=typing.Optional[typing.List[str]]), + ClusterObjectFieldDescriptor(Label="thumbnailUrl", Tag=9, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="posterArtUrl", Tag=10, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="dvbiUrl", Tag=11, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="releaseDate", Tag=12, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="parentalGuidanceText", Tag=13, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="recordingFlag", Tag=14, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="seriesInfo", Tag=15, Type=typing.Union[None, Nullable, Channel.Structs.SeriesInfoStruct]), + ClusterObjectFieldDescriptor(Label="categoryList", Tag=16, Type=typing.Optional[typing.List[Channel.Structs.ProgramCategoryStruct]]), + ClusterObjectFieldDescriptor(Label="castList", Tag=17, Type=typing.Optional[typing.List[Channel.Structs.ProgramCastStruct]]), + ClusterObjectFieldDescriptor(Label="externalIDList", Tag=18, Type=typing.Optional[typing.List[Channel.Structs.ProgramCastStruct]]), + ]) + + identifier: 'str' = "" + channel: 'Channel.Structs.ChannelInfoStruct' = field(default_factory=lambda: Channel.Structs.ChannelInfoStruct()) + startTime: 'uint' = 0 + endTime: 'uint' = 0 + title: 'str' = "" + subtitle: 'typing.Optional[str]' = None + description: 'typing.Optional[str]' = None + audioLanguages: 'typing.Optional[typing.List[str]]' = None + ratings: 'typing.Optional[typing.List[str]]' = None + thumbnailUrl: 'typing.Optional[str]' = None + posterArtUrl: 'typing.Optional[str]' = None + dvbiUrl: 'typing.Optional[str]' = None + releaseDate: 'typing.Optional[str]' = None + parentalGuidanceText: 'typing.Optional[str]' = None + recordingFlag: 'typing.Optional[uint]' = None + seriesInfo: 'typing.Union[None, Nullable, Channel.Structs.SeriesInfoStruct]' = None + categoryList: 'typing.Optional[typing.List[Channel.Structs.ProgramCategoryStruct]]' = None + castList: 'typing.Optional[typing.List[Channel.Structs.ProgramCastStruct]]' = None + externalIDList: 'typing.Optional[typing.List[Channel.Structs.ProgramCastStruct]]' = None + + @dataclass + class PageTokenStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="limit", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="after", Tag=1, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="before", Tag=2, Type=typing.Optional[str]), + ]) + + limit: 'typing.Optional[uint]' = None + after: 'typing.Optional[str]' = None + before: 'typing.Optional[str]' = None + + @dataclass + class ChannelPagingStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="previousToken", Tag=0, Type=typing.Union[None, Nullable, Channel.Structs.PageTokenStruct]), + ClusterObjectFieldDescriptor(Label="nextToken", Tag=1, Type=typing.Union[None, Nullable, Channel.Structs.PageTokenStruct]), + ]) + + previousToken: 'typing.Union[None, Nullable, Channel.Structs.PageTokenStruct]' = None + nextToken: 'typing.Union[None, Nullable, Channel.Structs.PageTokenStruct]' = None + + @dataclass + class AdditionalInfoStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=str), + ]) + + name: 'str' = "" + value: 'str' = "" @dataclass class LineupInfoStruct(ClusterObject): @@ -36725,6 +36873,96 @@ def descriptor(cls) -> ClusterObjectDescriptor: count: 'int' = 0 + @dataclass + class GetProgramGuide(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000504 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'ProgramGuideResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="startTime", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="endTime", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="channelList", Tag=2, Type=typing.Optional[typing.List[Channel.Structs.ChannelInfoStruct]]), + ClusterObjectFieldDescriptor(Label="pageToken", Tag=3, Type=typing.Optional[Channel.Structs.PageTokenStruct]), + ClusterObjectFieldDescriptor(Label="recordingFlag", Tag=4, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="externalIDList", Tag=5, Type=typing.Optional[typing.List[Channel.Structs.AdditionalInfoStruct]]), + ClusterObjectFieldDescriptor(Label="data", Tag=6, Type=typing.Optional[bytes]), + ]) + + startTime: 'typing.Optional[uint]' = None + endTime: 'typing.Optional[uint]' = None + channelList: 'typing.Optional[typing.List[Channel.Structs.ChannelInfoStruct]]' = None + pageToken: 'typing.Optional[Channel.Structs.PageTokenStruct]' = None + recordingFlag: 'typing.Optional[uint]' = None + externalIDList: 'typing.Optional[typing.List[Channel.Structs.AdditionalInfoStruct]]' = None + data: 'typing.Optional[bytes]' = None + + @dataclass + class ProgramGuideResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000504 + command_id: typing.ClassVar[int] = 0x00000005 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="channelPagingStruct", Tag=0, Type=int), + ClusterObjectFieldDescriptor(Label="programList", Tag=1, Type=typing.List[Channel.Structs.ProgramStruct]), + ]) + + channelPagingStruct: 'int' = 0 + programList: 'typing.List[Channel.Structs.ProgramStruct]' = field(default_factory=lambda: []) + + @dataclass + class RecordProgram(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000504 + command_id: typing.ClassVar[int] = 0x00000006 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="programIdentifier", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="shouldRecordSeries", Tag=1, Type=bool), + ClusterObjectFieldDescriptor(Label="externalIDList", Tag=2, Type=typing.List[Channel.Structs.AdditionalInfoStruct]), + ClusterObjectFieldDescriptor(Label="data", Tag=3, Type=bytes), + ]) + + programIdentifier: 'str' = "" + shouldRecordSeries: 'bool' = False + externalIDList: 'typing.List[Channel.Structs.AdditionalInfoStruct]' = field(default_factory=lambda: []) + data: 'bytes' = b"" + + @dataclass + class CancelRecordProgram(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000504 + command_id: typing.ClassVar[int] = 0x00000007 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="programIdentifier", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="shouldRecordSeries", Tag=1, Type=bool), + ClusterObjectFieldDescriptor(Label="externalIDList", Tag=2, Type=typing.List[Channel.Structs.AdditionalInfoStruct]), + ClusterObjectFieldDescriptor(Label="data", Tag=3, Type=bytes), + ]) + + programIdentifier: 'str' = "" + shouldRecordSeries: 'bool' = False + externalIDList: 'typing.List[Channel.Structs.AdditionalInfoStruct]' = field(default_factory=lambda: []) + data: 'bytes' = b"" + class Attributes: @dataclass class ChannelList(ClusterAttributeDescriptor): @@ -37089,6 +37327,30 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 + class Events: + @dataclass + class TargetUpdated(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000505 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="targetList", Tag=0, Type=typing.List[TargetNavigator.Structs.TargetInfoStruct]), + ClusterObjectFieldDescriptor(Label="currentTarget", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="data", Tag=2, Type=bytes), + ]) + + targetList: 'typing.List[TargetNavigator.Structs.TargetInfoStruct]' = field(default_factory=lambda: []) + currentTarget: 'uint' = 0 + data: 'bytes' = b"" + @dataclass class MediaPlayback(Cluster): @@ -37105,6 +37367,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="playbackSpeed", Tag=0x00000004, Type=typing.Optional[float32]), ClusterObjectFieldDescriptor(Label="seekRangeEnd", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="seekRangeStart", Tag=0x00000006, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="activeAudioTrack", Tag=0x00000007, Type=typing.Union[None, Nullable, MediaPlayback.Structs.TrackStruct]), + ClusterObjectFieldDescriptor(Label="availableAudioTracks", Tag=0x00000008, Type=typing.Union[None, Nullable, typing.List[MediaPlayback.Structs.TrackStruct]]), + ClusterObjectFieldDescriptor(Label="activeTextTrack", Tag=0x00000009, Type=typing.Union[None, Nullable, MediaPlayback.Structs.TrackStruct]), + ClusterObjectFieldDescriptor(Label="availableTextTracks", Tag=0x0000000A, Type=typing.Union[None, Nullable, typing.List[MediaPlayback.Structs.TrackStruct]]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -37120,6 +37386,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: playbackSpeed: 'typing.Optional[float32]' = None seekRangeEnd: 'typing.Union[None, Nullable, uint]' = None seekRangeStart: 'typing.Union[None, Nullable, uint]' = None + activeAudioTrack: 'typing.Union[None, Nullable, MediaPlayback.Structs.TrackStruct]' = None + availableAudioTracks: 'typing.Union[None, Nullable, typing.List[MediaPlayback.Structs.TrackStruct]]' = None + activeTextTrack: 'typing.Union[None, Nullable, MediaPlayback.Structs.TrackStruct]' = None + availableTextTracks: 'typing.Union[None, Nullable, typing.List[MediaPlayback.Structs.TrackStruct]]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -37128,6 +37398,31 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: + class CharacteristicEnum(MatterIntEnum): + kForcedSubtitles = 0x00 + kDescribesVideo = 0x01 + kEasyToRead = 0x02 + kFrameBased = 0x03 + kMainProgram = 0x04 + kOriginalContent = 0x05 + kVoiceOverTranslation = 0x06 + kCaption = 0x07 + kSubtitle = 0x08 + kAlternate = 0x09 + kSupplementary = 0x0A + kCommentary = 0x0B + kDubbedTranslation = 0x0C + kDescription = 0x0D + kMetadata = 0x0E + kEnhancedAudioIntelligibility = 0x0F + kEmergency = 0x10 + kKaraoke = 0x11 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 18, + class PlaybackStateEnum(MatterIntEnum): kPlaying = 0x00 kPaused = 0x01 @@ -37156,8 +37451,37 @@ class Bitmaps: class Feature(IntFlag): kAdvancedSeek = 0x1 kVariableSpeed = 0x2 + kTextTracks = 0x3 + kAudioTracks = 0x4 + kAudioAdvance = 0x5 class Structs: + @dataclass + class TrackAttributesStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="languageCode", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="displayName", Tag=1, Type=typing.Union[None, Nullable, str]), + ]) + + languageCode: 'str' = "" + displayName: 'typing.Union[None, Nullable, str]' = None + + @dataclass + class TrackStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="id", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="trackAttributes", Tag=1, Type=typing.Union[Nullable, MediaPlayback.Structs.TrackAttributesStruct]), + ]) + + id: 'str' = "" + trackAttributes: 'typing.Union[Nullable, MediaPlayback.Structs.TrackAttributesStruct]' = NullValue + @dataclass class PlaybackPositionStruct(ClusterObject): @ChipUtility.classproperty @@ -37261,8 +37585,11 @@ class Rewind(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ + ClusterObjectFieldDescriptor(Label="audioAdvanceUnmuted", Tag=0, Type=typing.Optional[bool]), ]) + audioAdvanceUnmuted: 'typing.Optional[bool]' = None + @dataclass class FastForward(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x00000506 @@ -37274,8 +37601,11 @@ class FastForward(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ + ClusterObjectFieldDescriptor(Label="audioAdvanceUnmuted", Tag=0, Type=typing.Optional[bool]), ]) + audioAdvanceUnmuted: 'typing.Optional[bool]' = None + @dataclass class SkipForward(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x00000506 @@ -37342,6 +37672,53 @@ def descriptor(cls) -> ClusterObjectDescriptor: position: 'uint' = 0 + @dataclass + class ActivateAudioTrack(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000506 + command_id: typing.ClassVar[int] = 0x0000000C + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="trackID", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="audioOutputIndex", Tag=1, Type=uint), + ]) + + trackID: 'str' = "" + audioOutputIndex: 'uint' = 0 + + @dataclass + class ActivateTextTrack(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000506 + command_id: typing.ClassVar[int] = 0x0000000D + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="trackID", Tag=0, Type=str), + ]) + + trackID: 'str' = "" + + @dataclass + class DeactivateTextTrack(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000506 + command_id: typing.ClassVar[int] = 0x0000000E + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + class Attributes: @dataclass class CurrentState(ClusterAttributeDescriptor): @@ -37455,6 +37832,70 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Union[None, Nullable, uint]' = None + @dataclass + class ActiveAudioTrack(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000506 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, MediaPlayback.Structs.TrackStruct]) + + value: 'typing.Union[None, Nullable, MediaPlayback.Structs.TrackStruct]' = None + + @dataclass + class AvailableAudioTracks(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000506 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000008 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, typing.List[MediaPlayback.Structs.TrackStruct]]) + + value: 'typing.Union[None, Nullable, typing.List[MediaPlayback.Structs.TrackStruct]]' = None + + @dataclass + class ActiveTextTrack(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000506 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000009 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, MediaPlayback.Structs.TrackStruct]) + + value: 'typing.Union[None, Nullable, MediaPlayback.Structs.TrackStruct]' = None + + @dataclass + class AvailableTextTracks(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000506 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, typing.List[MediaPlayback.Structs.TrackStruct]]) + + value: 'typing.Union[None, Nullable, typing.List[MediaPlayback.Structs.TrackStruct]]' = None + @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -37551,6 +37992,42 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 + class Events: + @dataclass + class StateChanged(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000506 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="currentState", Tag=0, Type=MediaPlayback.Enums.PlaybackStateEnum), + ClusterObjectFieldDescriptor(Label="startTime", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="duration", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="sampledPosition", Tag=3, Type=MediaPlayback.Structs.PlaybackPositionStruct), + ClusterObjectFieldDescriptor(Label="playbackSpeed", Tag=4, Type=float32), + ClusterObjectFieldDescriptor(Label="seekRangeEnd", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="seekRangeStart", Tag=6, Type=uint), + ClusterObjectFieldDescriptor(Label="data", Tag=7, Type=typing.Optional[bytes]), + ClusterObjectFieldDescriptor(Label="audioAdvanceUnmuted", Tag=8, Type=bool), + ]) + + currentState: 'MediaPlayback.Enums.PlaybackStateEnum' = 0 + startTime: 'uint' = 0 + duration: 'uint' = 0 + sampledPosition: 'MediaPlayback.Structs.PlaybackPositionStruct' = field(default_factory=lambda: MediaPlayback.Structs.PlaybackPositionStruct()) + playbackSpeed: 'float32' = 0.0 + seekRangeEnd: 'uint' = 0 + seekRangeStart: 'uint' = 0 + data: 'typing.Optional[bytes]' = None + audioAdvanceUnmuted: 'bool' = False + @dataclass class MediaInput(Cluster): @@ -38239,6 +38716,31 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: + class CharacteristicEnum(MatterIntEnum): + kForcedSubtitles = 0x00 + kDescribesVideo = 0x01 + kEasyToRead = 0x02 + kFrameBased = 0x03 + kMainProgram = 0x04 + kOriginalContent = 0x05 + kVoiceOverTranslation = 0x06 + kCaption = 0x07 + kSubtitle = 0x08 + kAlternate = 0x09 + kSupplementary = 0x0A + kCommentary = 0x0B + kDubbedTranslation = 0x0C + kDescription = 0x0D + kMetadata = 0x0E + kEnhancedAudioIntelligibility = 0x0F + kEmergency = 0x10 + kKaraoke = 0x11 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 18, + class MetricTypeEnum(MatterIntEnum): kPixels = 0x00 kPercentage = 0x01 @@ -38263,30 +38765,39 @@ class ParameterEnum(MatterIntEnum): kSportsTeam = 0x0B kType = 0x0C kVideo = 0x0D + kSeason = 0x0E + kEpisode = 0x0F + kAny = 0x10 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown # enum value. This specific should never be transmitted. - kUnknownEnumValue = 14, + kUnknownEnumValue = 17, class StatusEnum(MatterIntEnum): kSuccess = 0x00 kURLNotAvailable = 0x01 kAuthFailed = 0x02 + kTextTrackNotAvailable = 0x03 + kAudioTrackNotAvailable = 0x04 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown # enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 5, class Bitmaps: class Feature(IntFlag): kContentSearch = 0x1 kURLPlayback = 0x2 + kAdvancedSeek = 0x3 + kTextTracks = 0x4 + kAudioTracks = 0x5 class SupportedProtocolsBitmap(IntFlag): kDash = 0x1 kHls = 0x2 + kWebRTC = 0x2 class Structs: @dataclass @@ -38304,6 +38815,36 @@ def descriptor(cls) -> ClusterObjectDescriptor: height: 'float' = 0.0 metric: 'ContentLauncher.Enums.MetricTypeEnum' = 0 + @dataclass + class TrackPreferenceStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="languageCode", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="characteristics", Tag=1, Type=typing.Optional[typing.List[ContentLauncher.Enums.CharacteristicEnum]]), + ClusterObjectFieldDescriptor(Label="audioOutputIndex", Tag=2, Type=uint), + ]) + + languageCode: 'str' = "" + characteristics: 'typing.Optional[typing.List[ContentLauncher.Enums.CharacteristicEnum]]' = None + audioOutputIndex: 'uint' = 0 + + @dataclass + class PlaybackPreferencesStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="playbackPosition", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="textTrack", Tag=1, Type=ContentLauncher.Structs.TrackPreferenceStruct), + ClusterObjectFieldDescriptor(Label="audioTracks", Tag=2, Type=typing.Optional[typing.List[ContentLauncher.Structs.TrackPreferenceStruct]]), + ]) + + playbackPosition: 'uint' = 0 + textTrack: 'ContentLauncher.Structs.TrackPreferenceStruct' = field(default_factory=lambda: ContentLauncher.Structs.TrackPreferenceStruct()) + audioTracks: 'typing.Optional[typing.List[ContentLauncher.Structs.TrackPreferenceStruct]]' = None + @dataclass class AdditionalInfoStruct(ClusterObject): @ChipUtility.classproperty @@ -38394,11 +38935,15 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="search", Tag=0, Type=ContentLauncher.Structs.ContentSearchStruct), ClusterObjectFieldDescriptor(Label="autoPlay", Tag=1, Type=bool), ClusterObjectFieldDescriptor(Label="data", Tag=2, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="playbackPreferences", Tag=3, Type=typing.Optional[ContentLauncher.Structs.PlaybackPreferencesStruct]), + ClusterObjectFieldDescriptor(Label="useCurrentContext", Tag=4, Type=typing.Optional[bool]), ]) search: 'ContentLauncher.Structs.ContentSearchStruct' = field(default_factory=lambda: ContentLauncher.Structs.ContentSearchStruct()) autoPlay: 'bool' = False data: 'typing.Optional[str]' = None + playbackPreferences: 'typing.Optional[ContentLauncher.Structs.PlaybackPreferencesStruct]' = None + useCurrentContext: 'typing.Optional[bool]' = None @dataclass class LaunchURL(ClusterCommand): @@ -39426,6 +39971,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="tempAccountIdentifier", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="setupPIN", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="node", Tag=2, Type=typing.Optional[uint]), ]) @ChipUtility.classproperty @@ -39434,6 +39980,7 @@ def must_use_timed_invoke(cls) -> bool: tempAccountIdentifier: 'str' = "" setupPIN: 'str' = "" + node: 'typing.Optional[uint]' = None @dataclass class Logout(ClusterCommand): @@ -39446,12 +39993,15 @@ class Logout(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ + ClusterObjectFieldDescriptor(Label="node", Tag=0, Type=typing.Optional[uint]), ]) @ChipUtility.classproperty def must_use_timed_invoke(cls) -> bool: return True + node: 'typing.Optional[uint]' = None + class Attributes: @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @@ -39549,6 +40099,666 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 + class Events: + @dataclass + class LoggedOut(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050E + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="node", Tag=0, Type=typing.Optional[uint]), + ]) + + node: 'typing.Optional[uint]' = None + + +@dataclass +class ContentControl(Cluster): + id: typing.ClassVar[int] = 0x0000050F + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="enabled", Tag=0x00000000, Type=bool), + ClusterObjectFieldDescriptor(Label="onDemandRatings", Tag=0x00000001, Type=typing.Optional[typing.List[ContentControl.Structs.RatingNameStruct]]), + ClusterObjectFieldDescriptor(Label="onDemandRatingThreshold", Tag=0x00000002, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="scheduledContentRatings", Tag=0x00000003, Type=typing.Optional[typing.List[ContentControl.Structs.RatingNameStruct]]), + ClusterObjectFieldDescriptor(Label="scheduledContentRatingThreshold", Tag=0x00000004, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="screenDailyTime", Tag=0x00000005, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="remainingScreenTime", Tag=0x00000006, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="blockUnrated", Tag=0x00000007, Type=bool), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + enabled: 'bool' = None + onDemandRatings: 'typing.Optional[typing.List[ContentControl.Structs.RatingNameStruct]]' = None + onDemandRatingThreshold: 'typing.Optional[str]' = None + scheduledContentRatings: 'typing.Optional[typing.List[ContentControl.Structs.RatingNameStruct]]' = None + scheduledContentRatingThreshold: 'typing.Optional[str]' = None + screenDailyTime: 'typing.Optional[uint]' = None + remainingScreenTime: 'typing.Optional[uint]' = None + blockUnrated: 'bool' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Bitmaps: + class Feature(IntFlag): + kScreenTime = 0x1 + kPINManagement = 0x2 + kBlockUnrated = 0x3 + kOnDemandContentRating = 0x4 + kScheduledContentRating = 0x5 + + class Structs: + @dataclass + class RatingNameStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="ratingName", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="ratingNameDesc", Tag=1, Type=typing.Optional[str]), + ]) + + ratingName: 'str' = "" + ratingNameDesc: 'typing.Optional[str]' = None + + class Commands: + @dataclass + class UpdatePIN(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="oldPIN", Tag=0, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="newPIN", Tag=1, Type=str), + ]) + + oldPIN: 'typing.Optional[str]' = None + newPIN: 'str' = "" + + @dataclass + class ResetPIN(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'ResetPINResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class ResetPINResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="PINCode", Tag=0, Type=str), + ]) + + PINCode: 'str' = "" + + @dataclass + class Enable(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class Disable(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class AddBonusTime(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x00000005 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="PINCode", Tag=0, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="bonusTime", Tag=1, Type=typing.Optional[uint]), + ]) + + PINCode: 'typing.Optional[str]' = None + bonusTime: 'typing.Optional[uint]' = None + + @dataclass + class SetScreenDailyTime(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x00000006 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="screenTime", Tag=0, Type=uint), + ]) + + screenTime: 'uint' = 0 + + @dataclass + class BlockUnratedContent(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x00000007 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class UnblockUnratedContent(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x00000008 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class SetOnDemandRatingThreshold(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x00000009 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="rating", Tag=0, Type=str), + ]) + + rating: 'str' = "" + + @dataclass + class SetScheduledContentRatingThreshold(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000050F + command_id: typing.ClassVar[int] = 0x0000000A + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="rating", Tag=0, Type=str), + ]) + + rating: 'str' = "" + + class Attributes: + @dataclass + class Enabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=bool) + + value: 'bool' = False + + @dataclass + class OnDemandRatings(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[ContentControl.Structs.RatingNameStruct]]) + + value: 'typing.Optional[typing.List[ContentControl.Structs.RatingNameStruct]]' = None + + @dataclass + class OnDemandRatingThreshold(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[str]) + + value: 'typing.Optional[str]' = None + + @dataclass + class ScheduledContentRatings(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[ContentControl.Structs.RatingNameStruct]]) + + value: 'typing.Optional[typing.List[ContentControl.Structs.RatingNameStruct]]' = None + + @dataclass + class ScheduledContentRatingThreshold(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[str]) + + value: 'typing.Optional[str]' = None + + @dataclass + class ScreenDailyTime(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class RemainingScreenTime(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000006 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class BlockUnrated(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=bool) + + value: 'bool' = False + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + class Events: + @dataclass + class RemainingScreenTimeExpired(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000050F + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + +@dataclass +class ContentAppObserver(Cluster): + id: typing.ClassVar[int] = 0x00000510 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class StatusEnum(MatterIntEnum): + kSuccess = 0x00 + kUnexpectedData = 0x01 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 2, + + class Commands: + @dataclass + class ContentAppMessage(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000510 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'ContentAppMessageResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="data", Tag=0, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="encodingHint", Tag=1, Type=str), + ]) + + data: 'typing.Optional[str]' = None + encodingHint: 'str' = "" + + @dataclass + class ContentAppMessageResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000510 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=typing.Optional[ContentAppObserver.Enums.StatusEnum]), + ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="encodingHint", Tag=2, Type=str), + ]) + + status: 'typing.Optional[ContentAppObserver.Enums.StatusEnum]' = None + data: 'str' = "" + encodingHint: 'str' = "" + + class Attributes: + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000510 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000510 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000510 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000510 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000510 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000510 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + @dataclass class ElectricalMeasurement(Cluster): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 7378b67bb696d8..264fb5d4ba7f5a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -4977,6 +4977,18 @@ static BOOL AttributeIsSpecifiedInMediaPlaybackCluster(AttributeId aAttributeId) case Attributes::SeekRangeStart::Id: { return YES; } + case Attributes::ActiveAudioTrack::Id: { + return YES; + } + case Attributes::AvailableAudioTracks::Id: { + return YES; + } + case Attributes::ActiveTextTrack::Id: { + return YES; + } + case Attributes::AvailableTextTracks::Id: { + return YES; + } case Attributes::GeneratedCommandList::Id: { return YES; } @@ -5264,6 +5276,84 @@ static BOOL AttributeIsSpecifiedInAccountLoginCluster(AttributeId aAttributeId) } } } +static BOOL AttributeIsSpecifiedInContentControlCluster(AttributeId aAttributeId) +{ + using namespace Clusters::ContentControl; + switch (aAttributeId) { + case Attributes::Enabled::Id: { + return YES; + } + case Attributes::OnDemandRatings::Id: { + return YES; + } + case Attributes::OnDemandRatingThreshold::Id: { + return YES; + } + case Attributes::ScheduledContentRatings::Id: { + return YES; + } + case Attributes::ScheduledContentRatingThreshold::Id: { + return YES; + } + case Attributes::ScreenDailyTime::Id: { + return YES; + } + case Attributes::RemainingScreenTime::Id: { + return YES; + } + case Attributes::BlockUnrated::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} +static BOOL AttributeIsSpecifiedInContentAppObserverCluster(AttributeId aAttributeId) +{ + using namespace Clusters::ContentAppObserver; + switch (aAttributeId) { + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInElectricalMeasurementCluster(AttributeId aAttributeId) { using namespace Clusters::ElectricalMeasurement; @@ -6285,6 +6375,12 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::AccountLogin::Id: { return AttributeIsSpecifiedInAccountLoginCluster(aAttributeId); } + case Clusters::ContentControl::Id: { + return AttributeIsSpecifiedInContentControlCluster(aAttributeId); + } + case Clusters::ContentAppObserver::Id: { + return AttributeIsSpecifiedInContentAppObserverCluster(aAttributeId); + } case Clusters::ElectricalMeasurement::Id: { return AttributeIsSpecifiedInElectricalMeasurementCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 99132952193def..6984dd50ecabf4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -13275,6 +13275,21 @@ static id _Nullable DecodeAttributeValueForChannelCluster(AttributeId aAttribute } else { newElement_0.affiliateCallSign = nil; } + if (entry_0.identifier.HasValue()) { + newElement_0.identifier = AsString(entry_0.identifier.Value()); + if (newElement_0.identifier == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.identifier = nil; + } + if (entry_0.type.HasValue()) { + newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type.Value())]; + } else { + newElement_0.type = nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13372,6 +13387,21 @@ static id _Nullable DecodeAttributeValueForChannelCluster(AttributeId aAttribute } else { value.affiliateCallSign = nil; } + if (cppValue.Value().identifier.HasValue()) { + value.identifier = AsString(cppValue.Value().identifier.Value()); + if (value.identifier == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.identifier = nil; + } + if (cppValue.Value().type.HasValue()) { + value.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().type.Value())]; + } else { + value.type = nil; + } } return value; } @@ -13546,6 +13576,220 @@ static id _Nullable DecodeAttributeValueForMediaPlaybackCluster(AttributeId aAtt } return value; } + case Attributes::ActiveAudioTrack::Id: { + using TypeInfo = Attributes::ActiveAudioTrack::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRMediaPlaybackClusterTrackStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRMediaPlaybackClusterTrackStruct new]; + value.id = AsString(cppValue.Value().id); + if (value.id == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (cppValue.Value().trackAttributes.IsNull()) { + value.trackAttributes = nil; + } else { + value.trackAttributes = [MTRMediaPlaybackClusterTrackAttributesStruct new]; + value.trackAttributes.languageCode = AsString(cppValue.Value().trackAttributes.Value().languageCode); + if (value.trackAttributes.languageCode == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (cppValue.Value().trackAttributes.Value().displayName.HasValue()) { + if (cppValue.Value().trackAttributes.Value().displayName.Value().IsNull()) { + value.trackAttributes.displayName = nil; + } else { + value.trackAttributes.displayName = AsString(cppValue.Value().trackAttributes.Value().displayName.Value().Value()); + if (value.trackAttributes.displayName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + } else { + value.trackAttributes.displayName = nil; + } + } + } + return value; + } + case Attributes::AvailableAudioTracks::Id: { + using TypeInfo = Attributes::AvailableAudioTracks::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + MTRMediaPlaybackClusterTrackStruct * newElement_1; + newElement_1 = [MTRMediaPlaybackClusterTrackStruct new]; + newElement_1.id = AsString(entry_1.id); + if (newElement_1.id == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (entry_1.trackAttributes.IsNull()) { + newElement_1.trackAttributes = nil; + } else { + newElement_1.trackAttributes = [MTRMediaPlaybackClusterTrackAttributesStruct new]; + newElement_1.trackAttributes.languageCode = AsString(entry_1.trackAttributes.Value().languageCode); + if (newElement_1.trackAttributes.languageCode == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (entry_1.trackAttributes.Value().displayName.HasValue()) { + if (entry_1.trackAttributes.Value().displayName.Value().IsNull()) { + newElement_1.trackAttributes.displayName = nil; + } else { + newElement_1.trackAttributes.displayName = AsString(entry_1.trackAttributes.Value().displayName.Value().Value()); + if (newElement_1.trackAttributes.displayName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + } else { + newElement_1.trackAttributes.displayName = nil; + } + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } + } + return value; + } + case Attributes::ActiveTextTrack::Id: { + using TypeInfo = Attributes::ActiveTextTrack::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRMediaPlaybackClusterTrackStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRMediaPlaybackClusterTrackStruct new]; + value.id = AsString(cppValue.Value().id); + if (value.id == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (cppValue.Value().trackAttributes.IsNull()) { + value.trackAttributes = nil; + } else { + value.trackAttributes = [MTRMediaPlaybackClusterTrackAttributesStruct new]; + value.trackAttributes.languageCode = AsString(cppValue.Value().trackAttributes.Value().languageCode); + if (value.trackAttributes.languageCode == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (cppValue.Value().trackAttributes.Value().displayName.HasValue()) { + if (cppValue.Value().trackAttributes.Value().displayName.Value().IsNull()) { + value.trackAttributes.displayName = nil; + } else { + value.trackAttributes.displayName = AsString(cppValue.Value().trackAttributes.Value().displayName.Value().Value()); + if (value.trackAttributes.displayName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + } else { + value.trackAttributes.displayName = nil; + } + } + } + return value; + } + case Attributes::AvailableTextTracks::Id: { + using TypeInfo = Attributes::AvailableTextTracks::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + MTRMediaPlaybackClusterTrackStruct * newElement_1; + newElement_1 = [MTRMediaPlaybackClusterTrackStruct new]; + newElement_1.id = AsString(entry_1.id); + if (newElement_1.id == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (entry_1.trackAttributes.IsNull()) { + newElement_1.trackAttributes = nil; + } else { + newElement_1.trackAttributes = [MTRMediaPlaybackClusterTrackAttributesStruct new]; + newElement_1.trackAttributes.languageCode = AsString(entry_1.trackAttributes.Value().languageCode); + if (newElement_1.trackAttributes.languageCode == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (entry_1.trackAttributes.Value().displayName.HasValue()) { + if (entry_1.trackAttributes.Value().displayName.Value().IsNull()) { + newElement_1.trackAttributes.displayName = nil; + } else { + newElement_1.trackAttributes.displayName = AsString(entry_1.trackAttributes.Value().displayName.Value().Value()); + if (newElement_1.trackAttributes.displayName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + } else { + newElement_1.trackAttributes.displayName = nil; + } + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } + } + return value; + } default: { break; } @@ -13967,6 +14211,190 @@ static id _Nullable DecodeAttributeValueForAccountLoginCluster(AttributeId aAttr *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForContentControlCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ContentControl; + switch (aAttributeId) { + case Attributes::Enabled::Id: { + using TypeInfo = Attributes::Enabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::OnDemandRatings::Id: { + using TypeInfo = Attributes::OnDemandRatings::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRContentControlClusterRatingNameStruct * newElement_0; + newElement_0 = [MTRContentControlClusterRatingNameStruct new]; + newElement_0.ratingName = AsString(entry_0.ratingName); + if (newElement_0.ratingName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (entry_0.ratingNameDesc.HasValue()) { + newElement_0.ratingNameDesc = AsString(entry_0.ratingNameDesc.Value()); + if (newElement_0.ratingNameDesc == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.ratingNameDesc = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::OnDemandRatingThreshold::Id: { + using TypeInfo = Attributes::OnDemandRatingThreshold::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::ScheduledContentRatings::Id: { + using TypeInfo = Attributes::ScheduledContentRatings::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRContentControlClusterRatingNameStruct * newElement_0; + newElement_0 = [MTRContentControlClusterRatingNameStruct new]; + newElement_0.ratingName = AsString(entry_0.ratingName); + if (newElement_0.ratingName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (entry_0.ratingNameDesc.HasValue()) { + newElement_0.ratingNameDesc = AsString(entry_0.ratingNameDesc.Value()); + if (newElement_0.ratingNameDesc == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.ratingNameDesc = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::ScheduledContentRatingThreshold::Id: { + using TypeInfo = Attributes::ScheduledContentRatingThreshold::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::ScreenDailyTime::Id: { + using TypeInfo = Attributes::ScreenDailyTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::RemainingScreenTime::Id: { + using TypeInfo = Attributes::RemainingScreenTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::BlockUnrated::Id: { + using TypeInfo = Attributes::BlockUnrated::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForContentAppObserverCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ContentAppObserver; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForElectricalMeasurementCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::ElectricalMeasurement; @@ -17132,6 +17560,12 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::AccountLogin::Id: { return DecodeAttributeValueForAccountLoginCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::ContentControl::Id: { + return DecodeAttributeValueForContentControlCluster(aPath.mAttributeId, aReader, aError); + } + case Clusters::ContentAppObserver::Id: { + return DecodeAttributeValueForContentAppObserverCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::ElectricalMeasurement::Id: { return DecodeAttributeValueForElectricalMeasurementCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index eadaa480abf11a..b7ee5d5cc35778 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -12002,6 +12002,24 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) * This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. */ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +/** + * Command GetProgramGuide + * + * This command retrieves the program guide. It accepts several filter parameters to return specific schedule and program information from a content app. The command shall receive in response a ProgramGuideResponse. + */ +- (void)getProgramGuideWithParams:(MTRChannelClusterGetProgramGuideParams * _Nullable)params completion:(void (^)(MTRChannelClusterProgramGuideResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command RecordProgram + * + * Record a specific program or series when it goes live. This functionality enables DVR recording features. + */ +- (void)recordProgramWithParams:(MTRChannelClusterRecordProgramParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command CancelRecordProgram + * + * Cancel recording for a specific program or series. + */ +- (void)cancelRecordProgramWithParams:(MTRChannelClusterCancelRecordProgramParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeChannelListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeChannelListWithParams:(MTRSubscribeParams *)params @@ -12216,16 +12234,12 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) * Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)rewindWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** * Command FastForward * * Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). */ - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)fastForwardWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** * Command SkipForward * @@ -12244,6 +12258,26 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) * Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: */ - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +/** + * Command ActivateAudioTrack + * + * Upon receipt, the server SHALL set the active Audio Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server will return an error status of INVALID_ARGUMENT. + */ +- (void)activateAudioTrackWithParams:(MTRMediaPlaybackClusterActivateAudioTrackParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command ActivateTextTrack + * + * Upon receipt, the server SHALL set the active Text Track to the one identified by the TrackID in the Track catalog for the streaming media. If the TrackID does not exist in the Track catalog, OR does not correspond to the streaming media OR no media is being streamed at the time of receipt of this command, the server SHALL return an error status of INVALID_ARGUMENT. + */ +- (void)activateTextTrackWithParams:(MTRMediaPlaybackClusterActivateTextTrackParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command DeactivateTextTrack + * + * If a Text Track is active (i.e. being displayed), upon receipt of this command, the server SHALL stop displaying it. + */ +- (void)deactivateTextTrackWithParams:(MTRMediaPlaybackClusterDeactivateTextTrackParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)deactivateTextTrackWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeCurrentStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeCurrentStateWithParams:(MTRSubscribeParams *)params @@ -12287,6 +12321,30 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); + (void)readAttributeSeekRangeStartWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)readAttributeActiveAudioTrackWithCompletion:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeActiveAudioTrackWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeActiveAudioTrackWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAvailableAudioTracksWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAvailableAudioTracksWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAvailableAudioTracksWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeActiveTextTrackWithCompletion:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeActiveTextTrackWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeActiveTextTrackWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAvailableTextTracksWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAvailableTextTracksWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAvailableTextTracksWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished @@ -12983,8 +13041,6 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) * The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. */ - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)logoutWithCompletion:(MTRStatusCompletion)completion - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params @@ -13039,6 +13095,254 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @end +/** + * Cluster Content Control + * + * This cluster is used for managing the content control (including "parental control") settings on a media device such as a TV, or Set-top Box. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterContentControl : MTRGenericBaseCluster + +/** + * Command UpdatePIN + * + * The purpose of this command is to update the PIN used for protecting configuration of the content control settings. Upon success, the old PIN SHALL no longer work. The PIN is used to ensure that only the Node (or User) with the PIN code can make changes to the Content Control settings, for example, turn off Content Controls or modify the ScreenDailyTime. The PIN is composed of a numeric string of up to 6 human readable characters (displayable) . Upon receipt of this command, the media device SHALL check if the OldPIN field of this command is the same as the current PIN. If the PINs are the same, then the PIN code SHALL be set to NewPIN. Otherwise a response with InvalidPINCode error status SHALL be returned. The media device MAY provide a default PIN to the User via an out of band mechanism. For security reasons, it is recommended that a client encourage the user to update the PIN from its default value when performing configuration of the Content Control settings exposed by this cluster. The ResetPIN command can also be used to obtain the default PIN. + */ +- (void)updatePINWithParams:(MTRContentControlClusterUpdatePINParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command ResetPIN + * + * The purpose of this command is to reset the PIN. If this command is executed successfully, a ResetPINResponse command with a new PIN SHALL be returned. + */ +- (void)resetPINWithParams:(MTRContentControlClusterResetPINParams * _Nullable)params completion:(void (^)(MTRContentControlClusterResetPINResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)resetPINWithCompletion:(void (^)(MTRContentControlClusterResetPINResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command Enable + * + * The purpose of this command is to turn on the Content Control feature on a media device. On receipt of the Enable command, the media device SHALL set the Enabled attribute to TRUE. + */ +- (void)enableWithParams:(MTRContentControlClusterEnableParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)enableWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command Disable + * + * The purpose of this command is to turn off the Content Control feature on a media device. On receipt of the Disable command, the media device SHALL set the Enabled attribute to FALSE. + */ +- (void)disableWithParams:(MTRContentControlClusterDisableParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)disableWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command AddBonusTime + * + * The purpose of this command is to add the extra screen time for the user. If a client with Operate privilege invokes this command, the media device SHALL check whether the PINCode passed in the command matches the current PINCode value. If these match, then the RemainingScreenTime attribute SHALL be increased by the specified BonusTime value. If the PINs do not match, then a response with InvalidPINCode error status SHALL be returned, and no changes SHALL be made to RemainingScreenTime. If a client with Manage privilege or greater invokes this command, the media device SHALL ignore the PINCode field and directly increase the RemainingScreenTime attribute by the specified BonusTime value. A server that does not support the PM feature SHALL respond with InvalidPINCode to clients that only have Operate privilege unless: It has been provided with the PIN value to expect via an out of band mechanism, and The client has provided a PINCode that matches the expected PIN value. + */ +- (void)addBonusTimeWithParams:(MTRContentControlClusterAddBonusTimeParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetScreenDailyTime + * + * The purpose of this command is to set the ScreenDailyTime attribute. On receipt of the SetScreenDailyTime command, the media device SHALL set the ScreenDailyTime attribute to the ScreenTime value. + */ +- (void)setScreenDailyTimeWithParams:(MTRContentControlClusterSetScreenDailyTimeParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command BlockUnratedContent + * + * The purpose of this command is to specify whether programs with no Content rating must be blocked by this media device. On receipt of the BlockUnratedContent command, the media device SHALL set the BlockUnrated attribute to TRUE. + */ +- (void)blockUnratedContentWithParams:(MTRContentControlClusterBlockUnratedContentParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)blockUnratedContentWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command UnblockUnratedContent + * + * The purpose of this command is to specify whether programs with no Content rating must be blocked by this media device. On receipt of the UnblockUnratedContent command, the media device SHALL set the BlockUnrated attribute to FALSE. + */ +- (void)unblockUnratedContentWithParams:(MTRContentControlClusterUnblockUnratedContentParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)unblockUnratedContentWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetOnDemandRatingThreshold + * + * The purpose of this command is to set the OnDemandRatingThreshold attribute. On receipt of the SetOnDemandRatingThreshold command, the media device SHALL check if the Rating field is one of values present in the OnDemandRatings attribute. If not, then a response with InvalidRating error status SHALL be returned. + */ +- (void)setOnDemandRatingThresholdWithParams:(MTRContentControlClusterSetOnDemandRatingThresholdParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetScheduledContentRatingThreshold + * + * The purpose of this command is to set ScheduledContentRatingThreshold attribute. On receipt of the SetScheduledContentRatingThreshold command, the media device SHALL check if the Rating field is one of values present in the ScheduledContentRatings attribute. If not, then a response with InvalidRating error status SHALL be returned. + */ +- (void)setScheduledContentRatingThresholdWithParams:(MTRContentControlClusterSetScheduledContentRatingThresholdParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeOnDemandRatingsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeOnDemandRatingsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeOnDemandRatingsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeOnDemandRatingThresholdWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeOnDemandRatingThresholdWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeOnDemandRatingThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeScheduledContentRatingsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeScheduledContentRatingsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeScheduledContentRatingsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeScheduledContentRatingThresholdWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeScheduledContentRatingThresholdWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeScheduledContentRatingThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeScreenDailyTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeScreenDailyTimeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeScreenDailyTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeRemainingScreenTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeRemainingScreenTimeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeRemainingScreenTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeBlockUnratedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeBlockUnratedWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeBlockUnratedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterContentControl (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + +/** + * Cluster Content App Observer + * + * This cluster provides an interface for sending targeted commands to an Observer of a Content App on a Video Player device such as a Streaming Media Player, Smart TV or Smart Screen. The cluster server for Content App Observer is implemented by an endpoint that communicates with a Content App, such as a Casting Video Client. The cluster client for Content App Observer is implemented by a Content App endpoint. A Content App is informed of the NodeId of an Observer when a binding is set on the Content App. The Content App can then send the ContentAppMessage to the Observer (server cluster), and the Observer responds with a ContentAppMessageResponse. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterContentAppObserver : MTRGenericBaseCluster + +/** + * Command ContentAppMessage + * + * Upon receipt, the data field MAY be parsed and interpreted. Message encoding is specific to the Content App. A Content App MAY when possible read attributes from the Basic Information Cluster on the Observer and use this to determine the Message encoding. + */ +- (void)contentAppMessageWithParams:(MTRContentAppObserverClusterContentAppMessageParams *)params completion:(void (^)(MTRContentAppObserverClusterContentAppMessageResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterContentAppObserver (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Electrical Measurement * @@ -17690,6 +17994,12 @@ typedef NS_OPTIONS(uint32_t, MTRRadonConcentrationMeasurementFeature) { MTRRadonConcentrationMeasurementFeatureAverageMeasurement MTR_PROVISIONALLY_AVAILABLE = 0x20, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRChannelType) { + MTRChannelTypeSatellite MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRChannelTypeCable MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRChannelTypeTerrestrial MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRChannelLineupInfoType) { MTRChannelLineupInfoTypeMSO MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00, MTRChannelLineupInfoTypeMso MTR_DEPRECATED("Please use MTRChannelLineupInfoTypeMSO", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) = 0x00, @@ -17704,14 +18014,43 @@ typedef NS_ENUM(uint8_t, MTRChannelStatus) { typedef NS_OPTIONS(uint32_t, MTRChannelFeature) { MTRChannelFeatureChannelList MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, MTRChannelFeatureLineupInfo MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, + MTRChannelFeatureElectronicGuide MTR_PROVISIONALLY_AVAILABLE = 0x3, + MTRChannelFeatureRecordProgram MTR_PROVISIONALLY_AVAILABLE = 0x4, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint32_t, MTRChannelRecordingFlagBitmap) { + MTRChannelRecordingFlagBitmapScheduled MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRChannelRecordingFlagBitmapRecordSeries MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRChannelRecordingFlagBitmapRecorded MTR_PROVISIONALLY_AVAILABLE = 0x3, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRTargetNavigatorStatus) { MTRTargetNavigatorStatusSuccess MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, MTRTargetNavigatorStatusTargetNotFound MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, MTRTargetNavigatorStatusNotAllowed MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x02, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_ENUM(uint8_t, MTRMediaPlaybackCharacteristic) { + MTRMediaPlaybackCharacteristicForcedSubtitles MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRMediaPlaybackCharacteristicDescribesVideo MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRMediaPlaybackCharacteristicEasyToRead MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRMediaPlaybackCharacteristicFrameBased MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRMediaPlaybackCharacteristicMainProgram MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTRMediaPlaybackCharacteristicOriginalContent MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTRMediaPlaybackCharacteristicVoiceOverTranslation MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRMediaPlaybackCharacteristicCaption MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTRMediaPlaybackCharacteristicSubtitle MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTRMediaPlaybackCharacteristicAlternate MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTRMediaPlaybackCharacteristicSupplementary MTR_PROVISIONALLY_AVAILABLE = 0x0A, + MTRMediaPlaybackCharacteristicCommentary MTR_PROVISIONALLY_AVAILABLE = 0x0B, + MTRMediaPlaybackCharacteristicDubbedTranslation MTR_PROVISIONALLY_AVAILABLE = 0x0C, + MTRMediaPlaybackCharacteristicDescription MTR_PROVISIONALLY_AVAILABLE = 0x0D, + MTRMediaPlaybackCharacteristicMetadata MTR_PROVISIONALLY_AVAILABLE = 0x0E, + MTRMediaPlaybackCharacteristicEnhancedAudioIntelligibility MTR_PROVISIONALLY_AVAILABLE = 0x0F, + MTRMediaPlaybackCharacteristicEmergency MTR_PROVISIONALLY_AVAILABLE = 0x10, + MTRMediaPlaybackCharacteristicKaraoke MTR_PROVISIONALLY_AVAILABLE = 0x11, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRMediaPlaybackPlaybackState) { MTRMediaPlaybackPlaybackStatePlaying MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, MTRMediaPlaybackPlaybackStatePaused MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, @@ -17731,6 +18070,9 @@ typedef NS_ENUM(uint8_t, MTRMediaPlaybackStatus) { typedef NS_OPTIONS(uint32_t, MTRMediaPlaybackFeature) { MTRMediaPlaybackFeatureAdvancedSeek MTR_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) = 0x1, MTRMediaPlaybackFeatureVariableSpeed MTR_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) = 0x2, + MTRMediaPlaybackFeatureTextTracks MTR_PROVISIONALLY_AVAILABLE = 0x3, + MTRMediaPlaybackFeatureAudioTracks MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRMediaPlaybackFeatureAudioAdvance MTR_PROVISIONALLY_AVAILABLE = 0x5, } MTR_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)); typedef NS_ENUM(uint8_t, MTRMediaInputInputType) { @@ -18118,6 +18460,27 @@ typedef NS_OPTIONS(uint32_t, MTRKeypadInputFeature) { MTRKeypadInputFeatureNumberKeys MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x4, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_ENUM(uint8_t, MTRContentLauncherCharacteristic) { + MTRContentLauncherCharacteristicForcedSubtitles MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRContentLauncherCharacteristicDescribesVideo MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRContentLauncherCharacteristicEasyToRead MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRContentLauncherCharacteristicFrameBased MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRContentLauncherCharacteristicMainProgram MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTRContentLauncherCharacteristicOriginalContent MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTRContentLauncherCharacteristicVoiceOverTranslation MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRContentLauncherCharacteristicCaption MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTRContentLauncherCharacteristicSubtitle MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTRContentLauncherCharacteristicAlternate MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTRContentLauncherCharacteristicSupplementary MTR_PROVISIONALLY_AVAILABLE = 0x0A, + MTRContentLauncherCharacteristicCommentary MTR_PROVISIONALLY_AVAILABLE = 0x0B, + MTRContentLauncherCharacteristicDubbedTranslation MTR_PROVISIONALLY_AVAILABLE = 0x0C, + MTRContentLauncherCharacteristicDescription MTR_PROVISIONALLY_AVAILABLE = 0x0D, + MTRContentLauncherCharacteristicMetadata MTR_PROVISIONALLY_AVAILABLE = 0x0E, + MTRContentLauncherCharacteristicEnhancedAudioIntelligibility MTR_PROVISIONALLY_AVAILABLE = 0x0F, + MTRContentLauncherCharacteristicEmergency MTR_PROVISIONALLY_AVAILABLE = 0x10, + MTRContentLauncherCharacteristicKaraoke MTR_PROVISIONALLY_AVAILABLE = 0x11, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRContentLauncherMetricType) { MTRContentLauncherMetricTypePixels MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00, MTRContentLauncherMetricTypePIXELS MTR_DEPRECATED("Please use MTRContentLauncherMetricTypePixels", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) = 0x00, @@ -18140,12 +18503,17 @@ typedef NS_ENUM(uint8_t, MTRContentLauncherParameter) { MTRContentLauncherParameterSportsTeam MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x0B, MTRContentLauncherParameterType MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x0C, MTRContentLauncherParameterVideo MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0D, + MTRContentLauncherParameterSeason MTR_PROVISIONALLY_AVAILABLE = 0x0E, + MTRContentLauncherParameterEpisode MTR_PROVISIONALLY_AVAILABLE = 0x0F, + MTRContentLauncherParameterAny MTR_PROVISIONALLY_AVAILABLE = 0x10, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRContentLauncherStatus) { MTRContentLauncherStatusSuccess MTR_NEWLY_AVAILABLE = 0x00, MTRContentLauncherStatusURLNotAvailable MTR_NEWLY_AVAILABLE = 0x01, MTRContentLauncherStatusAuthFailed MTR_NEWLY_AVAILABLE = 0x02, + MTRContentLauncherStatusTextTrackNotAvailable MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRContentLauncherStatusAudioTrackNotAvailable MTR_PROVISIONALLY_AVAILABLE = 0x04, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRContentLauncherContentLaunchStatus) { @@ -18164,11 +18532,15 @@ typedef NS_ENUM(uint8_t, MTRContentLauncherContentLaunchStatus) { typedef NS_OPTIONS(uint32_t, MTRContentLauncherFeature) { MTRContentLauncherFeatureContentSearch MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, MTRContentLauncherFeatureURLPlayback MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, + MTRContentLauncherFeatureAdvancedSeek MTR_PROVISIONALLY_AVAILABLE = 0x3, + MTRContentLauncherFeatureTextTracks MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRContentLauncherFeatureAudioTracks MTR_PROVISIONALLY_AVAILABLE = 0x5, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint32_t, MTRContentLauncherSupportedProtocolsBitmap) { MTRContentLauncherSupportedProtocolsBitmapDASH MTR_NEWLY_AVAILABLE = 0x1, MTRContentLauncherSupportedProtocolsBitmapHLS MTR_NEWLY_AVAILABLE = 0x2, + MTRContentLauncherSupportedProtocolsBitmapWebRTC MTR_PROVISIONALLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_OPTIONS(uint32_t, MTRContentLauncherSupportedStreamingProtocol) { @@ -18213,6 +18585,19 @@ typedef NS_ENUM(uint8_t, MTRApplicationBasicApplicationStatus) { MTRApplicationBasicApplicationStatusActiveVisibleNotFocus MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x03, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint32_t, MTRContentControlFeature) { + MTRContentControlFeatureScreenTime MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRContentControlFeaturePINManagement MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRContentControlFeatureBlockUnrated MTR_PROVISIONALLY_AVAILABLE = 0x3, + MTRContentControlFeatureOnDemandContentRating MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRContentControlFeatureScheduledContentRating MTR_PROVISIONALLY_AVAILABLE = 0x5, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRContentAppObserverStatus) { + MTRContentAppObserverStatusSuccess MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRContentAppObserverStatusUnexpectedData MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRUnitTestingSimple) { MTRUnitTestingSimpleUnspecified MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00, MTRUnitTestingSimpleValueA MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x01, @@ -24950,12 +25335,8 @@ typedef NS_OPTIONS(uint8_t, MTRTestClusterSimpleBitmap) { MTR_DEPRECATED("Please use nextWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use rewindWithParams:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)rewindWithCompletionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler - MTR_DEPRECATED("Please use rewindWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use fastForwardWithParams:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)fastForwardWithCompletionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler - MTR_DEPRECATED("Please use fastForwardWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use skipForwardWithParams:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)params completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler @@ -25516,8 +25897,6 @@ typedef NS_OPTIONS(uint8_t, MTRTestClusterSimpleBitmap) { MTR_DEPRECATED("Please use loginWithParams:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use logoutWithParams:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)logoutWithCompletionHandler:(MTRStatusCompletion)completionHandler - MTR_DEPRECATED("Please use logoutWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeGeneratedCommandListWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index fc1620dca6a39a..70a9678fab237f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -88766,6 +88766,78 @@ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params compl queue:self.callbackQueue completion:responseHandler]; } +- (void)getProgramGuideWithParams:(MTRChannelClusterGetProgramGuideParams * _Nullable)params completion:(void (^)(MTRChannelClusterProgramGuideResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRChannelClusterGetProgramGuideParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Channel::Commands::GetProgramGuide::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRChannelClusterProgramGuideResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)recordProgramWithParams:(MTRChannelClusterRecordProgramParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRChannelClusterRecordProgramParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Channel::Commands::RecordProgram::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)cancelRecordProgramWithParams:(MTRChannelClusterCancelRecordProgramParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRChannelClusterCancelRecordProgramParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Channel::Commands::CancelRecordProgram::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)readAttributeChannelListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { @@ -90155,10 +90227,6 @@ - (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params com queue:self.callbackQueue completion:responseHandler]; } -- (void)rewindWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion -{ - [self rewindWithParams:nil completion:completion]; -} - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { @@ -90183,10 +90251,6 @@ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params queue:self.callbackQueue completion:responseHandler]; } -- (void)fastForwardWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion -{ - [self fastForwardWithParams:nil completion:completion]; -} - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { @@ -90283,6 +90347,82 @@ - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params completion:(v queue:self.callbackQueue completion:responseHandler]; } +- (void)activateAudioTrackWithParams:(MTRMediaPlaybackClusterActivateAudioTrackParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMediaPlaybackClusterActivateAudioTrackParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::ActivateAudioTrack::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)activateTextTrackWithParams:(MTRMediaPlaybackClusterActivateTextTrackParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMediaPlaybackClusterActivateTextTrackParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::ActivateTextTrack::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)deactivateTextTrackWithCompletion:(MTRStatusCompletion)completion +{ + [self deactivateTextTrackWithParams:nil completion:completion]; +} +- (void)deactivateTextTrackWithParams:(MTRMediaPlaybackClusterDeactivateTextTrackParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMediaPlaybackClusterDeactivateTextTrackParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::DeactivateTextTrack::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)readAttributeCurrentStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { @@ -90536,6 +90676,150 @@ + (void)readAttributeSeekRangeStartWithClusterStateCache:(MTRClusterStateCacheCo completion:completion]; } +- (void)readAttributeActiveAudioTrackWithCompletion:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MediaPlayback::Attributes::ActiveAudioTrack::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeActiveAudioTrackWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MediaPlayback::Attributes::ActiveAudioTrack::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeActiveAudioTrackWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MediaPlayback::Attributes::ActiveAudioTrack::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAvailableAudioTracksWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MediaPlayback::Attributes::AvailableAudioTracks::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAvailableAudioTracksWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MediaPlayback::Attributes::AvailableAudioTracks::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAvailableAudioTracksWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MediaPlayback::Attributes::AvailableAudioTracks::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeActiveTextTrackWithCompletion:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MediaPlayback::Attributes::ActiveTextTrack::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeActiveTextTrackWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MediaPlayback::Attributes::ActiveTextTrack::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeActiveTextTrackWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MediaPlayback::Attributes::ActiveTextTrack::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAvailableTextTracksWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MediaPlayback::Attributes::AvailableTextTracks::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAvailableTextTracksWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MediaPlayback::Attributes::AvailableTextTracks::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAvailableTextTracksWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MediaPlayback::Attributes::AvailableTextTracks::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = MediaPlayback::Attributes::GeneratedCommandList::TypeInfo; @@ -90836,10 +91120,6 @@ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params completionHandler(static_cast(data), error); }]; } -- (void)rewindWithCompletionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler -{ - [self rewindWithParams:nil completionHandler:completionHandler]; -} - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { [self fastForwardWithParams:params completion: @@ -90848,10 +91128,6 @@ - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nulla completionHandler(static_cast(data), error); }]; } -- (void)fastForwardWithCompletionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler -{ - [self fastForwardWithParams:nil completionHandler:completionHandler]; -} - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { [self skipForwardWithParams:params completion: @@ -95853,10 +96129,6 @@ - (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params completion:( queue:self.callbackQueue completion:responseHandler]; } -- (void)logoutWithCompletion:(MTRStatusCompletion)completion -{ - [self logoutWithParams:nil completion:completion]; -} - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params completion:(MTRStatusCompletion)completion { if (params == nil) { @@ -96123,10 +96395,6 @@ - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params [self logoutWithParams:params completion: completionHandler]; } -- (void)logoutWithCompletionHandler:(MTRStatusCompletion)completionHandler -{ - [self logoutWithParams:nil completionHandler:completionHandler]; -} - (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { @@ -96312,6 +96580,1020 @@ - (nullable instancetype)initWithDevice:(MTRBaseDevice *)device @end +@implementation MTRBaseClusterContentControl + +- (void)updatePINWithParams:(MTRContentControlClusterUpdatePINParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterUpdatePINParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::UpdatePIN::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)resetPINWithCompletion:(void (^)(MTRContentControlClusterResetPINResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self resetPINWithParams:nil completion:completion]; +} +- (void)resetPINWithParams:(MTRContentControlClusterResetPINParams * _Nullable)params completion:(void (^)(MTRContentControlClusterResetPINResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRContentControlClusterResetPINParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::ResetPIN::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRContentControlClusterResetPINResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)enableWithCompletion:(MTRStatusCompletion)completion +{ + [self enableWithParams:nil completion:completion]; +} +- (void)enableWithParams:(MTRContentControlClusterEnableParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterEnableParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::Enable::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)disableWithCompletion:(MTRStatusCompletion)completion +{ + [self disableWithParams:nil completion:completion]; +} +- (void)disableWithParams:(MTRContentControlClusterDisableParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterDisableParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::Disable::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)addBonusTimeWithParams:(MTRContentControlClusterAddBonusTimeParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterAddBonusTimeParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::AddBonusTime::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setScreenDailyTimeWithParams:(MTRContentControlClusterSetScreenDailyTimeParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterSetScreenDailyTimeParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::SetScreenDailyTime::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)blockUnratedContentWithCompletion:(MTRStatusCompletion)completion +{ + [self blockUnratedContentWithParams:nil completion:completion]; +} +- (void)blockUnratedContentWithParams:(MTRContentControlClusterBlockUnratedContentParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterBlockUnratedContentParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::BlockUnratedContent::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)unblockUnratedContentWithCompletion:(MTRStatusCompletion)completion +{ + [self unblockUnratedContentWithParams:nil completion:completion]; +} +- (void)unblockUnratedContentWithParams:(MTRContentControlClusterUnblockUnratedContentParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterUnblockUnratedContentParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::UnblockUnratedContent::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setOnDemandRatingThresholdWithParams:(MTRContentControlClusterSetOnDemandRatingThresholdParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterSetOnDemandRatingThresholdParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::SetOnDemandRatingThreshold::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setScheduledContentRatingThresholdWithParams:(MTRContentControlClusterSetScheduledContentRatingThresholdParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterSetScheduledContentRatingThresholdParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::SetScheduledContentRatingThreshold::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::Enabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::Enabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::Enabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeOnDemandRatingsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::OnDemandRatings::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeOnDemandRatingsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::OnDemandRatings::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeOnDemandRatingsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::OnDemandRatings::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeOnDemandRatingThresholdWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::OnDemandRatingThreshold::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeOnDemandRatingThresholdWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::OnDemandRatingThreshold::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeOnDemandRatingThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::OnDemandRatingThreshold::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeScheduledContentRatingsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::ScheduledContentRatings::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeScheduledContentRatingsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::ScheduledContentRatings::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeScheduledContentRatingsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::ScheduledContentRatings::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeScheduledContentRatingThresholdWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::ScheduledContentRatingThreshold::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeScheduledContentRatingThresholdWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::ScheduledContentRatingThreshold::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeScheduledContentRatingThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::ScheduledContentRatingThreshold::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeScreenDailyTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::ScreenDailyTime::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeScreenDailyTimeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::ScreenDailyTime::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeScreenDailyTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::ScreenDailyTime::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeRemainingScreenTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::RemainingScreenTime::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeRemainingScreenTimeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::RemainingScreenTime::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeRemainingScreenTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::RemainingScreenTime::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeBlockUnratedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::BlockUnrated::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeBlockUnratedWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::BlockUnrated::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeBlockUnratedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::BlockUnrated::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentControl::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentControl::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + +@implementation MTRBaseClusterContentAppObserver + +- (void)contentAppMessageWithParams:(MTRContentAppObserverClusterContentAppMessageParams *)params completion:(void (^)(MTRContentAppObserverClusterContentAppMessageResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRContentAppObserverClusterContentAppMessageParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentAppObserver::Commands::ContentAppMessage::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRContentAppObserverClusterContentAppMessageResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentAppObserver::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentAppObserver::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentAppObserver::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentAppObserver::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentAppObserver::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ContentAppObserver::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ContentAppObserver::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterElectricalMeasurement - (void)getProfileInfoCommandWithCompletion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 4d211586fd4602..6848470fc78b24 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -189,6 +189,8 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeApplicationLauncherID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000050C, MTRClusterIDTypeApplicationBasicID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000050D, MTRClusterIDTypeAccountLoginID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000050E, + MTRClusterIDTypeContentControlID MTR_PROVISIONALLY_AVAILABLE = 0x0000050F, + MTRClusterIDTypeContentAppObserverID MTR_PROVISIONALLY_AVAILABLE = 0x00000510, MTRClusterIDTypeElectricalMeasurementID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000B04, MTRClusterIDTypeUnitTestingID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0xFFF1FC05, MTRClusterIDTypeSampleMEIID MTR_PROVISIONALLY_AVAILABLE = 0xFFF1FC20, @@ -4395,6 +4397,10 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterMediaPlaybackAttributePlaybackSpeedID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000004, MTRAttributeIDTypeClusterMediaPlaybackAttributeSeekRangeEndID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000005, MTRAttributeIDTypeClusterMediaPlaybackAttributeSeekRangeStartID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000006, + MTRAttributeIDTypeClusterMediaPlaybackAttributeActiveAudioTrackID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + MTRAttributeIDTypeClusterMediaPlaybackAttributeAvailableAudioTracksID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, + MTRAttributeIDTypeClusterMediaPlaybackAttributeActiveTextTrackID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, + MTRAttributeIDTypeClusterMediaPlaybackAttributeAvailableTextTracksID MTR_PROVISIONALLY_AVAILABLE = 0x0000000A, MTRAttributeIDTypeClusterMediaPlaybackAttributeGeneratedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterMediaPlaybackAttributeAcceptedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterMediaPlaybackAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, @@ -4666,6 +4672,30 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterAccountLoginAttributeFeatureMapID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterAccountLoginAttributeClusterRevisionID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster ContentControl attributes + MTRAttributeIDTypeClusterContentControlAttributeEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterContentControlAttributeOnDemandRatingsID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterContentControlAttributeOnDemandRatingThresholdID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterContentControlAttributeScheduledContentRatingsID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterContentControlAttributeScheduledContentRatingThresholdID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterContentControlAttributeScreenDailyTimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterContentControlAttributeRemainingScreenTimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRAttributeIDTypeClusterContentControlAttributeBlockUnratedID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + MTRAttributeIDTypeClusterContentControlAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterContentControlAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterContentControlAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterContentControlAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterContentControlAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterContentControlAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + + // Cluster ContentAppObserver attributes + MTRAttributeIDTypeClusterContentAppObserverAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterContentAppObserverAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterContentAppObserverAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterContentAppObserverAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterContentAppObserverAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterContentAppObserverAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster ElectricalMeasurement deprecated attribute names MTRClusterElectricalMeasurementAttributeMeasurementTypeID MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterElectricalMeasurementAttributeMeasurementTypeID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @@ -6484,6 +6514,10 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterChannelCommandChangeChannelResponseID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000001, MTRCommandIDTypeClusterChannelCommandChangeChannelByNumberID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000002, MTRCommandIDTypeClusterChannelCommandSkipChannelID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000003, + MTRCommandIDTypeClusterChannelCommandGetProgramGuideID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRCommandIDTypeClusterChannelCommandProgramGuideResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRCommandIDTypeClusterChannelCommandRecordProgramID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRCommandIDTypeClusterChannelCommandCancelRecordProgramID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, // Cluster TargetNavigator deprecated command id names MTRClusterTargetNavigatorCommandNavigateTargetID @@ -6548,6 +6582,9 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterMediaPlaybackCommandSkipBackwardID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000009, MTRCommandIDTypeClusterMediaPlaybackCommandPlaybackResponseID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000A, MTRCommandIDTypeClusterMediaPlaybackCommandSeekID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000B, + MTRCommandIDTypeClusterMediaPlaybackCommandActivateAudioTrackID MTR_PROVISIONALLY_AVAILABLE = 0x0000000C, + MTRCommandIDTypeClusterMediaPlaybackCommandActivateTextTrackID MTR_PROVISIONALLY_AVAILABLE = 0x0000000D, + MTRCommandIDTypeClusterMediaPlaybackCommandDeactivateTextTrackID MTR_PROVISIONALLY_AVAILABLE = 0x0000000E, // Cluster MediaInput deprecated command id names MTRClusterMediaInputCommandSelectInputID @@ -6657,6 +6694,23 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterAccountLoginCommandLoginID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000002, MTRCommandIDTypeClusterAccountLoginCommandLogoutID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000003, + // Cluster ContentControl commands + MTRCommandIDTypeClusterContentControlCommandUpdatePINID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterContentControlCommandResetPINID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterContentControlCommandResetPINResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterContentControlCommandEnableID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterContentControlCommandDisableID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRCommandIDTypeClusterContentControlCommandAddBonusTimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRCommandIDTypeClusterContentControlCommandSetScreenDailyTimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRCommandIDTypeClusterContentControlCommandBlockUnratedContentID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + MTRCommandIDTypeClusterContentControlCommandUnblockUnratedContentID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, + MTRCommandIDTypeClusterContentControlCommandSetOnDemandRatingThresholdID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, + MTRCommandIDTypeClusterContentControlCommandSetScheduledContentRatingThresholdID MTR_PROVISIONALLY_AVAILABLE = 0x0000000A, + + // Cluster ContentAppObserver commands + MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster ElectricalMeasurement deprecated command id names MTRClusterElectricalMeasurementCommandGetProfileInfoResponseCommandID MTR_DEPRECATED("Please use MTRCommandIDTypeClusterElectricalMeasurementCommandGetProfileInfoResponseCommandID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @@ -7166,6 +7220,24 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterPumpConfigurationAndControlEventAirDetectionID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000F, MTREventIDTypeClusterPumpConfigurationAndControlEventTurbineOperationID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000010, + // Cluster TargetNavigator deprecated event names + + // Cluster TargetNavigator events + MTREventIDTypeClusterTargetNavigatorEventTargetUpdatedID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + + // Cluster MediaPlayback deprecated event names + + // Cluster MediaPlayback events + MTREventIDTypeClusterMediaPlaybackEventStateChangedID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + + // Cluster AccountLogin deprecated event names + + // Cluster AccountLogin events + MTREventIDTypeClusterAccountLoginEventLoggedOutID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + + // Cluster ContentControl events + MTREventIDTypeClusterContentControlEventRemainingScreenTimeExpiredID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + // Cluster TestCluster deprecated event names MTRClusterTestClusterEventTestEventID MTR_DEPRECATED("Please use MTREventIDTypeClusterUnitTestingEventTestEventID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 709973eabfc567..891e33cba7d31e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -5550,6 +5550,9 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRChannelClusterChangeChannelResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)changeChannelByNumberWithParams:(MTRChannelClusterChangeChannelByNumberParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)getProgramGuideWithParams:(MTRChannelClusterGetProgramGuideParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRChannelClusterProgramGuideResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)recordProgramWithParams:(MTRChannelClusterRecordProgramParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)cancelRecordProgramWithParams:(MTRChannelClusterCancelRecordProgramParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeChannelListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -5654,14 +5657,15 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (void)nextWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)rewindWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)fastForwardWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)activateAudioTrackWithParams:(MTRMediaPlaybackClusterActivateAudioTrackParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)activateTextTrackWithParams:(MTRMediaPlaybackClusterActivateTextTrackParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)deactivateTextTrackWithParams:(MTRMediaPlaybackClusterDeactivateTextTrackParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)deactivateTextTrackWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeCurrentStateWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -5677,6 +5681,14 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (NSDictionary * _Nullable)readAttributeSeekRangeStartWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +- (NSDictionary * _Nullable)readAttributeActiveAudioTrackWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAvailableAudioTracksWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeActiveTextTrackWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAvailableTextTracksWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -6029,8 +6041,6 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)logoutWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -6061,6 +6071,117 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @end +/** + * Cluster Content Control + * This cluster is used for managing the content control (including "parental control") settings on a media device such as a TV, or Set-top Box. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterContentControl : MTRGenericCluster + +- (void)updatePINWithParams:(MTRContentControlClusterUpdatePINParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)resetPINWithParams:(MTRContentControlClusterResetPINParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRContentControlClusterResetPINResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)resetPINWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRContentControlClusterResetPINResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)enableWithParams:(MTRContentControlClusterEnableParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)enableWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)disableWithParams:(MTRContentControlClusterDisableParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)disableWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)addBonusTimeWithParams:(MTRContentControlClusterAddBonusTimeParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setScreenDailyTimeWithParams:(MTRContentControlClusterSetScreenDailyTimeParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)blockUnratedContentWithParams:(MTRContentControlClusterBlockUnratedContentParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)blockUnratedContentWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)unblockUnratedContentWithParams:(MTRContentControlClusterUnblockUnratedContentParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)unblockUnratedContentWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)setOnDemandRatingThresholdWithParams:(MTRContentControlClusterSetOnDemandRatingThresholdParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setScheduledContentRatingThresholdWithParams:(MTRContentControlClusterSetScheduledContentRatingThresholdParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeOnDemandRatingsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeOnDemandRatingThresholdWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeScheduledContentRatingsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeScheduledContentRatingThresholdWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeScreenDailyTimeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeRemainingScreenTimeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeBlockUnratedWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterContentControl (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + +/** + * Cluster Content App Observer + * This cluster provides an interface for sending targeted commands to an Observer of a Content App on a Video Player device such as a Streaming Media Player, Smart TV or Smart Screen. The cluster server for Content App Observer is implemented by an endpoint that communicates with a Content App, such as a Casting Video Client. The cluster client for Content App Observer is implemented by a Content App endpoint. A Content App is informed of the NodeId of an Observer when a binding is set on the Content App. The Content App can then send the ContentAppMessage to the Observer (server cluster), and the Observer responds with a ContentAppMessageResponse. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterContentAppObserver : MTRGenericCluster + +- (void)contentAppMessageWithParams:(MTRContentAppObserverClusterContentAppMessageParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRContentAppObserverClusterContentAppMessageResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterContentAppObserver (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Electrical Measurement * Attributes related to the electrical properties of a device. This cluster is used by power outlets and other devices that need to provide instantaneous data as opposed to metrology data which should be retrieved from the metering cluster.. @@ -7467,9 +7588,7 @@ MTR_DEPRECATED("Please use MTRClusterUnitTesting", ios(16.1, 16.4), macos(13.0, - (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use nextWithParams:expectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)nextWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use nextWithExpectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use rewindWithParams:expectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)rewindWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use rewindWithExpectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use fastForwardWithParams:expectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)fastForwardWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use fastForwardWithExpectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use skipForwardWithParams:expectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use skipBackwardWithParams:expectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use seekWithParams:expectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @@ -7556,7 +7675,6 @@ MTR_DEPRECATED("Please use MTRClusterUnitTesting", ios(16.1, 16.4), macos(13.0, - (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable data, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use getSetupPINWithParams:expectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use loginWithParams:expectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use logoutWithParams:expectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)logoutWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use logoutWithExpectedValues:expectedValueInterval:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @end @interface MTRClusterElectricalMeasurement (Deprecated) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 2d640145143c03..f97fbea379ab13 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -15735,6 +15735,87 @@ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params expec completion:responseHandler]; } +- (void)getProgramGuideWithParams:(MTRChannelClusterGetProgramGuideParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRChannelClusterProgramGuideResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRChannelClusterGetProgramGuideParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Channel::Commands::GetProgramGuide::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRChannelClusterProgramGuideResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)recordProgramWithParams:(MTRChannelClusterRecordProgramParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRChannelClusterRecordProgramParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Channel::Commands::RecordProgram::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)cancelRecordProgramWithParams:(MTRChannelClusterCancelRecordProgramParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRChannelClusterCancelRecordProgramParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Channel::Commands::CancelRecordProgram::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + - (NSDictionary * _Nullable)readAttributeChannelListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeChannelID) attributeID:@(MTRAttributeIDTypeClusterChannelAttributeChannelListID) params:params]; @@ -16085,10 +16166,6 @@ - (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params exp completion:responseHandler]; } -- (void)rewindWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion -{ - [self rewindWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; -} - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { @@ -16116,10 +16193,6 @@ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params completion:responseHandler]; } -- (void)fastForwardWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion -{ - [self fastForwardWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; -} - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { @@ -16228,6 +16301,91 @@ - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params expectedValue completion:responseHandler]; } +- (void)activateAudioTrackWithParams:(MTRMediaPlaybackClusterActivateAudioTrackParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMediaPlaybackClusterActivateAudioTrackParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::ActivateAudioTrack::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)activateTextTrackWithParams:(MTRMediaPlaybackClusterActivateTextTrackParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMediaPlaybackClusterActivateTextTrackParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::ActivateTextTrack::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)deactivateTextTrackWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self deactivateTextTrackWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)deactivateTextTrackWithParams:(MTRMediaPlaybackClusterDeactivateTextTrackParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMediaPlaybackClusterDeactivateTextTrackParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MediaPlayback::Commands::DeactivateTextTrack::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + - (NSDictionary * _Nullable)readAttributeCurrentStateWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMediaPlaybackID) attributeID:@(MTRAttributeIDTypeClusterMediaPlaybackAttributeCurrentStateID) params:params]; @@ -16263,6 +16421,26 @@ - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params expectedValue return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMediaPlaybackID) attributeID:@(MTRAttributeIDTypeClusterMediaPlaybackAttributeSeekRangeStartID) params:params]; } +- (NSDictionary * _Nullable)readAttributeActiveAudioTrackWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMediaPlaybackID) attributeID:@(MTRAttributeIDTypeClusterMediaPlaybackAttributeActiveAudioTrackID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAvailableAudioTracksWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMediaPlaybackID) attributeID:@(MTRAttributeIDTypeClusterMediaPlaybackAttributeAvailableAudioTracksID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeActiveTextTrackWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMediaPlaybackID) attributeID:@(MTRAttributeIDTypeClusterMediaPlaybackAttributeActiveTextTrackID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAvailableTextTracksWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMediaPlaybackID) attributeID:@(MTRAttributeIDTypeClusterMediaPlaybackAttributeAvailableTextTracksID) params:params]; +} + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMediaPlaybackID) attributeID:@(MTRAttributeIDTypeClusterMediaPlaybackAttributeGeneratedCommandListID) params:params]; @@ -16382,10 +16560,6 @@ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params completionHandler(static_cast(data), error); }]; } -- (void)rewindWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler -{ - [self rewindWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completionHandler:completionHandler]; -} - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { [self fastForwardWithParams:params expectedValues:expectedDataValueDictionaries expectedValueInterval:expectedValueIntervalMs completion: @@ -16394,10 +16568,6 @@ - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nulla completionHandler(static_cast(data), error); }]; } -- (void)fastForwardWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler -{ - [self fastForwardWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completionHandler:completionHandler]; -} - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(void (^)(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler { [self skipForwardWithParams:params expectedValues:expectedDataValueDictionaries expectedValueInterval:expectedValueIntervalMs completion: @@ -17347,10 +17517,6 @@ - (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params expectedValu completion:responseHandler]; } -- (void)logoutWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - [self logoutWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; -} - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { if (params == nil) { @@ -17438,10 +17604,431 @@ - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params [self logoutWithParams:params expectedValues:expectedDataValueDictionaries expectedValueInterval:expectedValueIntervalMs completion: completionHandler]; } -- (void)logoutWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:(MTRStatusCompletion)completionHandler +@end + +@implementation MTRClusterContentControl + +- (void)updatePINWithParams:(MTRContentControlClusterUpdatePINParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterUpdatePINParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::UpdatePIN::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)resetPINWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRContentControlClusterResetPINResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self resetPINWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)resetPINWithParams:(MTRContentControlClusterResetPINParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRContentControlClusterResetPINResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRContentControlClusterResetPINParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::ResetPIN::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRContentControlClusterResetPINResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)enableWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self enableWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)enableWithParams:(MTRContentControlClusterEnableParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterEnableParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::Enable::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)disableWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { - [self logoutWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completionHandler:completionHandler]; + [self disableWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; } +- (void)disableWithParams:(MTRContentControlClusterDisableParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterDisableParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::Disable::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)addBonusTimeWithParams:(MTRContentControlClusterAddBonusTimeParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterAddBonusTimeParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::AddBonusTime::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)setScreenDailyTimeWithParams:(MTRContentControlClusterSetScreenDailyTimeParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterSetScreenDailyTimeParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::SetScreenDailyTime::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)blockUnratedContentWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self blockUnratedContentWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)blockUnratedContentWithParams:(MTRContentControlClusterBlockUnratedContentParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterBlockUnratedContentParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::BlockUnratedContent::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)unblockUnratedContentWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self unblockUnratedContentWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)unblockUnratedContentWithParams:(MTRContentControlClusterUnblockUnratedContentParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterUnblockUnratedContentParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::UnblockUnratedContent::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)setOnDemandRatingThresholdWithParams:(MTRContentControlClusterSetOnDemandRatingThresholdParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterSetOnDemandRatingThresholdParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::SetOnDemandRatingThreshold::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)setScheduledContentRatingThresholdWithParams:(MTRContentControlClusterSetScheduledContentRatingThresholdParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRContentControlClusterSetScheduledContentRatingThresholdParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentControl::Commands::SetScheduledContentRatingThreshold::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeEnabledID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeOnDemandRatingsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeOnDemandRatingsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeOnDemandRatingThresholdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeOnDemandRatingThresholdID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeScheduledContentRatingsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeScheduledContentRatingsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeScheduledContentRatingThresholdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeScheduledContentRatingThresholdID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeScreenDailyTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeScreenDailyTimeID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeRemainingScreenTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeRemainingScreenTimeID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeBlockUnratedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeBlockUnratedID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentControlID) attributeID:@(MTRAttributeIDTypeClusterContentControlAttributeClusterRevisionID) params:params]; +} + +@end + +@implementation MTRClusterContentAppObserver + +- (void)contentAppMessageWithParams:(MTRContentAppObserverClusterContentAppMessageParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRContentAppObserverClusterContentAppMessageResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRContentAppObserverClusterContentAppMessageParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ContentAppObserver::Commands::ContentAppMessage::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRContentAppObserverClusterContentAppMessageResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentAppObserverID) attributeID:@(MTRAttributeIDTypeClusterContentAppObserverAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentAppObserverID) attributeID:@(MTRAttributeIDTypeClusterContentAppObserverAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentAppObserverID) attributeID:@(MTRAttributeIDTypeClusterContentAppObserverAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentAppObserverID) attributeID:@(MTRAttributeIDTypeClusterContentAppObserverAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentAppObserverID) attributeID:@(MTRAttributeIDTypeClusterContentAppObserverAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeContentAppObserverID) attributeID:@(MTRAttributeIDTypeClusterContentAppObserverAttributeClusterRevisionID) params:params]; +} + @end @implementation MTRClusterElectricalMeasurement diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index ceb44ac0de39f4..ceef69486bd281 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -8309,6 +8309,141 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterGetProgramGuideParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable startTime MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable endTime MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSArray * _Nullable channelList MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRChannelClusterPageTokenStruct * _Nullable pageToken MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable recordingFlag MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSArray * _Nullable externalIDList MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSData * _Nullable data MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterProgramGuideResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull channelPagingStruct MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSArray * _Nonnull programList MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRChannelClusterProgramGuideResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterRecordProgramParams : NSObject + +@property (nonatomic, copy) NSString * _Nonnull programIdentifier MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull shouldRecordSeries MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSArray * _Nonnull externalIDList MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSData * _Nonnull data MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterCancelRecordProgramParams : NSObject + +@property (nonatomic, copy) NSString * _Nonnull programIdentifier MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull shouldRecordSeries MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSArray * _Nonnull externalIDList MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSData * _Nonnull data MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRTargetNavigatorClusterNavigateTargetParams : NSObject @@ -8575,6 +8710,8 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRMediaPlaybackClusterRewindParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable audioAdvanceUnmuted MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -8603,6 +8740,8 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRMediaPlaybackClusterFastForwardParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable audioAdvanceUnmuted MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -8755,6 +8894,96 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRMediaPlaybackClusterActivateAudioTrackParams : NSObject + +@property (nonatomic, copy) NSString * _Nonnull trackID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull audioOutputIndex MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRMediaPlaybackClusterActivateTextTrackParams : NSObject + +@property (nonatomic, copy) NSString * _Nonnull trackID MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRMediaPlaybackClusterDeactivateTextTrackParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRMediaInputClusterSelectInputParams : NSObject @@ -8973,6 +9202,10 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSNumber * _Nonnull autoPlay MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @property (nonatomic, copy) NSString * _Nullable data MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); + +@property (nonatomic, copy) MTRContentLauncherClusterPlaybackPreferencesStruct * _Nullable playbackPreferences MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable useCurrentContext MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -9352,6 +9585,8 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSString * _Nonnull tempAccountIdentifier MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @property (nonatomic, copy) NSString * _Nonnull setupPIN MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); + +@property (nonatomic, copy) NSNumber * _Nullable node MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -9380,6 +9615,40 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRAccountLoginClusterLogoutParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable node MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterUpdatePINParams : NSObject + +@property (nonatomic, copy) NSString * _Nullable oldPIN MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy, getter=getNewPIN) NSString * _Nonnull newPIN MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -9406,6 +9675,342 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterResetPINParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterResetPINResponseParams : NSObject + +@property (nonatomic, copy) NSString * _Nonnull pinCode MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRContentControlClusterResetPINResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterEnableParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterDisableParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterAddBonusTimeParams : NSObject + +@property (nonatomic, copy) NSString * _Nullable pinCode MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable bonusTime MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterSetScreenDailyTimeParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull screenTime MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterBlockUnratedContentParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterUnblockUnratedContentParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterSetOnDemandRatingThresholdParams : NSObject + +@property (nonatomic, copy) NSString * _Nonnull rating MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterSetScheduledContentRatingThresholdParams : NSObject + +@property (nonatomic, copy) NSString * _Nonnull rating MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentAppObserverClusterContentAppMessageParams : NSObject + +@property (nonatomic, copy) NSString * _Nullable data MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nonnull encodingHint MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentAppObserverClusterContentAppMessageResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable status MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nonnull data MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nonnull encodingHint MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRContentAppObserverClusterContentAppMessageResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRElectricalMeasurementClusterGetProfileInfoResponseCommandParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 688d01e89da3c2..84aa2dd3157ba2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -23026,12 +23026,22 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRTargetNavigatorClusterNavigateTargetParams +@implementation MTRChannelClusterGetProgramGuideParams - (instancetype)init { if (self = [super init]) { - _target = @(0); + _startTime = nil; + + _endTime = nil; + + _channelList = nil; + + _pageToken = nil; + + _recordingFlag = nil; + + _externalIDList = nil; _data = nil; _timedInvokeTimeoutMs = nil; @@ -23042,9 +23052,14 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRTargetNavigatorClusterNavigateTargetParams alloc] init]; + auto other = [[MTRChannelClusterGetProgramGuideParams alloc] init]; - other.target = self.target; + other.startTime = self.startTime; + other.endTime = self.endTime; + other.channelList = self.channelList; + other.pageToken = self.pageToken; + other.recordingFlag = self.recordingFlag; + other.externalIDList = self.externalIDList; other.data = self.data; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23054,25 +23069,133 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: target:%@; data:%@; >", NSStringFromClass([self class]), _target, _data]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: startTime:%@; endTime:%@; channelList:%@; pageToken:%@; recordingFlag:%@; externalIDList:%@; data:%@; >", NSStringFromClass([self class]), _startTime, _endTime, _channelList, _pageToken, _recordingFlag, _externalIDList, [_data base64EncodedStringWithOptions:0]]; return descriptionString; } @end -@implementation MTRTargetNavigatorClusterNavigateTargetParams (InternalMethods) +@implementation MTRChannelClusterGetProgramGuideParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type encodableStruct; + chip::app::Clusters::Channel::Commands::GetProgramGuide::Type encodableStruct; ListFreer listFreer; { - encodableStruct.target = self.target.unsignedCharValue; + if (self.startTime != nil) { + auto & definedValue_0 = encodableStruct.startTime.Emplace(); + definedValue_0 = self.startTime.unsignedIntValue; + } + } + { + if (self.endTime != nil) { + auto & definedValue_0 = encodableStruct.endTime.Emplace(); + definedValue_0 = self.endTime.unsignedIntValue; + } + } + { + if (self.channelList != nil) { + auto & definedValue_0 = encodableStruct.channelList.Emplace(); + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.channelList.count != 0) { + auto * listHolder_1 = new ListHolder(self.channelList.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.channelList.count; ++i_1) { + if (![self.channelList[i_1] isKindOfClass:[MTRChannelClusterChannelInfoStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRChannelClusterChannelInfoStruct *) self.channelList[i_1]; + listHolder_1->mList[i_1].majorNumber = element_1.majorNumber.unsignedShortValue; + listHolder_1->mList[i_1].minorNumber = element_1.minorNumber.unsignedShortValue; + if (element_1.name != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].name.Emplace(); + definedValue_3 = AsCharSpan(element_1.name); + } + if (element_1.callSign != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].callSign.Emplace(); + definedValue_3 = AsCharSpan(element_1.callSign); + } + if (element_1.affiliateCallSign != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].affiliateCallSign.Emplace(); + definedValue_3 = AsCharSpan(element_1.affiliateCallSign); + } + if (element_1.identifier != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].identifier.Emplace(); + definedValue_3 = AsCharSpan(element_1.identifier); + } + if (element_1.type != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].type.Emplace(); + definedValue_3 = static_cast>(element_1.type.unsignedCharValue); + } + } + definedValue_0 = ListType_1(listHolder_1->mList, self.channelList.count); + } else { + definedValue_0 = ListType_1(); + } + } + } + } + { + if (self.pageToken != nil) { + auto & definedValue_0 = encodableStruct.pageToken.Emplace(); + if (self.pageToken.limit != nil) { + auto & definedValue_2 = definedValue_0.limit.Emplace(); + definedValue_2 = self.pageToken.limit.unsignedShortValue; + } + if (self.pageToken.after != nil) { + auto & definedValue_2 = definedValue_0.after.Emplace(); + definedValue_2 = AsCharSpan(self.pageToken.after); + } + if (self.pageToken.before != nil) { + auto & definedValue_2 = definedValue_0.before.Emplace(); + definedValue_2 = AsCharSpan(self.pageToken.before); + } + } + } + { + if (self.recordingFlag != nil) { + auto & definedValue_0 = encodableStruct.recordingFlag.Emplace(); + definedValue_0 = static_cast>(self.recordingFlag.unsignedIntValue); + } + } + { + if (self.externalIDList != nil) { + auto & definedValue_0 = encodableStruct.externalIDList.Emplace(); + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.externalIDList.count != 0) { + auto * listHolder_1 = new ListHolder(self.externalIDList.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.externalIDList.count; ++i_1) { + if (![self.externalIDList[i_1] isKindOfClass:[MTRChannelClusterAdditionalInfoStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRChannelClusterAdditionalInfoStruct *) self.externalIDList[i_1]; + listHolder_1->mList[i_1].name = AsCharSpan(element_1.name); + listHolder_1->mList[i_1].value = AsCharSpan(element_1.value); + } + definedValue_0 = ListType_1(listHolder_1->mList, self.externalIDList.count); + } else { + definedValue_0 = ListType_1(); + } + } + } } { if (self.data != nil) { auto & definedValue_0 = encodableStruct.data.Emplace(); - definedValue_0 = AsCharSpan(self.data); + definedValue_0 = AsByteSpan(self.data); } } @@ -23114,33 +23237,31 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRTargetNavigatorClusterNavigateTargetResponseParams +@implementation MTRChannelClusterProgramGuideResponseParams - (instancetype)init { if (self = [super init]) { - _status = @(0); + _channelPagingStruct = @(0); - _data = nil; - _timedInvokeTimeoutMs = nil; + _programList = [NSArray array]; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRTargetNavigatorClusterNavigateTargetResponseParams alloc] init]; + auto other = [[MTRChannelClusterProgramGuideResponseParams alloc] init]; - other.status = self.status; - other.data = self.data; - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.channelPagingStruct = self.channelPagingStruct; + other.programList = self.programList; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: channelPagingStruct:%@; programList:%@; >", NSStringFromClass([self class]), _channelPagingStruct, _programList]; return descriptionString; } @@ -23151,7 +23272,7 @@ - (nullable instancetype)initWithResponseValue:(NSDictionary *)r return nil; } - using DecodableType = chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType; + using DecodableType = chip::app::Clusters::Channel::Commands::ProgramGuideResponse::DecodableType; chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue clusterID:DecodableType::GetClusterId() commandID:DecodableType::GetCommandId() @@ -23186,22 +23307,308 @@ - (nullable instancetype)initWithResponseValue:(NSDictionary *)r @end -@implementation MTRTargetNavigatorClusterNavigateTargetResponseParams (InternalMethods) +@implementation MTRChannelClusterProgramGuideResponseParams (InternalMethods) -- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &)decodableStruct +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::Channel::Commands::ProgramGuideResponse::DecodableType &)decodableStruct { { - self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + self.channelPagingStruct = [NSNumber numberWithShort:decodableStruct.channelPagingStruct]; } { - if (decodableStruct.data.HasValue()) { - self.data = AsString(decodableStruct.data.Value()); - if (self.data == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.programList.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRChannelClusterProgramStruct * newElement_0; + newElement_0 = [MTRChannelClusterProgramStruct new]; + newElement_0.identifier = AsString(entry_0.identifier); + if (newElement_0.identifier == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + newElement_0.channel = [MTRChannelClusterChannelInfoStruct new]; + newElement_0.channel.majorNumber = [NSNumber numberWithUnsignedShort:entry_0.channel.majorNumber]; + newElement_0.channel.minorNumber = [NSNumber numberWithUnsignedShort:entry_0.channel.minorNumber]; + if (entry_0.channel.name.HasValue()) { + newElement_0.channel.name = AsString(entry_0.channel.name.Value()); + if (newElement_0.channel.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.channel.name = nil; + } + if (entry_0.channel.callSign.HasValue()) { + newElement_0.channel.callSign = AsString(entry_0.channel.callSign.Value()); + if (newElement_0.channel.callSign == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.channel.callSign = nil; + } + if (entry_0.channel.affiliateCallSign.HasValue()) { + newElement_0.channel.affiliateCallSign = AsString(entry_0.channel.affiliateCallSign.Value()); + if (newElement_0.channel.affiliateCallSign == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.channel.affiliateCallSign = nil; + } + if (entry_0.channel.identifier.HasValue()) { + newElement_0.channel.identifier = AsString(entry_0.channel.identifier.Value()); + if (newElement_0.channel.identifier == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.channel.identifier = nil; + } + if (entry_0.channel.type.HasValue()) { + newElement_0.channel.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.channel.type.Value())]; + } else { + newElement_0.channel.type = nil; + } + newElement_0.startTime = [NSNumber numberWithUnsignedInt:entry_0.startTime]; + newElement_0.endTime = [NSNumber numberWithUnsignedInt:entry_0.endTime]; + newElement_0.title = AsString(entry_0.title); + if (newElement_0.title == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + if (entry_0.subtitle.HasValue()) { + newElement_0.subtitle = AsString(entry_0.subtitle.Value()); + if (newElement_0.subtitle == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.subtitle = nil; + } + if (entry_0.description.HasValue()) { + newElement_0.descriptionString = AsString(entry_0.description.Value()); + if (newElement_0.descriptionString == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.descriptionString = nil; + } + if (entry_0.audioLanguages.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.audioLanguages.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + NSString * newElement_3; + newElement_3 = AsString(entry_3); + if (newElement_3 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.audioLanguages = array_3; + } + } else { + newElement_0.audioLanguages = nil; + } + if (entry_0.ratings.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.ratings.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + NSString * newElement_3; + newElement_3 = AsString(entry_3); + if (newElement_3 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.ratings = array_3; + } + } else { + newElement_0.ratings = nil; + } + if (entry_0.thumbnailUrl.HasValue()) { + newElement_0.thumbnailUrl = AsString(entry_0.thumbnailUrl.Value()); + if (newElement_0.thumbnailUrl == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.thumbnailUrl = nil; + } + if (entry_0.posterArtUrl.HasValue()) { + newElement_0.posterArtUrl = AsString(entry_0.posterArtUrl.Value()); + if (newElement_0.posterArtUrl == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.posterArtUrl = nil; + } + if (entry_0.dvbiUrl.HasValue()) { + newElement_0.dvbiUrl = AsString(entry_0.dvbiUrl.Value()); + if (newElement_0.dvbiUrl == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.dvbiUrl = nil; + } + if (entry_0.releaseDate.HasValue()) { + newElement_0.releaseDate = AsString(entry_0.releaseDate.Value()); + if (newElement_0.releaseDate == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.releaseDate = nil; + } + if (entry_0.parentalGuidanceText.HasValue()) { + newElement_0.parentalGuidanceText = AsString(entry_0.parentalGuidanceText.Value()); + if (newElement_0.parentalGuidanceText == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.parentalGuidanceText = nil; + } + if (entry_0.recordingFlag.HasValue()) { + newElement_0.recordingFlag = [NSNumber numberWithUnsignedInt:entry_0.recordingFlag.Value().Raw()]; + } else { + newElement_0.recordingFlag = nil; + } + if (entry_0.seriesInfo.HasValue()) { + if (entry_0.seriesInfo.Value().IsNull()) { + newElement_0.seriesInfo = nil; + } else { + newElement_0.seriesInfo = [MTRChannelClusterSeriesInfoStruct new]; + newElement_0.seriesInfo.season = AsString(entry_0.seriesInfo.Value().Value().season); + if (newElement_0.seriesInfo.season == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + newElement_0.seriesInfo.episode = AsString(entry_0.seriesInfo.Value().Value().episode); + if (newElement_0.seriesInfo.episode == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } + } else { + newElement_0.seriesInfo = nil; + } + if (entry_0.categoryList.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.categoryList.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTRChannelClusterProgramCategoryStruct * newElement_3; + newElement_3 = [MTRChannelClusterProgramCategoryStruct new]; + newElement_3.category = AsString(entry_3.category); + if (newElement_3.category == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + if (entry_3.subCategory.HasValue()) { + newElement_3.subCategory = AsString(entry_3.subCategory.Value()); + if (newElement_3.subCategory == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_3.subCategory = nil; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.categoryList = array_3; + } + } else { + newElement_0.categoryList = nil; + } + if (entry_0.castList.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.castList.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTRChannelClusterProgramCastStruct * newElement_3; + newElement_3 = [MTRChannelClusterProgramCastStruct new]; + newElement_3.name = AsString(entry_3.name); + if (newElement_3.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + newElement_3.role = AsString(entry_3.role); + if (newElement_3.role == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.castList = array_3; + } + } else { + newElement_0.castList = nil; + } + if (entry_0.externalIDList.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.externalIDList.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTRChannelClusterProgramCastStruct * newElement_3; + newElement_3 = [MTRChannelClusterProgramCastStruct new]; + newElement_3.name = AsString(entry_3.name); + if (newElement_3.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + newElement_3.role = AsString(entry_3.role); + if (newElement_3.role == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.externalIDList = array_3; + } + } else { + newElement_0.externalIDList = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { return err; } - } else { - self.data = nil; + self.programList = array_0; } } return CHIP_NO_ERROR; @@ -23209,10 +23616,18 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::TargetNa @end -@implementation MTRMediaPlaybackClusterPlayParams +@implementation MTRChannelClusterRecordProgramParams - (instancetype)init { if (self = [super init]) { + + _programIdentifier = @""; + + _shouldRecordSeries = @(0); + + _externalIDList = [NSArray array]; + + _data = [NSData data]; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -23221,8 +23636,12 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterPlayParams alloc] init]; + auto other = [[MTRChannelClusterRecordProgramParams alloc] init]; + other.programIdentifier = self.programIdentifier; + other.shouldRecordSeries = self.shouldRecordSeries; + other.externalIDList = self.externalIDList; + other.data = self.data; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23231,18 +23650,52 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: programIdentifier:%@; shouldRecordSeries:%@; externalIDList:%@; data:%@; >", NSStringFromClass([self class]), _programIdentifier, _shouldRecordSeries, _externalIDList, [_data base64EncodedStringWithOptions:0]]; return descriptionString; } @end -@implementation MTRMediaPlaybackClusterPlayParams (InternalMethods) +@implementation MTRChannelClusterRecordProgramParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::Play::Type encodableStruct; + chip::app::Clusters::Channel::Commands::RecordProgram::Type encodableStruct; ListFreer listFreer; + { + encodableStruct.programIdentifier = AsCharSpan(self.programIdentifier); + } + { + encodableStruct.shouldRecordSeries = self.shouldRecordSeries.boolValue; + } + { + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (self.externalIDList.count != 0) { + auto * listHolder_0 = new ListHolder(self.externalIDList.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < self.externalIDList.count; ++i_0) { + if (![self.externalIDList[i_0] isKindOfClass:[MTRChannelClusterAdditionalInfoStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRChannelClusterAdditionalInfoStruct *) self.externalIDList[i_0]; + listHolder_0->mList[i_0].name = AsCharSpan(element_0.name); + listHolder_0->mList[i_0].value = AsCharSpan(element_0.value); + } + encodableStruct.externalIDList = ListType_0(listHolder_0->mList, self.externalIDList.count); + } else { + encodableStruct.externalIDList = ListType_0(); + } + } + } + { + encodableStruct.data = AsByteSpan(self.data); + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -23282,10 +23735,18 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaPlaybackClusterPauseParams +@implementation MTRChannelClusterCancelRecordProgramParams - (instancetype)init { if (self = [super init]) { + + _programIdentifier = @""; + + _shouldRecordSeries = @(0); + + _externalIDList = [NSArray array]; + + _data = [NSData data]; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -23294,8 +23755,12 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterPauseParams alloc] init]; + auto other = [[MTRChannelClusterCancelRecordProgramParams alloc] init]; + other.programIdentifier = self.programIdentifier; + other.shouldRecordSeries = self.shouldRecordSeries; + other.externalIDList = self.externalIDList; + other.data = self.data; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23304,18 +23769,52 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: programIdentifier:%@; shouldRecordSeries:%@; externalIDList:%@; data:%@; >", NSStringFromClass([self class]), _programIdentifier, _shouldRecordSeries, _externalIDList, [_data base64EncodedStringWithOptions:0]]; return descriptionString; } @end -@implementation MTRMediaPlaybackClusterPauseParams (InternalMethods) +@implementation MTRChannelClusterCancelRecordProgramParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::Pause::Type encodableStruct; + chip::app::Clusters::Channel::Commands::CancelRecordProgram::Type encodableStruct; ListFreer listFreer; + { + encodableStruct.programIdentifier = AsCharSpan(self.programIdentifier); + } + { + encodableStruct.shouldRecordSeries = self.shouldRecordSeries.boolValue; + } + { + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (self.externalIDList.count != 0) { + auto * listHolder_0 = new ListHolder(self.externalIDList.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < self.externalIDList.count; ++i_0) { + if (![self.externalIDList[i_0] isKindOfClass:[MTRChannelClusterAdditionalInfoStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRChannelClusterAdditionalInfoStruct *) self.externalIDList[i_0]; + listHolder_0->mList[i_0].name = AsCharSpan(element_0.name); + listHolder_0->mList[i_0].value = AsCharSpan(element_0.value); + } + encodableStruct.externalIDList = ListType_0(listHolder_0->mList, self.externalIDList.count); + } else { + encodableStruct.externalIDList = ListType_0(); + } + } + } + { + encodableStruct.data = AsByteSpan(self.data); + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -23355,10 +23854,14 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaPlaybackClusterStopParams +@implementation MTRTargetNavigatorClusterNavigateTargetParams - (instancetype)init { if (self = [super init]) { + + _target = @(0); + + _data = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -23367,8 +23870,10 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterStopParams alloc] init]; + auto other = [[MTRTargetNavigatorClusterNavigateTargetParams alloc] init]; + other.target = self.target; + other.data = self.data; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23377,18 +23882,27 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: target:%@; data:%@; >", NSStringFromClass([self class]), _target, _data]; return descriptionString; } @end -@implementation MTRMediaPlaybackClusterStopParams (InternalMethods) +@implementation MTRTargetNavigatorClusterNavigateTargetParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::Stop::Type encodableStruct; + chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type encodableStruct; ListFreer listFreer; + { + encodableStruct.target = self.target.unsignedCharValue; + } + { + if (self.data != nil) { + auto & definedValue_0 = encodableStruct.data.Emplace(); + definedValue_0 = AsCharSpan(self.data); + } + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -23428,12 +23942,102 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaPlaybackClusterStopPlaybackParams +@implementation MTRTargetNavigatorClusterNavigateTargetResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + _timedInvokeTimeoutMs = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRTargetNavigatorClusterNavigateTargetResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} -@dynamic timedInvokeTimeoutMs; -@dynamic serverSideProcessingTimeout; @end -@implementation MTRMediaPlaybackClusterStartOverParams + +@implementation MTRTargetNavigatorClusterNavigateTargetResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.data.HasValue()) { + self.data = AsString(decodableStruct.data.Value()); + if (self.data == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRMediaPlaybackClusterPlayParams - (instancetype)init { if (self = [super init]) { @@ -23445,7 +24049,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterStartOverParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterPlayParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23461,11 +24065,11 @@ - (NSString *)description @end -@implementation MTRMediaPlaybackClusterStartOverParams (InternalMethods) +@implementation MTRMediaPlaybackClusterPlayParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::StartOver::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::Play::Type encodableStruct; ListFreer listFreer; auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23506,7 +24110,7 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaPlaybackClusterPreviousParams +@implementation MTRMediaPlaybackClusterPauseParams - (instancetype)init { if (self = [super init]) { @@ -23518,7 +24122,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterPreviousParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterPauseParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23534,11 +24138,11 @@ - (NSString *)description @end -@implementation MTRMediaPlaybackClusterPreviousParams (InternalMethods) +@implementation MTRMediaPlaybackClusterPauseParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::Previous::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::Pause::Type encodableStruct; ListFreer listFreer; auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23579,7 +24183,7 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaPlaybackClusterNextParams +@implementation MTRMediaPlaybackClusterStopParams - (instancetype)init { if (self = [super init]) { @@ -23591,7 +24195,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterNextParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterStopParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23607,11 +24211,11 @@ - (NSString *)description @end -@implementation MTRMediaPlaybackClusterNextParams (InternalMethods) +@implementation MTRMediaPlaybackClusterStopParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::Next::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::Stop::Type encodableStruct; ListFreer listFreer; auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23652,7 +24256,12 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaPlaybackClusterRewindParams +@implementation MTRMediaPlaybackClusterStopPlaybackParams + +@dynamic timedInvokeTimeoutMs; +@dynamic serverSideProcessingTimeout; +@end +@implementation MTRMediaPlaybackClusterStartOverParams - (instancetype)init { if (self = [super init]) { @@ -23664,7 +24273,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterRewindParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterStartOverParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23680,11 +24289,11 @@ - (NSString *)description @end -@implementation MTRMediaPlaybackClusterRewindParams (InternalMethods) +@implementation MTRMediaPlaybackClusterStartOverParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::Rewind::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::StartOver::Type encodableStruct; ListFreer listFreer; auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23725,7 +24334,7 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaPlaybackClusterFastForwardParams +@implementation MTRMediaPlaybackClusterPreviousParams - (instancetype)init { if (self = [super init]) { @@ -23737,7 +24346,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterFastForwardParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterPreviousParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23753,11 +24362,11 @@ - (NSString *)description @end -@implementation MTRMediaPlaybackClusterFastForwardParams (InternalMethods) +@implementation MTRMediaPlaybackClusterPreviousParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::FastForward::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::Previous::Type encodableStruct; ListFreer listFreer; auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23798,12 +24407,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaPlaybackClusterSkipForwardParams +@implementation MTRMediaPlaybackClusterNextParams - (instancetype)init { if (self = [super init]) { - - _deltaPositionMilliseconds = @(0); _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -23812,9 +24419,8 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterSkipForwardParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterNextParams alloc] init]; - other.deltaPositionMilliseconds = self.deltaPositionMilliseconds; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23823,21 +24429,18 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: deltaPositionMilliseconds:%@; >", NSStringFromClass([self class]), _deltaPositionMilliseconds]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; return descriptionString; } @end -@implementation MTRMediaPlaybackClusterSkipForwardParams (InternalMethods) +@implementation MTRMediaPlaybackClusterNextParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::SkipForward::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::Next::Type encodableStruct; ListFreer listFreer; - { - encodableStruct.deltaPositionMilliseconds = self.deltaPositionMilliseconds.unsignedLongLongValue; - } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -23877,12 +24480,12 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaPlaybackClusterSkipBackwardParams +@implementation MTRMediaPlaybackClusterRewindParams - (instancetype)init { if (self = [super init]) { - _deltaPositionMilliseconds = @(0); + _audioAdvanceUnmuted = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -23891,9 +24494,9 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterSkipBackwardParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterRewindParams alloc] init]; - other.deltaPositionMilliseconds = self.deltaPositionMilliseconds; + other.audioAdvanceUnmuted = self.audioAdvanceUnmuted; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -23902,20 +24505,23 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: deltaPositionMilliseconds:%@; >", NSStringFromClass([self class]), _deltaPositionMilliseconds]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioAdvanceUnmuted:%@; >", NSStringFromClass([self class]), _audioAdvanceUnmuted]; return descriptionString; } @end -@implementation MTRMediaPlaybackClusterSkipBackwardParams (InternalMethods) +@implementation MTRMediaPlaybackClusterRewindParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::Rewind::Type encodableStruct; ListFreer listFreer; { - encodableStruct.deltaPositionMilliseconds = self.deltaPositionMilliseconds.unsignedLongLongValue; + if (self.audioAdvanceUnmuted != nil) { + auto & definedValue_0 = encodableStruct.audioAdvanceUnmuted.Emplace(); + definedValue_0 = self.audioAdvanceUnmuted.boolValue; + } } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23956,107 +24562,94 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaPlaybackClusterPlaybackResponseParams +@implementation MTRMediaPlaybackClusterFastForwardParams - (instancetype)init { if (self = [super init]) { - _status = @(0); - - _data = nil; + _audioAdvanceUnmuted = nil; _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterPlaybackResponseParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterFastForwardParams alloc] init]; - other.status = self.status; - other.data = self.data; + other.audioAdvanceUnmuted = self.audioAdvanceUnmuted; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioAdvanceUnmuted:%@; >", NSStringFromClass([self class]), _audioAdvanceUnmuted]; return descriptionString; } -- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue - error:(NSError * __autoreleasing *)error +@end + +@implementation MTRMediaPlaybackClusterFastForwardParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - if (!(self = [super init])) { - return nil; + chip::app::Clusters::MediaPlayback::Commands::FastForward::Type encodableStruct; + ListFreer listFreer; + { + if (self.audioAdvanceUnmuted != nil) { + auto & definedValue_0 = encodableStruct.audioAdvanceUnmuted.Emplace(); + definedValue_0 = self.audioAdvanceUnmuted.boolValue; + } } - using DecodableType = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; - chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue - clusterID:DecodableType::GetClusterId() - commandID:DecodableType::GetCommandId() - error:error]; + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { - return nil; + return CHIP_ERROR_NO_MEMORY; } - chip::TLV::TLVReader reader; - reader.Init(buffer->Start(), buffer->DataLength()); - - CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); - if (err == CHIP_NO_ERROR) { - DecodableType decodedStruct; - err = chip::app::DataModel::Decode(reader, decodedStruct); - if (err == CHIP_NO_ERROR) { - err = [self _setFieldsFromDecodableStruct:decodedStruct]; - if (err == CHIP_NO_ERROR) { - return self; - } - } - } + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); - NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; - MTR_LOG_ERROR("%s", errorStr.UTF8String); - if (error != nil) { - NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; - *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; - } - return nil; -} + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); -@end + ReturnErrorOnFailure(writer.Finalize(&buffer)); -@implementation MTRMediaPlaybackClusterPlaybackResponseParams (InternalMethods) + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} -- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType &)decodableStruct +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error { - { - self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; } - { - if (decodableStruct.data.HasValue()) { - self.data = AsString(decodableStruct.data.Value()); - if (self.data == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - return err; - } - } else { - self.data = nil; + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; } } - return CHIP_NO_ERROR; + return decodedObj; } - @end -@implementation MTRMediaPlaybackClusterSeekParams +@implementation MTRMediaPlaybackClusterSkipForwardParams - (instancetype)init { if (self = [super init]) { - _position = @(0); + _deltaPositionMilliseconds = @(0); _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -24065,9 +24658,9 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaPlaybackClusterSeekParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterSkipForwardParams alloc] init]; - other.position = self.position; + other.deltaPositionMilliseconds = self.deltaPositionMilliseconds; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -24076,20 +24669,20 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: position:%@; >", NSStringFromClass([self class]), _position]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: deltaPositionMilliseconds:%@; >", NSStringFromClass([self class]), _deltaPositionMilliseconds]; return descriptionString; } @end -@implementation MTRMediaPlaybackClusterSeekParams (InternalMethods) +@implementation MTRMediaPlaybackClusterSkipForwardParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaPlayback::Commands::Seek::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::SkipForward::Type encodableStruct; ListFreer listFreer; { - encodableStruct.position = self.position.unsignedLongLongValue; + encodableStruct.deltaPositionMilliseconds = self.deltaPositionMilliseconds.unsignedLongLongValue; } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24130,12 +24723,12 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaInputClusterSelectInputParams +@implementation MTRMediaPlaybackClusterSkipBackwardParams - (instancetype)init { if (self = [super init]) { - _index = @(0); + _deltaPositionMilliseconds = @(0); _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -24144,9 +24737,9 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaInputClusterSelectInputParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterSkipBackwardParams alloc] init]; - other.index = self.index; + other.deltaPositionMilliseconds = self.deltaPositionMilliseconds; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -24155,20 +24748,20 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: index:%@; >", NSStringFromClass([self class]), _index]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: deltaPositionMilliseconds:%@; >", NSStringFromClass([self class]), _deltaPositionMilliseconds]; return descriptionString; } @end -@implementation MTRMediaInputClusterSelectInputParams (InternalMethods) +@implementation MTRMediaPlaybackClusterSkipBackwardParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaInput::Commands::SelectInput::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Type encodableStruct; ListFreer listFreer; { - encodableStruct.index = self.index.unsignedCharValue; + encodableStruct.deltaPositionMilliseconds = self.deltaPositionMilliseconds.unsignedLongLongValue; } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24209,83 +24802,107 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaInputClusterShowInputStatusParams +@implementation MTRMediaPlaybackClusterPlaybackResponseParams - (instancetype)init { if (self = [super init]) { + + _status = @(0); + + _data = nil; _timedInvokeTimeoutMs = nil; - _serverSideProcessingTimeout = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaInputClusterShowInputStatusParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterPlaybackResponseParams alloc] init]; + other.status = self.status; + other.data = self.data; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; return descriptionString; } -@end - -@implementation MTRMediaInputClusterShowInputStatusParams (InternalMethods) - -- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error { - chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type encodableStruct; - ListFreer listFreer; + if (!(self = [super init])) { + return nil; + } - auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + using DecodableType = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; if (buffer.IsNull()) { - return CHIP_ERROR_NO_MEMORY; + return nil; } - chip::System::PacketBufferTLVWriter writer; - // Commands never need chained buffers, since they cannot be chunked. - writer.Init(std::move(buffer), /* useChainedBuffers = */ false); - - ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); - ReturnErrorOnFailure(writer.Finalize(&buffer)); + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } - reader.Init(std::move(buffer)); - return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; } -- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +@end + +@implementation MTRMediaPlaybackClusterPlaybackResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType &)decodableStruct { - chip::System::PacketBufferTLVReader reader; - CHIP_ERROR err = [self _encodeToTLVReader:reader]; - if (err != CHIP_NO_ERROR) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:err]; - } - return nil; + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; } - - auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); - if (decodedObj == nil) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + { + if (decodableStruct.data.HasValue()) { + self.data = AsString(decodableStruct.data.Value()); + if (self.data == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + self.data = nil; } } - return decodedObj; + return CHIP_NO_ERROR; } + @end -@implementation MTRMediaInputClusterHideInputStatusParams +@implementation MTRMediaPlaybackClusterSeekParams - (instancetype)init { if (self = [super init]) { + + _position = @(0); _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -24294,8 +24911,9 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaInputClusterHideInputStatusParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterSeekParams alloc] init]; + other.position = self.position; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -24304,18 +24922,21 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: position:%@; >", NSStringFromClass([self class]), _position]; return descriptionString; } @end -@implementation MTRMediaInputClusterHideInputStatusParams (InternalMethods) +@implementation MTRMediaPlaybackClusterSeekParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::Seek::Type encodableStruct; ListFreer listFreer; + { + encodableStruct.position = self.position.unsignedLongLongValue; + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -24355,14 +24976,14 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRMediaInputClusterRenameInputParams +@implementation MTRMediaPlaybackClusterActivateAudioTrackParams - (instancetype)init { if (self = [super init]) { - _index = @(0); + _trackID = @""; - _name = @""; + _audioOutputIndex = @(0); _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -24371,10 +24992,10 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRMediaInputClusterRenameInputParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterActivateAudioTrackParams alloc] init]; - other.index = self.index; - other.name = self.name; + other.trackID = self.trackID; + other.audioOutputIndex = self.audioOutputIndex; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -24383,23 +25004,23 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: index:%@; name:%@; >", NSStringFromClass([self class]), _index, _name]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: trackID:%@; audioOutputIndex:%@; >", NSStringFromClass([self class]), _trackID, _audioOutputIndex]; return descriptionString; } @end -@implementation MTRMediaInputClusterRenameInputParams (InternalMethods) +@implementation MTRMediaPlaybackClusterActivateAudioTrackParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::MediaInput::Commands::RenameInput::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Type encodableStruct; ListFreer listFreer; { - encodableStruct.index = self.index.unsignedCharValue; + encodableStruct.trackID = AsCharSpan(self.trackID); } { - encodableStruct.name = AsCharSpan(self.name); + encodableStruct.audioOutputIndex = self.audioOutputIndex.unsignedCharValue; } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24440,10 +25061,12 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRLowPowerClusterSleepParams +@implementation MTRMediaPlaybackClusterActivateTextTrackParams - (instancetype)init { if (self = [super init]) { + + _trackID = @""; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -24452,8 +25075,9 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRLowPowerClusterSleepParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterActivateTextTrackParams alloc] init]; + other.trackID = self.trackID; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -24462,18 +25086,21 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: trackID:%@; >", NSStringFromClass([self class]), _trackID]; return descriptionString; } @end -@implementation MTRLowPowerClusterSleepParams (InternalMethods) +@implementation MTRMediaPlaybackClusterActivateTextTrackParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::LowPower::Commands::Sleep::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Type encodableStruct; ListFreer listFreer; + { + encodableStruct.trackID = AsCharSpan(self.trackID); + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -24513,12 +25140,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRKeypadInputClusterSendKeyParams +@implementation MTRMediaPlaybackClusterDeactivateTextTrackParams - (instancetype)init { if (self = [super init]) { - - _keyCode = @(0); _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -24527,9 +25152,8 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + auto other = [[MTRMediaPlaybackClusterDeactivateTextTrackParams alloc] init]; - other.keyCode = self.keyCode; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -24538,21 +25162,18 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: keyCode:%@; >", NSStringFromClass([self class]), _keyCode]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; return descriptionString; } @end -@implementation MTRKeypadInputClusterSendKeyParams (InternalMethods) +@implementation MTRMediaPlaybackClusterDeactivateTextTrackParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::KeypadInput::Commands::SendKey::Type encodableStruct; + chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Type encodableStruct; ListFreer listFreer; - { - encodableStruct.keyCode = static_cast>(self.keyCode.unsignedCharValue); - } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -24592,97 +25213,162 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRKeypadInputClusterSendKeyResponseParams +@implementation MTRMediaInputClusterSelectInputParams - (instancetype)init { if (self = [super init]) { - _status = @(0); + _index = @(0); _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRKeypadInputClusterSendKeyResponseParams alloc] init]; + auto other = [[MTRMediaInputClusterSelectInputParams alloc] init]; - other.status = self.status; + other.index = self.index; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; >", NSStringFromClass([self class]), _status]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: index:%@; >", NSStringFromClass([self class]), _index]; return descriptionString; } -- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue - error:(NSError * __autoreleasing *)error +@end + +@implementation MTRMediaInputClusterSelectInputParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - if (!(self = [super init])) { - return nil; + chip::app::Clusters::MediaInput::Commands::SelectInput::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.index = self.index.unsignedCharValue; } - using DecodableType = chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType; - chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue - clusterID:DecodableType::GetClusterId() - commandID:DecodableType::GetCommandId() - error:error]; + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { - return nil; + return CHIP_ERROR_NO_MEMORY; } - chip::TLV::TLVReader reader; - reader.Init(buffer->Start(), buffer->DataLength()); + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); - CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); - if (err == CHIP_NO_ERROR) { - DecodableType decodedStruct; - err = chip::app::DataModel::Decode(reader, decodedStruct); - if (err == CHIP_NO_ERROR) { - err = [self _setFieldsFromDecodableStruct:decodedStruct]; - if (err == CHIP_NO_ERROR) { - return self; - } + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; } + return nil; } - NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; - MTR_LOG_ERROR("%s", errorStr.UTF8String); - if (error != nil) { - NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; - *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } } - return nil; + return decodedObj; +} +@end + +@implementation MTRMediaInputClusterShowInputStatusParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRMediaInputClusterShowInputStatusParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; } @end -@implementation MTRKeypadInputClusterSendKeyResponseParams (InternalMethods) +@implementation MTRMediaInputClusterShowInputStatusParams (InternalMethods) -- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType &)decodableStruct +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - { - self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; } - return CHIP_NO_ERROR; + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); } +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} @end -@implementation MTRContentLauncherClusterLaunchContentParams +@implementation MTRMediaInputClusterHideInputStatusParams - (instancetype)init { if (self = [super init]) { - - _search = [MTRContentLauncherClusterContentSearchStruct new]; - - _autoPlay = @(0); - - _data = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -24691,11 +25377,8 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + auto other = [[MTRMediaInputClusterHideInputStatusParams alloc] init]; - other.search = self.search; - other.autoPlay = self.autoPlay; - other.data = self.data; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -24704,78 +25387,18 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: search:%@; autoPlay:%@; data:%@; >", NSStringFromClass([self class]), _search, _autoPlay, _data]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; return descriptionString; } @end -@implementation MTRContentLauncherClusterLaunchContentParams (InternalMethods) +@implementation MTRMediaInputClusterHideInputStatusParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type encodableStruct; + chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type encodableStruct; ListFreer listFreer; - { - { - using ListType_1 = std::remove_reference_t; - using ListMemberType_1 = ListMemberTypeGetter::Type; - if (self.search.parameterList.count != 0) { - auto * listHolder_1 = new ListHolder(self.search.parameterList.count); - if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_1); - for (size_t i_1 = 0; i_1 < self.search.parameterList.count; ++i_1) { - if (![self.search.parameterList[i_1] isKindOfClass:[MTRContentLauncherClusterParameterStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_1 = (MTRContentLauncherClusterParameterStruct *) self.search.parameterList[i_1]; - listHolder_1->mList[i_1].type = static_castmList[i_1].type)>>(element_1.type.unsignedCharValue); - listHolder_1->mList[i_1].value = AsCharSpan(element_1.value); - if (element_1.externalIDList != nil) { - auto & definedValue_3 = listHolder_1->mList[i_1].externalIDList.Emplace(); - { - using ListType_4 = std::remove_reference_t; - using ListMemberType_4 = ListMemberTypeGetter::Type; - if (element_1.externalIDList.count != 0) { - auto * listHolder_4 = new ListHolder(element_1.externalIDList.count); - if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_4); - for (size_t i_4 = 0; i_4 < element_1.externalIDList.count; ++i_4) { - if (![element_1.externalIDList[i_4] isKindOfClass:[MTRContentLauncherClusterAdditionalInfoStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_4 = (MTRContentLauncherClusterAdditionalInfoStruct *) element_1.externalIDList[i_4]; - listHolder_4->mList[i_4].name = AsCharSpan(element_4.name); - listHolder_4->mList[i_4].value = AsCharSpan(element_4.value); - } - definedValue_3 = ListType_4(listHolder_4->mList, element_1.externalIDList.count); - } else { - definedValue_3 = ListType_4(); - } - } - } - } - encodableStruct.search.parameterList = ListType_1(listHolder_1->mList, self.search.parameterList.count); - } else { - encodableStruct.search.parameterList = ListType_1(); - } - } - } - { - encodableStruct.autoPlay = self.autoPlay.boolValue; - } - { - if (self.data != nil) { - auto & definedValue_0 = encodableStruct.data.Emplace(); - definedValue_0 = AsCharSpan(self.data); - } - } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -24815,16 +25438,14 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRContentLauncherClusterLaunchURLParams +@implementation MTRMediaInputClusterRenameInputParams - (instancetype)init { if (self = [super init]) { - _contentURL = @""; - - _displayString = nil; + _index = @(0); - _brandingInformation = nil; + _name = @""; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -24833,11 +25454,10 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRContentLauncherClusterLaunchURLParams alloc] init]; + auto other = [[MTRMediaInputClusterRenameInputParams alloc] init]; - other.contentURL = self.contentURL; - other.displayString = self.displayString; - other.brandingInformation = self.brandingInformation; + other.index = self.index; + other.name = self.name; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -24846,30 +25466,589 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: contentURL:%@; displayString:%@; brandingInformation:%@; >", NSStringFromClass([self class]), _contentURL, _displayString, _brandingInformation]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: index:%@; name:%@; >", NSStringFromClass([self class]), _index, _name]; return descriptionString; } @end -@implementation MTRContentLauncherClusterLaunchURLParams (InternalMethods) +@implementation MTRMediaInputClusterRenameInputParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type encodableStruct; + chip::app::Clusters::MediaInput::Commands::RenameInput::Type encodableStruct; ListFreer listFreer; { - encodableStruct.contentURL = AsCharSpan(self.contentURL); + encodableStruct.index = self.index.unsignedCharValue; } { - if (self.displayString != nil) { - auto & definedValue_0 = encodableStruct.displayString.Emplace(); - definedValue_0 = AsCharSpan(self.displayString); - } + encodableStruct.name = AsCharSpan(self.name); } - { - if (self.brandingInformation != nil) { - auto & definedValue_0 = encodableStruct.brandingInformation.Emplace(); + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRLowPowerClusterSleepParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRLowPowerClusterSleepParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRLowPowerClusterSleepParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::LowPower::Commands::Sleep::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRKeypadInputClusterSendKeyParams +- (instancetype)init +{ + if (self = [super init]) { + + _keyCode = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + + other.keyCode = self.keyCode; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: keyCode:%@; >", NSStringFromClass([self class]), _keyCode]; + return descriptionString; +} + +@end + +@implementation MTRKeypadInputClusterSendKeyParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::KeypadInput::Commands::SendKey::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.keyCode = static_cast>(self.keyCode.unsignedCharValue); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRKeypadInputClusterSendKeyResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + _timedInvokeTimeoutMs = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRKeypadInputClusterSendKeyResponseParams alloc] init]; + + other.status = self.status; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; >", NSStringFromClass([self class]), _status]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRKeypadInputClusterSendKeyResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRContentLauncherClusterLaunchContentParams +- (instancetype)init +{ + if (self = [super init]) { + + _search = [MTRContentLauncherClusterContentSearchStruct new]; + + _autoPlay = @(0); + + _data = nil; + + _playbackPreferences = nil; + + _useCurrentContext = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + + other.search = self.search; + other.autoPlay = self.autoPlay; + other.data = self.data; + other.playbackPreferences = self.playbackPreferences; + other.useCurrentContext = self.useCurrentContext; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: search:%@; autoPlay:%@; data:%@; playbackPreferences:%@; useCurrentContext:%@; >", NSStringFromClass([self class]), _search, _autoPlay, _data, _playbackPreferences, _useCurrentContext]; + return descriptionString; +} + +@end + +@implementation MTRContentLauncherClusterLaunchContentParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type encodableStruct; + ListFreer listFreer; + { + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.search.parameterList.count != 0) { + auto * listHolder_1 = new ListHolder(self.search.parameterList.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.search.parameterList.count; ++i_1) { + if (![self.search.parameterList[i_1] isKindOfClass:[MTRContentLauncherClusterParameterStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRContentLauncherClusterParameterStruct *) self.search.parameterList[i_1]; + listHolder_1->mList[i_1].type = static_castmList[i_1].type)>>(element_1.type.unsignedCharValue); + listHolder_1->mList[i_1].value = AsCharSpan(element_1.value); + if (element_1.externalIDList != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].externalIDList.Emplace(); + { + using ListType_4 = std::remove_reference_t; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (element_1.externalIDList.count != 0) { + auto * listHolder_4 = new ListHolder(element_1.externalIDList.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < element_1.externalIDList.count; ++i_4) { + if (![element_1.externalIDList[i_4] isKindOfClass:[MTRContentLauncherClusterAdditionalInfoStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_4 = (MTRContentLauncherClusterAdditionalInfoStruct *) element_1.externalIDList[i_4]; + listHolder_4->mList[i_4].name = AsCharSpan(element_4.name); + listHolder_4->mList[i_4].value = AsCharSpan(element_4.value); + } + definedValue_3 = ListType_4(listHolder_4->mList, element_1.externalIDList.count); + } else { + definedValue_3 = ListType_4(); + } + } + } + } + encodableStruct.search.parameterList = ListType_1(listHolder_1->mList, self.search.parameterList.count); + } else { + encodableStruct.search.parameterList = ListType_1(); + } + } + } + { + encodableStruct.autoPlay = self.autoPlay.boolValue; + } + { + if (self.data != nil) { + auto & definedValue_0 = encodableStruct.data.Emplace(); + definedValue_0 = AsCharSpan(self.data); + } + } + { + if (self.playbackPreferences != nil) { + auto & definedValue_0 = encodableStruct.playbackPreferences.Emplace(); + definedValue_0.playbackPosition = self.playbackPreferences.playbackPosition.unsignedLongLongValue; + definedValue_0.textTrack.languageCode = AsCharSpan(self.playbackPreferences.textTrack.languageCode); + if (self.playbackPreferences.textTrack.characteristics != nil) { + auto & definedValue_3 = definedValue_0.textTrack.characteristics.Emplace(); + { + using ListType_4 = std::remove_reference_t; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (self.playbackPreferences.textTrack.characteristics.count != 0) { + auto * listHolder_4 = new ListHolder(self.playbackPreferences.textTrack.characteristics.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < self.playbackPreferences.textTrack.characteristics.count; ++i_4) { + if (![self.playbackPreferences.textTrack.characteristics[i_4] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_4 = (NSNumber *) self.playbackPreferences.textTrack.characteristics[i_4]; + listHolder_4->mList[i_4] = static_castmList[i_4])>>(element_4.unsignedCharValue); + } + definedValue_3 = ListType_4(listHolder_4->mList, self.playbackPreferences.textTrack.characteristics.count); + } else { + definedValue_3 = ListType_4(); + } + } + } + definedValue_0.textTrack.audioOutputIndex = self.playbackPreferences.textTrack.audioOutputIndex.unsignedCharValue; + if (self.playbackPreferences.audioTracks != nil) { + auto & definedValue_2 = definedValue_0.audioTracks.Emplace(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (self.playbackPreferences.audioTracks.count != 0) { + auto * listHolder_3 = new ListHolder(self.playbackPreferences.audioTracks.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < self.playbackPreferences.audioTracks.count; ++i_3) { + if (![self.playbackPreferences.audioTracks[i_3] isKindOfClass:[MTRContentLauncherClusterTrackPreferenceStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (MTRContentLauncherClusterTrackPreferenceStruct *) self.playbackPreferences.audioTracks[i_3]; + listHolder_3->mList[i_3].languageCode = AsCharSpan(element_3.languageCode); + if (element_3.characteristics != nil) { + auto & definedValue_5 = listHolder_3->mList[i_3].characteristics.Emplace(); + { + using ListType_6 = std::remove_reference_t; + using ListMemberType_6 = ListMemberTypeGetter::Type; + if (element_3.characteristics.count != 0) { + auto * listHolder_6 = new ListHolder(element_3.characteristics.count); + if (listHolder_6 == nullptr || listHolder_6->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_6); + for (size_t i_6 = 0; i_6 < element_3.characteristics.count; ++i_6) { + if (![element_3.characteristics[i_6] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_6 = (NSNumber *) element_3.characteristics[i_6]; + listHolder_6->mList[i_6] = static_castmList[i_6])>>(element_6.unsignedCharValue); + } + definedValue_5 = ListType_6(listHolder_6->mList, element_3.characteristics.count); + } else { + definedValue_5 = ListType_6(); + } + } + } + listHolder_3->mList[i_3].audioOutputIndex = element_3.audioOutputIndex.unsignedCharValue; + } + definedValue_2 = ListType_3(listHolder_3->mList, self.playbackPreferences.audioTracks.count); + } else { + definedValue_2 = ListType_3(); + } + } + } + } + } + { + if (self.useCurrentContext != nil) { + auto & definedValue_0 = encodableStruct.useCurrentContext.Emplace(); + definedValue_0 = self.useCurrentContext.boolValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRContentLauncherClusterLaunchURLParams +- (instancetype)init +{ + if (self = [super init]) { + + _contentURL = @""; + + _displayString = nil; + + _brandingInformation = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRContentLauncherClusterLaunchURLParams alloc] init]; + + other.contentURL = self.contentURL; + other.displayString = self.displayString; + other.brandingInformation = self.brandingInformation; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: contentURL:%@; displayString:%@; brandingInformation:%@; >", NSStringFromClass([self class]), _contentURL, _displayString, _brandingInformation]; + return descriptionString; +} + +@end + +@implementation MTRContentLauncherClusterLaunchURLParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.contentURL = AsCharSpan(self.contentURL); + } + { + if (self.displayString != nil) { + auto & definedValue_0 = encodableStruct.displayString.Emplace(); + definedValue_0 = AsCharSpan(self.displayString); + } + } + { + if (self.brandingInformation != nil) { + auto & definedValue_0 = encodableStruct.brandingInformation.Emplace(); definedValue_0.providerName = AsCharSpan(self.brandingInformation.providerName); if (self.brandingInformation.background != nil) { auto & definedValue_2 = definedValue_0.background.Emplace(); @@ -24905,60 +26084,1175 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader definedValue_4.metric = static_cast>(self.brandingInformation.logo.size.metric.unsignedCharValue); } } - if (self.brandingInformation.progressBar != nil) { - auto & definedValue_2 = definedValue_0.progressBar.Emplace(); - if (self.brandingInformation.progressBar.imageURL != nil) { - auto & definedValue_4 = definedValue_2.imageURL.Emplace(); - definedValue_4 = AsCharSpan(self.brandingInformation.progressBar.imageURL); - } - if (self.brandingInformation.progressBar.color != nil) { - auto & definedValue_4 = definedValue_2.color.Emplace(); - definedValue_4 = AsCharSpan(self.brandingInformation.progressBar.color); - } - if (self.brandingInformation.progressBar.size != nil) { - auto & definedValue_4 = definedValue_2.size.Emplace(); - definedValue_4.width = self.brandingInformation.progressBar.size.width.doubleValue; - definedValue_4.height = self.brandingInformation.progressBar.size.height.doubleValue; - definedValue_4.metric = static_cast>(self.brandingInformation.progressBar.size.metric.unsignedCharValue); - } + if (self.brandingInformation.progressBar != nil) { + auto & definedValue_2 = definedValue_0.progressBar.Emplace(); + if (self.brandingInformation.progressBar.imageURL != nil) { + auto & definedValue_4 = definedValue_2.imageURL.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.progressBar.imageURL); + } + if (self.brandingInformation.progressBar.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.progressBar.color); + } + if (self.brandingInformation.progressBar.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = self.brandingInformation.progressBar.size.width.doubleValue; + definedValue_4.height = self.brandingInformation.progressBar.size.height.doubleValue; + definedValue_4.metric = static_cast>(self.brandingInformation.progressBar.size.metric.unsignedCharValue); + } + } + if (self.brandingInformation.splash != nil) { + auto & definedValue_2 = definedValue_0.splash.Emplace(); + if (self.brandingInformation.splash.imageURL != nil) { + auto & definedValue_4 = definedValue_2.imageURL.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.splash.imageURL); + } + if (self.brandingInformation.splash.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.splash.color); + } + if (self.brandingInformation.splash.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = self.brandingInformation.splash.size.width.doubleValue; + definedValue_4.height = self.brandingInformation.splash.size.height.doubleValue; + definedValue_4.metric = static_cast>(self.brandingInformation.splash.size.metric.unsignedCharValue); + } + } + if (self.brandingInformation.waterMark != nil) { + auto & definedValue_2 = definedValue_0.waterMark.Emplace(); + if (self.brandingInformation.waterMark.imageURL != nil) { + auto & definedValue_4 = definedValue_2.imageURL.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.waterMark.imageURL); + } + if (self.brandingInformation.waterMark.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.waterMark.color); + } + if (self.brandingInformation.waterMark.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = self.brandingInformation.waterMark.size.width.doubleValue; + definedValue_4.height = self.brandingInformation.waterMark.size.height.doubleValue; + definedValue_4.metric = static_cast>(self.brandingInformation.waterMark.size.metric.unsignedCharValue); + } + } + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRContentLauncherClusterLauncherResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + _timedInvokeTimeoutMs = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRContentLauncherClusterLauncherResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRContentLauncherClusterLauncherResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.data.HasValue()) { + self.data = AsString(decodableStruct.data.Value()); + if (self.data == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; } - if (self.brandingInformation.splash != nil) { - auto & definedValue_2 = definedValue_0.splash.Emplace(); - if (self.brandingInformation.splash.imageURL != nil) { - auto & definedValue_4 = definedValue_2.imageURL.Emplace(); - definedValue_4 = AsCharSpan(self.brandingInformation.splash.imageURL); - } - if (self.brandingInformation.splash.color != nil) { - auto & definedValue_4 = definedValue_2.color.Emplace(); - definedValue_4 = AsCharSpan(self.brandingInformation.splash.color); - } - if (self.brandingInformation.splash.size != nil) { - auto & definedValue_4 = definedValue_2.size.Emplace(); - definedValue_4.width = self.brandingInformation.splash.size.width.doubleValue; - definedValue_4.height = self.brandingInformation.splash.size.height.doubleValue; - definedValue_4.metric = static_cast>(self.brandingInformation.splash.size.metric.unsignedCharValue); - } + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRContentLauncherClusterLaunchResponseParams +@dynamic status; +@dynamic data; + +@dynamic timedInvokeTimeoutMs; +@end +@implementation MTRAudioOutputClusterSelectOutputParams +- (instancetype)init +{ + if (self = [super init]) { + + _index = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRAudioOutputClusterSelectOutputParams alloc] init]; + + other.index = self.index; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: index:%@; >", NSStringFromClass([self class]), _index]; + return descriptionString; +} + +@end + +@implementation MTRAudioOutputClusterSelectOutputParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.index = self.index.unsignedCharValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRAudioOutputClusterRenameOutputParams +- (instancetype)init +{ + if (self = [super init]) { + + _index = @(0); + + _name = @""; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRAudioOutputClusterRenameOutputParams alloc] init]; + + other.index = self.index; + other.name = self.name; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: index:%@; name:%@; >", NSStringFromClass([self class]), _index, _name]; + return descriptionString; +} + +@end + +@implementation MTRAudioOutputClusterRenameOutputParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.index = self.index.unsignedCharValue; + } + { + encodableStruct.name = AsCharSpan(self.name); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRApplicationLauncherClusterLaunchAppParams +- (instancetype)init +{ + if (self = [super init]) { + + _application = nil; + + _data = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRApplicationLauncherClusterLaunchAppParams alloc] init]; + + other.application = self.application; + other.data = self.data; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; data:%@; >", NSStringFromClass([self class]), _application, [_data base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +@end + +@implementation MTRApplicationLauncherClusterLaunchAppParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type encodableStruct; + ListFreer listFreer; + { + if (self.application != nil) { + auto & definedValue_0 = encodableStruct.application.Emplace(); + definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = AsCharSpan(self.application.applicationID); + } + } + { + if (self.data != nil) { + auto & definedValue_0 = encodableStruct.data.Emplace(); + definedValue_0 = AsByteSpan(self.data); + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRApplicationLauncherClusterStopAppParams +- (instancetype)init +{ + if (self = [super init]) { + + _application = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRApplicationLauncherClusterStopAppParams alloc] init]; + + other.application = self.application; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; >", NSStringFromClass([self class]), _application]; + return descriptionString; +} + +@end + +@implementation MTRApplicationLauncherClusterStopAppParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type encodableStruct; + ListFreer listFreer; + { + if (self.application != nil) { + auto & definedValue_0 = encodableStruct.application.Emplace(); + definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = AsCharSpan(self.application.applicationID); + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRApplicationLauncherClusterHideAppParams +- (instancetype)init +{ + if (self = [super init]) { + + _application = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRApplicationLauncherClusterHideAppParams alloc] init]; + + other.application = self.application; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; >", NSStringFromClass([self class]), _application]; + return descriptionString; +} + +@end + +@implementation MTRApplicationLauncherClusterHideAppParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type encodableStruct; + ListFreer listFreer; + { + if (self.application != nil) { + auto & definedValue_0 = encodableStruct.application.Emplace(); + definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = AsCharSpan(self.application.applicationID); + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRApplicationLauncherClusterLauncherResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + _timedInvokeTimeoutMs = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRApplicationLauncherClusterLauncherResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, [_data base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; } - if (self.brandingInformation.waterMark != nil) { - auto & definedValue_2 = definedValue_0.waterMark.Emplace(); - if (self.brandingInformation.waterMark.imageURL != nil) { - auto & definedValue_4 = definedValue_2.imageURL.Emplace(); - definedValue_4 = AsCharSpan(self.brandingInformation.waterMark.imageURL); - } - if (self.brandingInformation.waterMark.color != nil) { - auto & definedValue_4 = definedValue_2.color.Emplace(); - definedValue_4 = AsCharSpan(self.brandingInformation.waterMark.color); - } - if (self.brandingInformation.waterMark.size != nil) { - auto & definedValue_4 = definedValue_2.size.Emplace(); - definedValue_4.width = self.brandingInformation.waterMark.size.width.doubleValue; - definedValue_4.height = self.brandingInformation.waterMark.size.height.doubleValue; - definedValue_4.metric = static_cast>(self.brandingInformation.waterMark.size.metric.unsignedCharValue); - } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRApplicationLauncherClusterLauncherResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.data.HasValue()) { + self.data = AsData(decodableStruct.data.Value()); + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRAccountLoginClusterGetSetupPINParams +- (instancetype)init +{ + if (self = [super init]) { + + _tempAccountIdentifier = @""; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRAccountLoginClusterGetSetupPINParams alloc] init]; + + other.tempAccountIdentifier = self.tempAccountIdentifier; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: tempAccountIdentifier:%@; >", NSStringFromClass([self class]), _tempAccountIdentifier]; + return descriptionString; +} + +@end + +@implementation MTRAccountLoginClusterGetSetupPINParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.tempAccountIdentifier = AsCharSpan(self.tempAccountIdentifier); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRAccountLoginClusterGetSetupPINResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _setupPIN = @""; + _timedInvokeTimeoutMs = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRAccountLoginClusterGetSetupPINResponseParams alloc] init]; + + other.setupPIN = self.setupPIN; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: setupPIN:%@; >", NSStringFromClass([self class]), _setupPIN]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; } } } + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRAccountLoginClusterGetSetupPINResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType &)decodableStruct +{ + { + self.setupPIN = AsString(decodableStruct.setupPIN); + if (self.setupPIN == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRAccountLoginClusterLoginParams +- (instancetype)init +{ + if (self = [super init]) { + + _tempAccountIdentifier = @""; + + _setupPIN = @""; + + _node = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRAccountLoginClusterLoginParams alloc] init]; + + other.tempAccountIdentifier = self.tempAccountIdentifier; + other.setupPIN = self.setupPIN; + other.node = self.node; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: tempAccountIdentifier:%@; setupPIN:%@; node:%@; >", NSStringFromClass([self class]), _tempAccountIdentifier, _setupPIN, _node]; + return descriptionString; +} + +@end + +@implementation MTRAccountLoginClusterLoginParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::AccountLogin::Commands::Login::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.tempAccountIdentifier = AsCharSpan(self.tempAccountIdentifier); + } + { + encodableStruct.setupPIN = AsCharSpan(self.setupPIN); + } + { + if (self.node != nil) { + auto & definedValue_0 = encodableStruct.node.Emplace(); + definedValue_0 = self.node.unsignedLongLongValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRAccountLoginClusterLogoutParams +- (instancetype)init +{ + if (self = [super init]) { + + _node = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRAccountLoginClusterLogoutParams alloc] init]; + + other.node = self.node; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: node:%@; >", NSStringFromClass([self class]), _node]; + return descriptionString; +} + +@end + +@implementation MTRAccountLoginClusterLogoutParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::AccountLogin::Commands::Logout::Type encodableStruct; + ListFreer listFreer; + { + if (self.node != nil) { + auto & definedValue_0 = encodableStruct.node.Emplace(); + definedValue_0 = self.node.unsignedLongLongValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRContentControlClusterUpdatePINParams +- (instancetype)init +{ + if (self = [super init]) { + + _oldPIN = nil; + + _newPIN = @""; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRContentControlClusterUpdatePINParams alloc] init]; + + other.oldPIN = self.oldPIN; + other.newPIN = self.newPIN; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: oldPIN:%@; newPIN:%@; >", NSStringFromClass([self class]), _oldPIN, _newPIN]; + return descriptionString; +} + +@end + +@implementation MTRContentControlClusterUpdatePINParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ContentControl::Commands::UpdatePIN::Type encodableStruct; + ListFreer listFreer; + { + if (self.oldPIN != nil) { + auto & definedValue_0 = encodableStruct.oldPIN.Emplace(); + definedValue_0 = AsCharSpan(self.oldPIN); + } + } + { + encodableStruct.newPIN = AsCharSpan(self.newPIN); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRContentControlClusterResetPINParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRContentControlClusterResetPINParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRContentControlClusterResetPINParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ContentControl::Commands::ResetPIN::Type encodableStruct; + ListFreer listFreer; + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { return CHIP_ERROR_NO_MEMORY; @@ -24997,33 +27291,28 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRContentLauncherClusterLauncherResponseParams +@implementation MTRContentControlClusterResetPINResponseParams - (instancetype)init { if (self = [super init]) { - _status = @(0); - - _data = nil; - _timedInvokeTimeoutMs = nil; + _pinCode = @""; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRContentLauncherClusterLauncherResponseParams alloc] init]; + auto other = [[MTRContentControlClusterResetPINResponseParams alloc] init]; - other.status = self.status; - other.data = self.data; - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.pinCode = self.pinCode; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: pinCode:%@; >", NSStringFromClass([self class]), _pinCode]; return descriptionString; } @@ -25034,7 +27323,7 @@ - (nullable instancetype)initWithResponseValue:(NSDictionary *)r return nil; } - using DecodableType = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType; + using DecodableType = chip::app::Clusters::ContentControl::Commands::ResetPINResponse::DecodableType; chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue clusterID:DecodableType::GetClusterId() commandID:DecodableType::GetCommandId() @@ -25069,22 +27358,15 @@ - (nullable instancetype)initWithResponseValue:(NSDictionary *)r @end -@implementation MTRContentLauncherClusterLauncherResponseParams (InternalMethods) +@implementation MTRContentControlClusterResetPINResponseParams (InternalMethods) -- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType &)decodableStruct +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentControl::Commands::ResetPINResponse::DecodableType &)decodableStruct { { - self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; - } - { - if (decodableStruct.data.HasValue()) { - self.data = AsString(decodableStruct.data.Value()); - if (self.data == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - return err; - } - } else { - self.data = nil; + self.pinCode = AsString(decodableStruct.PINCode); + if (self.pinCode == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; } } return CHIP_NO_ERROR; @@ -25092,18 +27374,10 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentL @end -@implementation MTRContentLauncherClusterLaunchResponseParams -@dynamic status; -@dynamic data; - -@dynamic timedInvokeTimeoutMs; -@end -@implementation MTRAudioOutputClusterSelectOutputParams +@implementation MTRContentControlClusterEnableParams - (instancetype)init { if (self = [super init]) { - - _index = @(0); _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -25112,9 +27386,8 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRAudioOutputClusterSelectOutputParams alloc] init]; + auto other = [[MTRContentControlClusterEnableParams alloc] init]; - other.index = self.index; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -25123,21 +27396,18 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: index:%@; >", NSStringFromClass([self class]), _index]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; return descriptionString; } @end -@implementation MTRAudioOutputClusterSelectOutputParams (InternalMethods) +@implementation MTRContentControlClusterEnableParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type encodableStruct; + chip::app::Clusters::ContentControl::Commands::Enable::Type encodableStruct; ListFreer listFreer; - { - encodableStruct.index = self.index.unsignedCharValue; - } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -25177,14 +27447,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRAudioOutputClusterRenameOutputParams +@implementation MTRContentControlClusterDisableParams - (instancetype)init { if (self = [super init]) { - - _index = @(0); - - _name = @""; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -25193,10 +27459,8 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRAudioOutputClusterRenameOutputParams alloc] init]; + auto other = [[MTRContentControlClusterDisableParams alloc] init]; - other.index = self.index; - other.name = self.name; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -25205,24 +27469,18 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: index:%@; name:%@; >", NSStringFromClass([self class]), _index, _name]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; return descriptionString; } @end -@implementation MTRAudioOutputClusterRenameOutputParams (InternalMethods) +@implementation MTRContentControlClusterDisableParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type encodableStruct; + chip::app::Clusters::ContentControl::Commands::Disable::Type encodableStruct; ListFreer listFreer; - { - encodableStruct.index = self.index.unsignedCharValue; - } - { - encodableStruct.name = AsCharSpan(self.name); - } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -25262,14 +27520,14 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRApplicationLauncherClusterLaunchAppParams +@implementation MTRContentControlClusterAddBonusTimeParams - (instancetype)init { if (self = [super init]) { - _application = nil; + _pinCode = nil; - _data = nil; + _bonusTime = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -25278,10 +27536,10 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRApplicationLauncherClusterLaunchAppParams alloc] init]; + auto other = [[MTRContentControlClusterAddBonusTimeParams alloc] init]; - other.application = self.application; - other.data = self.data; + other.pinCode = self.pinCode; + other.bonusTime = self.bonusTime; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -25290,29 +27548,28 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; data:%@; >", NSStringFromClass([self class]), _application, [_data base64EncodedStringWithOptions:0]]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: pinCode:%@; bonusTime:%@; >", NSStringFromClass([self class]), _pinCode, _bonusTime]; return descriptionString; } @end -@implementation MTRApplicationLauncherClusterLaunchAppParams (InternalMethods) +@implementation MTRContentControlClusterAddBonusTimeParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type encodableStruct; + chip::app::Clusters::ContentControl::Commands::AddBonusTime::Type encodableStruct; ListFreer listFreer; { - if (self.application != nil) { - auto & definedValue_0 = encodableStruct.application.Emplace(); - definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; - definedValue_0.applicationID = AsCharSpan(self.application.applicationID); + if (self.pinCode != nil) { + auto & definedValue_0 = encodableStruct.PINCode.Emplace(); + definedValue_0 = AsCharSpan(self.pinCode); } } { - if (self.data != nil) { - auto & definedValue_0 = encodableStruct.data.Emplace(); - definedValue_0 = AsByteSpan(self.data); + if (self.bonusTime != nil) { + auto & definedValue_0 = encodableStruct.bonusTime.Emplace(); + definedValue_0 = self.bonusTime.unsignedIntValue; } } @@ -25354,12 +27611,12 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRApplicationLauncherClusterStopAppParams +@implementation MTRContentControlClusterSetScreenDailyTimeParams - (instancetype)init { if (self = [super init]) { - _application = nil; + _screenTime = @(0); _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -25368,9 +27625,9 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRApplicationLauncherClusterStopAppParams alloc] init]; + auto other = [[MTRContentControlClusterSetScreenDailyTimeParams alloc] init]; - other.application = self.application; + other.screenTime = self.screenTime; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -25379,24 +27636,20 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; >", NSStringFromClass([self class]), _application]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: screenTime:%@; >", NSStringFromClass([self class]), _screenTime]; return descriptionString; } @end -@implementation MTRApplicationLauncherClusterStopAppParams (InternalMethods) +@implementation MTRContentControlClusterSetScreenDailyTimeParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type encodableStruct; + chip::app::Clusters::ContentControl::Commands::SetScreenDailyTime::Type encodableStruct; ListFreer listFreer; { - if (self.application != nil) { - auto & definedValue_0 = encodableStruct.application.Emplace(); - definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; - definedValue_0.applicationID = AsCharSpan(self.application.applicationID); - } + encodableStruct.screenTime = self.screenTime.unsignedIntValue; } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -25437,12 +27690,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRApplicationLauncherClusterHideAppParams +@implementation MTRContentControlClusterBlockUnratedContentParams - (instancetype)init { if (self = [super init]) { - - _application = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -25451,9 +27702,8 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRApplicationLauncherClusterHideAppParams alloc] init]; + auto other = [[MTRContentControlClusterBlockUnratedContentParams alloc] init]; - other.application = self.application; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -25462,161 +27712,61 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; >", NSStringFromClass([self class]), _application]; - return descriptionString; -} - -@end - -@implementation MTRApplicationLauncherClusterHideAppParams (InternalMethods) - -- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader -{ - chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type encodableStruct; - ListFreer listFreer; - { - if (self.application != nil) { - auto & definedValue_0 = encodableStruct.application.Emplace(); - definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; - definedValue_0.applicationID = AsCharSpan(self.application.applicationID); - } - } - - auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); - if (buffer.IsNull()) { - return CHIP_ERROR_NO_MEMORY; - } - - chip::System::PacketBufferTLVWriter writer; - // Commands never need chained buffers, since they cannot be chunked. - writer.Init(std::move(buffer), /* useChainedBuffers = */ false); - - ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); - - ReturnErrorOnFailure(writer.Finalize(&buffer)); - - reader.Init(std::move(buffer)); - return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); -} - -- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error -{ - chip::System::PacketBufferTLVReader reader; - CHIP_ERROR err = [self _encodeToTLVReader:reader]; - if (err != CHIP_NO_ERROR) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:err]; - } - return nil; - } - - auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); - if (decodedObj == nil) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; - } - } - return decodedObj; -} -@end - -@implementation MTRApplicationLauncherClusterLauncherResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _status = @(0); - - _data = nil; - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRApplicationLauncherClusterLauncherResponseParams alloc] init]; - - other.status = self.status; - other.data = self.data; - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, [_data base64EncodedStringWithOptions:0]]; - return descriptionString; -} - -- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue - error:(NSError * __autoreleasing *)error -{ - if (!(self = [super init])) { - return nil; - } - - using DecodableType = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType; - chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue - clusterID:DecodableType::GetClusterId() - commandID:DecodableType::GetCommandId() - error:error]; - if (buffer.IsNull()) { - return nil; - } - - chip::TLV::TLVReader reader; - reader.Init(buffer->Start(), buffer->DataLength()); - - CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); - if (err == CHIP_NO_ERROR) { - DecodableType decodedStruct; - err = chip::app::DataModel::Decode(reader, decodedStruct); - if (err == CHIP_NO_ERROR) { - err = [self _setFieldsFromDecodableStruct:decodedStruct]; - if (err == CHIP_NO_ERROR) { - return self; - } - } - } - - NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; - MTR_LOG_ERROR("%s", errorStr.UTF8String); - if (error != nil) { - NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; - *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; - } - return nil; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; } @end -@implementation MTRApplicationLauncherClusterLauncherResponseParams (InternalMethods) +@implementation MTRContentControlClusterBlockUnratedContentParams (InternalMethods) -- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType &)decodableStruct +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - { - self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + chip::app::Clusters::ContentControl::Commands::BlockUnratedContent::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; } - { - if (decodableStruct.data.HasValue()) { - self.data = AsData(decodableStruct.data.Value()); - } else { - self.data = nil; + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; } + return nil; } - return CHIP_NO_ERROR; -} + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} @end -@implementation MTRAccountLoginClusterGetSetupPINParams +@implementation MTRContentControlClusterUnblockUnratedContentParams - (instancetype)init { if (self = [super init]) { - - _tempAccountIdentifier = @""; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -25625,9 +27775,8 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRAccountLoginClusterGetSetupPINParams alloc] init]; + auto other = [[MTRContentControlClusterUnblockUnratedContentParams alloc] init]; - other.tempAccountIdentifier = self.tempAccountIdentifier; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -25636,21 +27785,18 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: tempAccountIdentifier:%@; >", NSStringFromClass([self class]), _tempAccountIdentifier]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; return descriptionString; } @end -@implementation MTRAccountLoginClusterGetSetupPINParams (InternalMethods) +@implementation MTRContentControlClusterUnblockUnratedContentParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type encodableStruct; + chip::app::Clusters::ContentControl::Commands::UnblockUnratedContent::Type encodableStruct; ListFreer listFreer; - { - encodableStruct.tempAccountIdentifier = AsCharSpan(self.tempAccountIdentifier); - } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -25690,99 +27836,91 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRAccountLoginClusterGetSetupPINResponseParams +@implementation MTRContentControlClusterSetOnDemandRatingThresholdParams - (instancetype)init { if (self = [super init]) { - _setupPIN = @""; + _rating = @""; _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRAccountLoginClusterGetSetupPINResponseParams alloc] init]; + auto other = [[MTRContentControlClusterSetOnDemandRatingThresholdParams alloc] init]; - other.setupPIN = self.setupPIN; + other.rating = self.rating; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: setupPIN:%@; >", NSStringFromClass([self class]), _setupPIN]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: rating:%@; >", NSStringFromClass([self class]), _rating]; return descriptionString; } -- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue - error:(NSError * __autoreleasing *)error +@end + +@implementation MTRContentControlClusterSetOnDemandRatingThresholdParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - if (!(self = [super init])) { - return nil; + chip::app::Clusters::ContentControl::Commands::SetOnDemandRatingThreshold::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.rating = AsCharSpan(self.rating); } - using DecodableType = chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType; - chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue - clusterID:DecodableType::GetClusterId() - commandID:DecodableType::GetCommandId() - error:error]; + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { - return nil; + return CHIP_ERROR_NO_MEMORY; } - chip::TLV::TLVReader reader; - reader.Init(buffer->Start(), buffer->DataLength()); - - CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); - if (err == CHIP_NO_ERROR) { - DecodableType decodedStruct; - err = chip::app::DataModel::Decode(reader, decodedStruct); - if (err == CHIP_NO_ERROR) { - err = [self _setFieldsFromDecodableStruct:decodedStruct]; - if (err == CHIP_NO_ERROR) { - return self; - } - } - } + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); - NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; - MTR_LOG_ERROR("%s", errorStr.UTF8String); - if (error != nil) { - NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; - *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; - } - return nil; -} + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); -@end + ReturnErrorOnFailure(writer.Finalize(&buffer)); -@implementation MTRAccountLoginClusterGetSetupPINResponseParams (InternalMethods) + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} -- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType &)decodableStruct +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error { - { - self.setupPIN = AsString(decodableStruct.setupPIN); - if (self.setupPIN == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - return err; + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; } + return nil; } - return CHIP_NO_ERROR; -} + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} @end -@implementation MTRAccountLoginClusterLoginParams +@implementation MTRContentControlClusterSetScheduledContentRatingThresholdParams - (instancetype)init { if (self = [super init]) { - _tempAccountIdentifier = @""; - - _setupPIN = @""; + _rating = @""; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -25791,10 +27929,9 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRAccountLoginClusterLoginParams alloc] init]; + auto other = [[MTRContentControlClusterSetScheduledContentRatingThresholdParams alloc] init]; - other.tempAccountIdentifier = self.tempAccountIdentifier; - other.setupPIN = self.setupPIN; + other.rating = self.rating; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -25803,23 +27940,20 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: tempAccountIdentifier:%@; setupPIN:%@; >", NSStringFromClass([self class]), _tempAccountIdentifier, _setupPIN]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: rating:%@; >", NSStringFromClass([self class]), _rating]; return descriptionString; } @end -@implementation MTRAccountLoginClusterLoginParams (InternalMethods) +@implementation MTRContentControlClusterSetScheduledContentRatingThresholdParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::AccountLogin::Commands::Login::Type encodableStruct; + chip::app::Clusters::ContentControl::Commands::SetScheduledContentRatingThreshold::Type encodableStruct; ListFreer listFreer; { - encodableStruct.tempAccountIdentifier = AsCharSpan(self.tempAccountIdentifier); - } - { - encodableStruct.setupPIN = AsCharSpan(self.setupPIN); + encodableStruct.rating = AsCharSpan(self.rating); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -25860,10 +27994,14 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRAccountLoginClusterLogoutParams +@implementation MTRContentAppObserverClusterContentAppMessageParams - (instancetype)init { if (self = [super init]) { + + _data = nil; + + _encodingHint = @""; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -25872,8 +28010,10 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRAccountLoginClusterLogoutParams alloc] init]; + auto other = [[MTRContentAppObserverClusterContentAppMessageParams alloc] init]; + other.data = self.data; + other.encodingHint = self.encodingHint; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -25882,18 +28022,27 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: data:%@; encodingHint:%@; >", NSStringFromClass([self class]), _data, _encodingHint]; return descriptionString; } @end -@implementation MTRAccountLoginClusterLogoutParams (InternalMethods) +@implementation MTRContentAppObserverClusterContentAppMessageParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::AccountLogin::Commands::Logout::Type encodableStruct; + chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Type encodableStruct; ListFreer listFreer; + { + if (self.data != nil) { + auto & definedValue_0 = encodableStruct.data.Emplace(); + definedValue_0 = AsCharSpan(self.data); + } + } + { + encodableStruct.encodingHint = AsCharSpan(self.encodingHint); + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -25933,6 +28082,109 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRContentAppObserverClusterContentAppMessageResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = nil; + + _data = @""; + + _encodingHint = @""; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRContentAppObserverClusterContentAppMessageResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + other.encodingHint = self.encodingHint; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; encodingHint:%@; >", NSStringFromClass([self class]), _status, _data, _encodingHint]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRContentAppObserverClusterContentAppMessageResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType &)decodableStruct +{ + { + if (decodableStruct.status.HasValue()) { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status.Value())]; + } else { + self.status = nil; + } + } + { + self.data = AsString(decodableStruct.data); + if (self.data == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } + { + self.encodingHint = AsString(decodableStruct.encodingHint); + if (self.encodingHint == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } + return CHIP_NO_ERROR; +} + +@end + @implementation MTRElectricalMeasurementClusterGetProfileInfoResponseCommandParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 6aa9d29601a79c..f29c330020957b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -1474,6 +1474,30 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRChannelClusterGetProgramGuideParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRChannelClusterProgramGuideResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::Channel::Commands::ProgramGuideResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRChannelClusterRecordProgramParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRChannelClusterCancelRecordProgramParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRTargetNavigatorClusterNavigateTargetParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; @@ -1558,6 +1582,24 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRMediaPlaybackClusterActivateAudioTrackParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRMediaPlaybackClusterActivateTextTrackParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRMediaPlaybackClusterDeactivateTextTrackParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRMediaInputClusterSelectInputParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; @@ -1678,6 +1720,84 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRContentControlClusterUpdatePINParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentControlClusterResetPINParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentControlClusterResetPINResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentControl::Commands::ResetPINResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRContentControlClusterEnableParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentControlClusterDisableParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentControlClusterAddBonusTimeParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentControlClusterSetScreenDailyTimeParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentControlClusterBlockUnratedContentParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentControlClusterUnblockUnratedContentParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentControlClusterSetOnDemandRatingThresholdParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentControlClusterSetScheduledContentRatingThresholdParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentAppObserverClusterContentAppMessageParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRContentAppObserverClusterContentAppMessageResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType &)decodableStruct; + +@end + @interface MTRElectricalMeasurementClusterGetProfileInfoResponseCommandParams (InternalMethods) - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType &)decodableStruct; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index 0360cbd0c7027c..96fc70ada92364 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -995,6 +995,24 @@ static BOOL CommandNeedsTimedInvokeInAccountLoginCluster(AttributeId aAttributeI } } } +static BOOL CommandNeedsTimedInvokeInContentControlCluster(AttributeId aAttributeId) +{ + using namespace Clusters::ContentControl; + switch (aAttributeId) { + default: { + return NO; + } + } +} +static BOOL CommandNeedsTimedInvokeInContentAppObserverCluster(AttributeId aAttributeId) +{ + using namespace Clusters::ContentAppObserver; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInElectricalMeasurementCluster(AttributeId aAttributeId) { using namespace Clusters::ElectricalMeasurement; @@ -1335,6 +1353,12 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::AccountLogin::Id: { return CommandNeedsTimedInvokeInAccountLoginCluster(commandID); } + case Clusters::ContentControl::Id: { + return CommandNeedsTimedInvokeInContentControlCluster(commandID); + } + case Clusters::ContentAppObserver::Id: { + return CommandNeedsTimedInvokeInContentAppObserverCluster(commandID); + } case Clusters::ElectricalMeasurement::Id: { return CommandNeedsTimedInvokeInElectricalMeasurementCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 72e87ce75bd71e..fe379f19f8eb48 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -3572,6 +3572,55 @@ static id _Nullable DecodeEventPayloadForTargetNavigatorCluster(EventId aEventId { using namespace Clusters::TargetNavigator; switch (aEventId) { + case Events::TargetUpdated::Id: { + Events::TargetUpdated::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRTargetNavigatorClusterTargetUpdatedEvent new]; + + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.targetList.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRTargetNavigatorClusterTargetInfoStruct * newElement_0; + newElement_0 = [MTRTargetNavigatorClusterTargetInfoStruct new]; + newElement_0.identifier = [NSNumber numberWithUnsignedChar:entry_0.identifier]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.targetList = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:cppValue.currentTarget]; + value.currentTarget = memberValue; + } while (0); + do { + NSData * _Nonnull memberValue; + memberValue = AsData(cppValue.data); + value.data = memberValue; + } while (0); + + return value; + } default: { break; } @@ -3584,6 +3633,73 @@ static id _Nullable DecodeEventPayloadForMediaPlaybackCluster(EventId aEventId, { using namespace Clusters::MediaPlayback; switch (aEventId) { + case Events::StateChanged::Id: { + Events::StateChanged::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRMediaPlaybackClusterStateChangedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.currentState)]; + value.currentState = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedLongLong:cppValue.startTime]; + value.startTime = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedLongLong:cppValue.duration]; + value.duration = memberValue; + } while (0); + do { + MTRMediaPlaybackClusterPlaybackPositionStruct * _Nonnull memberValue; + memberValue = [MTRMediaPlaybackClusterPlaybackPositionStruct new]; + memberValue.updatedAt = [NSNumber numberWithUnsignedLongLong:cppValue.sampledPosition.updatedAt]; + if (cppValue.sampledPosition.position.IsNull()) { + memberValue.position = nil; + } else { + memberValue.position = [NSNumber numberWithUnsignedLongLong:cppValue.sampledPosition.position.Value()]; + } + value.sampledPosition = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithFloat:cppValue.playbackSpeed]; + value.playbackSpeed = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedLongLong:cppValue.seekRangeEnd]; + value.seekRangeEnd = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedLongLong:cppValue.seekRangeStart]; + value.seekRangeStart = memberValue; + } while (0); + do { + NSData * _Nullable memberValue; + if (cppValue.data.HasValue()) { + memberValue = AsData(cppValue.data.Value()); + } else { + memberValue = nil; + } + value.data = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithBool:cppValue.audioAdvanceUnmuted]; + value.audioAdvanceUnmuted = memberValue; + } while (0); + + return value; + } default: { break; } @@ -3680,6 +3796,62 @@ static id _Nullable DecodeEventPayloadForAccountLoginCluster(EventId aEventId, T { using namespace Clusters::AccountLogin; switch (aEventId) { + case Events::LoggedOut::Id: { + Events::LoggedOut::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRAccountLoginClusterLoggedOutEvent new]; + + do { + NSNumber * _Nullable memberValue; + if (cppValue.node.HasValue()) { + memberValue = [NSNumber numberWithUnsignedLongLong:cppValue.node.Value()]; + } else { + memberValue = nil; + } + value.node = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} +static id _Nullable DecodeEventPayloadForContentControlCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ContentControl; + switch (aEventId) { + case Events::RemainingScreenTimeExpired::Id: { + Events::RemainingScreenTimeExpired::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRContentControlClusterRemainingScreenTimeExpiredEvent new]; + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} +static id _Nullable DecodeEventPayloadForContentAppObserverCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ContentAppObserver; + switch (aEventId) { default: { break; } @@ -4146,6 +4318,12 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::AccountLogin::Id: { return DecodeEventPayloadForAccountLoginCluster(aPath.mEventId, aReader, aError); } + case Clusters::ContentControl::Id: { + return DecodeEventPayloadForContentControlCluster(aPath.mEventId, aReader, aError); + } + case Clusters::ContentAppObserver::Id: { + return DecodeEventPayloadForContentAppObserverCluster(aPath.mEventId, aReader, aError); + } case Clusters::ElectricalMeasurement::Id: { return DecodeEventPayloadForElectricalMeasurementCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index bc41a5d20b6979..a3bd509398a3f4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1324,6 +1324,24 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSNumber * _Nullable coolSetpoint MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterProgramCastStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull role MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterProgramCategoryStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull category MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable subCategory MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterSeriesInfoStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull season MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull episode MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRChannelClusterChannelInfoStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull majorNumber MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -1331,6 +1349,8 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy) NSString * _Nullable name MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @property (nonatomic, copy) NSString * _Nullable callSign MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @property (nonatomic, copy) NSString * _Nullable affiliateCallSign MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +@property (nonatomic, copy) NSString * _Nullable identifier MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable type MTR_PROVISIONALLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRChannelClusterChannelInfoStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @@ -1342,6 +1362,48 @@ MTR_DEPRECATED("Please use MTRChannelClusterChannelInfoStruct", ios(16.1, 16.4), @property (nonatomic, copy) NSString * _Nullable affiliateCallSign MTR_DEPRECATED("Please use MTRChannelClusterChannelInfoStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterProgramStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull identifier MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRChannelClusterChannelInfoStruct * _Nonnull channel MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull startTime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull endTime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull title MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable subtitle MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable descriptionString MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable audioLanguages MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable ratings MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable thumbnailUrl MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable posterArtUrl MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable dvbiUrl MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable releaseDate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable parentalGuidanceText MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable recordingFlag MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRChannelClusterSeriesInfoStruct * _Nullable seriesInfo MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable categoryList MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable castList MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable externalIDList MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterPageTokenStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nullable limit MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable after MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable before MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterChannelPagingStruct : NSObject +@property (nonatomic, copy) MTRChannelClusterPageTokenStruct * _Nullable previousToken MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRChannelClusterPageTokenStruct * _Nullable nextToken MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChannelClusterAdditionalInfoStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull value MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRChannelClusterLineupInfoStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull operatorName MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -1370,6 +1432,25 @@ MTR_DEPRECATED("Please use MTRTargetNavigatorClusterTargetInfoStruct", ios(16.1, @property (nonatomic, copy) NSString * _Nonnull name MTR_DEPRECATED("Please use MTRTargetNavigatorClusterTargetInfoStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRTargetNavigatorClusterTargetUpdatedEvent : NSObject +@property (nonatomic, copy) NSArray * _Nonnull targetList MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull currentTarget MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSData * _Nonnull data MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRMediaPlaybackClusterTrackAttributesStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull languageCode MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable displayName MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRMediaPlaybackClusterTrackStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull id MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRMediaPlaybackClusterTrackAttributesStruct * _Nullable trackAttributes MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRMediaPlaybackClusterPlaybackPositionStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull updatedAt MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -1382,6 +1463,19 @@ MTR_DEPRECATED("Please use MTRMediaPlaybackClusterPlaybackPositionStruct", ios(1 @property (nonatomic, copy) NSNumber * _Nullable position MTR_DEPRECATED("Please use MTRMediaPlaybackClusterPlaybackPositionStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRMediaPlaybackClusterStateChangedEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull currentState MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull startTime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull duration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRMediaPlaybackClusterPlaybackPositionStruct * _Nonnull sampledPosition MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull playbackSpeed MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull seekRangeEnd MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull seekRangeStart MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSData * _Nullable data MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull audioAdvanceUnmuted MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRMediaInputClusterInputInfoStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull index MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -1412,6 +1506,20 @@ MTR_DEPRECATED("Please use MTRContentLauncherClusterDimensionStruct", ios(16.1, @property (nonatomic, copy) NSNumber * _Nonnull metric MTR_DEPRECATED("Please use MTRContentLauncherClusterDimensionStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentLauncherClusterTrackPreferenceStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull languageCode MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable characteristics MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull audioOutputIndex MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentLauncherClusterPlaybackPreferencesStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull playbackPosition MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRContentLauncherClusterTrackPreferenceStruct * _Nonnull textTrack MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable audioTracks MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRContentLauncherClusterAdditionalInfoStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull name MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -1532,6 +1640,21 @@ MTR_DEPRECATED("Please use MTRApplicationBasicClusterApplicationStruct", ios(16. @interface MTRApplicationBasicClusterApplicationBasicApplication : MTRApplicationBasicClusterApplicationStruct @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRAccountLoginClusterLoggedOutEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nullable node MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterRatingNameStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull ratingName MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable ratingNameDesc MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRContentControlClusterRemainingScreenTimeExpiredEvent : NSObject +@end + MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRUnitTestingClusterSimpleStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull a MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 2264c028fae6d4..fa9319d59092fc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -5516,6 +5516,96 @@ - (NSString *)description @end +@implementation MTRChannelClusterProgramCastStruct +- (instancetype)init +{ + if (self = [super init]) { + + _name = @""; + + _role = @""; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRChannelClusterProgramCastStruct alloc] init]; + + other.name = self.name; + other.role = self.role; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; role:%@; >", NSStringFromClass([self class]), _name, _role]; + return descriptionString; +} + +@end + +@implementation MTRChannelClusterProgramCategoryStruct +- (instancetype)init +{ + if (self = [super init]) { + + _category = @""; + + _subCategory = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRChannelClusterProgramCategoryStruct alloc] init]; + + other.category = self.category; + other.subCategory = self.subCategory; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: category:%@; subCategory:%@; >", NSStringFromClass([self class]), _category, _subCategory]; + return descriptionString; +} + +@end + +@implementation MTRChannelClusterSeriesInfoStruct +- (instancetype)init +{ + if (self = [super init]) { + + _season = @""; + + _episode = @""; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRChannelClusterSeriesInfoStruct alloc] init]; + + other.season = self.season; + other.episode = self.episode; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: season:%@; episode:%@; >", NSStringFromClass([self class]), _season, _episode]; + return descriptionString; +} + +@end + @implementation MTRChannelClusterChannelInfoStruct - (instancetype)init { @@ -5530,6 +5620,10 @@ - (instancetype)init _callSign = nil; _affiliateCallSign = nil; + + _identifier = nil; + + _type = nil; } return self; } @@ -5543,13 +5637,15 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.name = self.name; other.callSign = self.callSign; other.affiliateCallSign = self.affiliateCallSign; + other.identifier = self.identifier; + other.type = self.type; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: majorNumber:%@; minorNumber:%@; name:%@; callSign:%@; affiliateCallSign:%@; >", NSStringFromClass([self class]), _majorNumber, _minorNumber, _name, _callSign, _affiliateCallSign]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: majorNumber:%@; minorNumber:%@; name:%@; callSign:%@; affiliateCallSign:%@; identifier:%@; type:%@; >", NSStringFromClass([self class]), _majorNumber, _minorNumber, _name, _callSign, _affiliateCallSign, _identifier, _type]; return descriptionString; } @@ -5563,6 +5659,180 @@ @implementation MTRChannelClusterChannelInfo : MTRChannelClusterChannelInfoStruc @dynamic affiliateCallSign; @end +@implementation MTRChannelClusterProgramStruct +- (instancetype)init +{ + if (self = [super init]) { + + _identifier = @""; + + _channel = [MTRChannelClusterChannelInfoStruct new]; + + _startTime = @(0); + + _endTime = @(0); + + _title = @""; + + _subtitle = nil; + + _descriptionString = nil; + + _audioLanguages = nil; + + _ratings = nil; + + _thumbnailUrl = nil; + + _posterArtUrl = nil; + + _dvbiUrl = nil; + + _releaseDate = nil; + + _parentalGuidanceText = nil; + + _recordingFlag = nil; + + _seriesInfo = nil; + + _categoryList = nil; + + _castList = nil; + + _externalIDList = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRChannelClusterProgramStruct alloc] init]; + + other.identifier = self.identifier; + other.channel = self.channel; + other.startTime = self.startTime; + other.endTime = self.endTime; + other.title = self.title; + other.subtitle = self.subtitle; + other.descriptionString = self.descriptionString; + other.audioLanguages = self.audioLanguages; + other.ratings = self.ratings; + other.thumbnailUrl = self.thumbnailUrl; + other.posterArtUrl = self.posterArtUrl; + other.dvbiUrl = self.dvbiUrl; + other.releaseDate = self.releaseDate; + other.parentalGuidanceText = self.parentalGuidanceText; + other.recordingFlag = self.recordingFlag; + other.seriesInfo = self.seriesInfo; + other.categoryList = self.categoryList; + other.castList = self.castList; + other.externalIDList = self.externalIDList; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: identifier:%@; channel:%@; startTime:%@; endTime:%@; title:%@; subtitle:%@; descriptionString:%@; audioLanguages:%@; ratings:%@; thumbnailUrl:%@; posterArtUrl:%@; dvbiUrl:%@; releaseDate:%@; parentalGuidanceText:%@; recordingFlag:%@; seriesInfo:%@; categoryList:%@; castList:%@; externalIDList:%@; >", NSStringFromClass([self class]), _identifier, _channel, _startTime, _endTime, _title, _subtitle, _descriptionString, _audioLanguages, _ratings, _thumbnailUrl, _posterArtUrl, _dvbiUrl, _releaseDate, _parentalGuidanceText, _recordingFlag, _seriesInfo, _categoryList, _castList, _externalIDList]; + return descriptionString; +} + +@end + +@implementation MTRChannelClusterPageTokenStruct +- (instancetype)init +{ + if (self = [super init]) { + + _limit = nil; + + _after = nil; + + _before = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRChannelClusterPageTokenStruct alloc] init]; + + other.limit = self.limit; + other.after = self.after; + other.before = self.before; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: limit:%@; after:%@; before:%@; >", NSStringFromClass([self class]), _limit, _after, _before]; + return descriptionString; +} + +@end + +@implementation MTRChannelClusterChannelPagingStruct +- (instancetype)init +{ + if (self = [super init]) { + + _previousToken = nil; + + _nextToken = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRChannelClusterChannelPagingStruct alloc] init]; + + other.previousToken = self.previousToken; + other.nextToken = self.nextToken; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: previousToken:%@; nextToken:%@; >", NSStringFromClass([self class]), _previousToken, _nextToken]; + return descriptionString; +} + +@end + +@implementation MTRChannelClusterAdditionalInfoStruct +- (instancetype)init +{ + if (self = [super init]) { + + _name = @""; + + _value = @""; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRChannelClusterAdditionalInfoStruct alloc] init]; + + other.name = self.name; + other.value = self.value; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; value:%@; >", NSStringFromClass([self class]), _name, _value]; + return descriptionString; +} + +@end + @implementation MTRChannelClusterLineupInfoStruct - (instancetype)init { @@ -5641,6 +5911,99 @@ @implementation MTRTargetNavigatorClusterTargetInfo : MTRTargetNavigatorClusterT @dynamic name; @end +@implementation MTRTargetNavigatorClusterTargetUpdatedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _targetList = [NSArray array]; + + _currentTarget = @(0); + + _data = [NSData data]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRTargetNavigatorClusterTargetUpdatedEvent alloc] init]; + + other.targetList = self.targetList; + other.currentTarget = self.currentTarget; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: targetList:%@; currentTarget:%@; data:%@; >", NSStringFromClass([self class]), _targetList, _currentTarget, [_data base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +@end + +@implementation MTRMediaPlaybackClusterTrackAttributesStruct +- (instancetype)init +{ + if (self = [super init]) { + + _languageCode = @""; + + _displayName = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRMediaPlaybackClusterTrackAttributesStruct alloc] init]; + + other.languageCode = self.languageCode; + other.displayName = self.displayName; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: languageCode:%@; displayName:%@; >", NSStringFromClass([self class]), _languageCode, _displayName]; + return descriptionString; +} + +@end + +@implementation MTRMediaPlaybackClusterTrackStruct +- (instancetype)init +{ + if (self = [super init]) { + + _id = @""; + + _trackAttributes = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRMediaPlaybackClusterTrackStruct alloc] init]; + + other.id = self.id; + other.trackAttributes = self.trackAttributes; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: id:%@; trackAttributes:%@; >", NSStringFromClass([self class]), _id, _trackAttributes]; + return descriptionString; +} + +@end + @implementation MTRMediaPlaybackClusterPlaybackPositionStruct - (instancetype)init { @@ -5676,6 +6039,57 @@ @implementation MTRMediaPlaybackClusterPlaybackPosition : MTRMediaPlaybackCluste @dynamic position; @end +@implementation MTRMediaPlaybackClusterStateChangedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _currentState = @(0); + + _startTime = @(0); + + _duration = @(0); + + _sampledPosition = [MTRMediaPlaybackClusterPlaybackPositionStruct new]; + + _playbackSpeed = @(0); + + _seekRangeEnd = @(0); + + _seekRangeStart = @(0); + + _data = nil; + + _audioAdvanceUnmuted = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRMediaPlaybackClusterStateChangedEvent alloc] init]; + + other.currentState = self.currentState; + other.startTime = self.startTime; + other.duration = self.duration; + other.sampledPosition = self.sampledPosition; + other.playbackSpeed = self.playbackSpeed; + other.seekRangeEnd = self.seekRangeEnd; + other.seekRangeStart = self.seekRangeStart; + other.data = self.data; + other.audioAdvanceUnmuted = self.audioAdvanceUnmuted; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: currentState:%@; startTime:%@; duration:%@; sampledPosition:%@; playbackSpeed:%@; seekRangeEnd:%@; seekRangeStart:%@; data:%@; audioAdvanceUnmuted:%@; >", NSStringFromClass([self class]), _currentState, _startTime, _duration, _sampledPosition, _playbackSpeed, _seekRangeEnd, _seekRangeStart, [_data base64EncodedStringWithOptions:0], _audioAdvanceUnmuted]; + return descriptionString; +} + +@end + @implementation MTRMediaInputClusterInputInfoStruct - (instancetype)init { @@ -5758,6 +6172,72 @@ @implementation MTRContentLauncherClusterDimension : MTRContentLauncherClusterDi @dynamic metric; @end +@implementation MTRContentLauncherClusterTrackPreferenceStruct +- (instancetype)init +{ + if (self = [super init]) { + + _languageCode = @""; + + _characteristics = nil; + + _audioOutputIndex = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + + other.languageCode = self.languageCode; + other.characteristics = self.characteristics; + other.audioOutputIndex = self.audioOutputIndex; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: languageCode:%@; characteristics:%@; audioOutputIndex:%@; >", NSStringFromClass([self class]), _languageCode, _characteristics, _audioOutputIndex]; + return descriptionString; +} + +@end + +@implementation MTRContentLauncherClusterPlaybackPreferencesStruct +- (instancetype)init +{ + if (self = [super init]) { + + _playbackPosition = @(0); + + _textTrack = [MTRContentLauncherClusterTrackPreferenceStruct new]; + + _audioTracks = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + + other.playbackPosition = self.playbackPosition; + other.textTrack = self.textTrack; + other.audioTracks = self.audioTracks; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: playbackPosition:%@; textTrack:%@; audioTracks:%@; >", NSStringFromClass([self class]), _playbackPosition, _textTrack, _audioTracks]; + return descriptionString; +} + +@end + @implementation MTRContentLauncherClusterAdditionalInfoStruct - (instancetype)init { @@ -6142,6 +6622,86 @@ - (NSString * _Nonnull)applicationId @implementation MTRApplicationBasicClusterApplicationBasicApplication : MTRApplicationBasicClusterApplicationStruct @end +@implementation MTRAccountLoginClusterLoggedOutEvent +- (instancetype)init +{ + if (self = [super init]) { + + _node = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRAccountLoginClusterLoggedOutEvent alloc] init]; + + other.node = self.node; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: node:%@; >", NSStringFromClass([self class]), _node]; + return descriptionString; +} + +@end + +@implementation MTRContentControlClusterRatingNameStruct +- (instancetype)init +{ + if (self = [super init]) { + + _ratingName = @""; + + _ratingNameDesc = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRContentControlClusterRatingNameStruct alloc] init]; + + other.ratingName = self.ratingName; + other.ratingNameDesc = self.ratingNameDesc; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: ratingName:%@; ratingNameDesc:%@; >", NSStringFromClass([self class]), _ratingName, _ratingNameDesc]; + return descriptionString; +} + +@end + +@implementation MTRContentControlClusterRemainingScreenTimeExpiredEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRContentControlClusterRemainingScreenTimeExpiredEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + @implementation MTRUnitTestingClusterSimpleStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 1da947a4603420..1ef7156594cd19 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -24043,6 +24043,328 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace AccountLogin +namespace ContentControl { +namespace Attributes { + +namespace Enabled { + +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace Enabled + +namespace OnDemandRatingThreshold { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) +{ + uint8_t zclString[8 + 1]; + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + + VerifyOrReturnError(value.size() == 8, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); + memcpy(value.data(), &zclString[1], 8); + value.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + static_assert(8 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 8, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + uint8_t zclString[8 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace OnDemandRatingThreshold + +namespace ScheduledContentRatingThreshold { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) +{ + uint8_t zclString[8 + 1]; + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + + VerifyOrReturnError(value.size() == 8, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); + memcpy(value.data(), &zclString[1], 8); + value.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + static_assert(8 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 8, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + uint8_t zclString[8 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ScheduledContentRatingThreshold + +namespace ScreenDailyTime { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +} // namespace ScreenDailyTime + +namespace RemainingScreenTime { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +} // namespace RemainingScreenTime + +namespace BlockUnrated { + +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace BlockUnrated + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ContentControl::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ContentControl + +namespace ContentAppObserver { +namespace Attributes { + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ContentAppObserver::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ContentAppObserver + namespace ElectricalMeasurement { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 05505afea06d13..75172b89fdbf7e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -4293,6 +4293,68 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace AccountLogin +namespace ContentControl { +namespace Attributes { + +namespace Enabled { +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); +} // namespace Enabled + +namespace OnDemandRatingThreshold { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace OnDemandRatingThreshold + +namespace ScheduledContentRatingThreshold { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ScheduledContentRatingThreshold + +namespace ScreenDailyTime { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // elapsed_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace ScreenDailyTime + +namespace RemainingScreenTime { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // elapsed_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace RemainingScreenTime + +namespace BlockUnrated { +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); +} // namespace BlockUnrated + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ContentControl + +namespace ContentAppObserver { +namespace Attributes { + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ContentAppObserver + namespace ElectricalMeasurement { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index e23e9d7be99783..94c0e7c6e495e3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -865,6 +865,22 @@ void emberAfApplicationBasicClusterInitCallback(chip::EndpointId endpoint); */ void emberAfAccountLoginClusterInitCallback(chip::EndpointId endpoint); +/** @brief Content Control Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfContentControlClusterInitCallback(chip::EndpointId endpoint); + +/** @brief Content App Observer Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfContentAppObserverClusterInitCallback(chip::EndpointId endpoint); + /** @brief Electrical Measurement Cluster Init * * Cluster Init @@ -8929,6 +8945,160 @@ void emberAfAccountLoginClusterServerTickCallback(chip::EndpointId endpoint); */ void emberAfAccountLoginClusterClientTickCallback(chip::EndpointId endpoint); +// +// Content Control Cluster +// + +/** @brief Content Control Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfContentControlClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Content Control Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterContentControlClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Content Control Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfContentControlClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Content Control Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterContentControlClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Content Control Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterContentControlClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Content Control Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterContentControlClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Content Control Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfContentControlClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Content Control Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfContentControlClusterClientTickCallback(chip::EndpointId endpoint); + +// +// Content App Observer Cluster +// + +/** @brief Content App Observer Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfContentAppObserverClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Content App Observer Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterContentAppObserverClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Content App Observer Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfContentAppObserverClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Content App Observer Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterContentAppObserverClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Content App Observer Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterContentAppObserverClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Content App Observer Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterContentAppObserverClusterClientPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Content App Observer Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfContentAppObserverClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Content App Observer Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfContentAppObserverClusterClientTickCallback(chip::EndpointId endpoint); + // // Electrical Measurement Cluster // @@ -10197,6 +10367,24 @@ bool emberAfChannelClusterChangeChannelByNumberCallback( bool emberAfChannelClusterSkipChannelCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::Channel::Commands::SkipChannel::DecodableType & commandData); +/** + * @brief Channel Cluster GetProgramGuide Command callback (from client) + */ +bool emberAfChannelClusterGetProgramGuideCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Channel::Commands::GetProgramGuide::DecodableType & commandData); +/** + * @brief Channel Cluster RecordProgram Command callback (from client) + */ +bool emberAfChannelClusterRecordProgramCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Channel::Commands::RecordProgram::DecodableType & commandData); +/** + * @brief Channel Cluster CancelRecordProgram Command callback (from client) + */ +bool emberAfChannelClusterCancelRecordProgramCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Channel::Commands::CancelRecordProgram::DecodableType & commandData); /** * @brief Target Navigator Cluster NavigateTarget Command callback (from client) */ @@ -10269,6 +10457,24 @@ bool emberAfMediaPlaybackClusterSkipBackwardCallback( bool emberAfMediaPlaybackClusterSeekCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::MediaPlayback::Commands::Seek::DecodableType & commandData); +/** + * @brief Media Playback Cluster ActivateAudioTrack Command callback (from client) + */ +bool emberAfMediaPlaybackClusterActivateAudioTrackCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::DecodableType & commandData); +/** + * @brief Media Playback Cluster ActivateTextTrack Command callback (from client) + */ +bool emberAfMediaPlaybackClusterActivateTextTrackCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::DecodableType & commandData); +/** + * @brief Media Playback Cluster DeactivateTextTrack Command callback (from client) + */ +bool emberAfMediaPlaybackClusterDeactivateTextTrackCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::DecodableType & commandData); /** * @brief Media Input Cluster SelectInput Command callback (from client) */ @@ -10364,6 +10570,72 @@ bool emberAfAccountLoginClusterLoginCallback(chip::app::CommandHandler * command bool emberAfAccountLoginClusterLogoutCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::AccountLogin::Commands::Logout::DecodableType & commandData); +/** + * @brief Content Control Cluster UpdatePIN Command callback (from client) + */ +bool emberAfContentControlClusterUpdatePINCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::UpdatePIN::DecodableType & commandData); +/** + * @brief Content Control Cluster ResetPIN Command callback (from client) + */ +bool emberAfContentControlClusterResetPINCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::ResetPIN::DecodableType & commandData); +/** + * @brief Content Control Cluster Enable Command callback (from client) + */ +bool emberAfContentControlClusterEnableCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::Enable::DecodableType & commandData); +/** + * @brief Content Control Cluster Disable Command callback (from client) + */ +bool emberAfContentControlClusterDisableCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::Disable::DecodableType & commandData); +/** + * @brief Content Control Cluster AddBonusTime Command callback (from client) + */ +bool emberAfContentControlClusterAddBonusTimeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::AddBonusTime::DecodableType & commandData); +/** + * @brief Content Control Cluster SetScreenDailyTime Command callback (from client) + */ +bool emberAfContentControlClusterSetScreenDailyTimeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::SetScreenDailyTime::DecodableType & commandData); +/** + * @brief Content Control Cluster BlockUnratedContent Command callback (from client) + */ +bool emberAfContentControlClusterBlockUnratedContentCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::BlockUnratedContent::DecodableType & commandData); +/** + * @brief Content Control Cluster UnblockUnratedContent Command callback (from client) + */ +bool emberAfContentControlClusterUnblockUnratedContentCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::UnblockUnratedContent::DecodableType & commandData); +/** + * @brief Content Control Cluster SetOnDemandRatingThreshold Command callback (from client) + */ +bool emberAfContentControlClusterSetOnDemandRatingThresholdCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::SetOnDemandRatingThreshold::DecodableType & commandData); +/** + * @brief Content Control Cluster SetScheduledContentRatingThreshold Command callback (from client) + */ +bool emberAfContentControlClusterSetScheduledContentRatingThresholdCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentControl::Commands::SetScheduledContentRatingThreshold::DecodableType & commandData); +/** + * @brief Content App Observer Cluster ContentAppMessage Command callback (from client) + */ +bool emberAfContentAppObserverClusterContentAppMessageCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::DecodableType & commandData); /** * @brief Electrical Measurement Cluster GetProfileInfoCommand Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 130e8f3fbc1b12..68cc836da58614 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -2863,6 +2863,19 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RadonConcentrationMeasu } } +static auto __attribute__((unused)) EnsureKnownEnumValue(Channel::ChannelTypeEnum val) +{ + using EnumType = Channel::ChannelTypeEnum; + switch (val) + { + case EnumType::kSatellite: + case EnumType::kCable: + case EnumType::kTerrestrial: + return val; + default: + return static_cast(3); + } +} static auto __attribute__((unused)) EnsureKnownEnumValue(Channel::LineupInfoTypeEnum val) { using EnumType = Channel::LineupInfoTypeEnum; @@ -2902,6 +2915,34 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(TargetNavigator::Status } } +static auto __attribute__((unused)) EnsureKnownEnumValue(MediaPlayback::CharacteristicEnum val) +{ + using EnumType = MediaPlayback::CharacteristicEnum; + switch (val) + { + case EnumType::kForcedSubtitles: + case EnumType::kDescribesVideo: + case EnumType::kEasyToRead: + case EnumType::kFrameBased: + case EnumType::kMainProgram: + case EnumType::kOriginalContent: + case EnumType::kVoiceOverTranslation: + case EnumType::kCaption: + case EnumType::kSubtitle: + case EnumType::kAlternate: + case EnumType::kSupplementary: + case EnumType::kCommentary: + case EnumType::kDubbedTranslation: + case EnumType::kDescription: + case EnumType::kMetadata: + case EnumType::kEnhancedAudioIntelligibility: + case EnumType::kEmergency: + case EnumType::kKaraoke: + return val; + default: + return static_cast(18); + } +} static auto __attribute__((unused)) EnsureKnownEnumValue(MediaPlayback::PlaybackStateEnum val) { using EnumType = MediaPlayback::PlaybackStateEnum; @@ -3066,6 +3107,34 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(KeypadInput::StatusEnum } } +static auto __attribute__((unused)) EnsureKnownEnumValue(ContentLauncher::CharacteristicEnum val) +{ + using EnumType = ContentLauncher::CharacteristicEnum; + switch (val) + { + case EnumType::kForcedSubtitles: + case EnumType::kDescribesVideo: + case EnumType::kEasyToRead: + case EnumType::kFrameBased: + case EnumType::kMainProgram: + case EnumType::kOriginalContent: + case EnumType::kVoiceOverTranslation: + case EnumType::kCaption: + case EnumType::kSubtitle: + case EnumType::kAlternate: + case EnumType::kSupplementary: + case EnumType::kCommentary: + case EnumType::kDubbedTranslation: + case EnumType::kDescription: + case EnumType::kMetadata: + case EnumType::kEnhancedAudioIntelligibility: + case EnumType::kEmergency: + case EnumType::kKaraoke: + return val; + default: + return static_cast(18); + } +} static auto __attribute__((unused)) EnsureKnownEnumValue(ContentLauncher::MetricTypeEnum val) { using EnumType = ContentLauncher::MetricTypeEnum; @@ -3097,9 +3166,12 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ContentLauncher::Parame case EnumType::kSportsTeam: case EnumType::kType: case EnumType::kVideo: + case EnumType::kSeason: + case EnumType::kEpisode: + case EnumType::kAny: return val; default: - return static_cast(14); + return static_cast(17); } } static auto __attribute__((unused)) EnsureKnownEnumValue(ContentLauncher::StatusEnum val) @@ -3110,9 +3182,11 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ContentLauncher::Status case EnumType::kSuccess: case EnumType::kURLNotAvailable: case EnumType::kAuthFailed: + case EnumType::kTextTrackNotAvailable: + case EnumType::kAudioTrackNotAvailable: return val; default: - return static_cast(3); + return static_cast(5); } } @@ -3162,6 +3236,19 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ApplicationBasic::Appli } } +static auto __attribute__((unused)) EnsureKnownEnumValue(ContentAppObserver::StatusEnum val) +{ + using EnumType = ContentAppObserver::StatusEnum; + switch (val) + { + case EnumType::kSuccess: + case EnumType::kUnexpectedData: + return val; + default: + return static_cast(2); + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(UnitTesting::SimpleEnum val) { using EnumType = UnitTesting::SimpleEnum; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 1ef1207d3ca0e2..ced7bc64fc61e0 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -4146,6 +4146,19 @@ namespace WakeOnLan {} // namespace WakeOnLan namespace Channel { +// Enum for ChannelTypeEnum +enum class ChannelTypeEnum : uint8_t +{ + kSatellite = 0x00, + kCable = 0x01, + kTerrestrial = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + // Enum for LineupInfoTypeEnum enum class LineupInfoTypeEnum : uint8_t { @@ -4173,8 +4186,18 @@ enum class StatusEnum : uint8_t // Bitmap for Feature enum class Feature : uint32_t { - kChannelList = 0x1, - kLineupInfo = 0x2, + kChannelList = 0x1, + kLineupInfo = 0x2, + kElectronicGuide = 0x3, + kRecordProgram = 0x4, +}; + +// Bitmap for RecordingFlagBitmap +enum class RecordingFlagBitmap : uint32_t +{ + kScheduled = 0x1, + kRecordSeries = 0x2, + kRecorded = 0x3, }; } // namespace Channel @@ -4196,6 +4219,34 @@ enum class StatusEnum : uint8_t namespace MediaPlayback { +// Enum for CharacteristicEnum +enum class CharacteristicEnum : uint8_t +{ + kForcedSubtitles = 0x00, + kDescribesVideo = 0x01, + kEasyToRead = 0x02, + kFrameBased = 0x03, + kMainProgram = 0x04, + kOriginalContent = 0x05, + kVoiceOverTranslation = 0x06, + kCaption = 0x07, + kSubtitle = 0x08, + kAlternate = 0x09, + kSupplementary = 0x0A, + kCommentary = 0x0B, + kDubbedTranslation = 0x0C, + kDescription = 0x0D, + kMetadata = 0x0E, + kEnhancedAudioIntelligibility = 0x0F, + kEmergency = 0x10, + kKaraoke = 0x11, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 18, +}; + // Enum for PlaybackStateEnum enum class PlaybackStateEnum : uint8_t { @@ -4231,6 +4282,9 @@ enum class Feature : uint32_t { kAdvancedSeek = 0x1, kVariableSpeed = 0x2, + kTextTracks = 0x3, + kAudioTracks = 0x4, + kAudioAdvance = 0x5, }; } // namespace MediaPlayback @@ -4389,6 +4443,34 @@ enum class Feature : uint32_t namespace ContentLauncher { +// Enum for CharacteristicEnum +enum class CharacteristicEnum : uint8_t +{ + kForcedSubtitles = 0x00, + kDescribesVideo = 0x01, + kEasyToRead = 0x02, + kFrameBased = 0x03, + kMainProgram = 0x04, + kOriginalContent = 0x05, + kVoiceOverTranslation = 0x06, + kCaption = 0x07, + kSubtitle = 0x08, + kAlternate = 0x09, + kSupplementary = 0x0A, + kCommentary = 0x0B, + kDubbedTranslation = 0x0C, + kDescription = 0x0D, + kMetadata = 0x0E, + kEnhancedAudioIntelligibility = 0x0F, + kEmergency = 0x10, + kKaraoke = 0x11, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 18, +}; + // Enum for MetricTypeEnum enum class MetricTypeEnum : uint8_t { @@ -4418,24 +4500,29 @@ enum class ParameterEnum : uint8_t kSportsTeam = 0x0B, kType = 0x0C, kVideo = 0x0D, + kSeason = 0x0E, + kEpisode = 0x0F, + kAny = 0x10, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. - kUnknownEnumValue = 14, + kUnknownEnumValue = 17, }; // Enum for StatusEnum enum class StatusEnum : uint8_t { - kSuccess = 0x00, - kURLNotAvailable = 0x01, - kAuthFailed = 0x02, + kSuccess = 0x00, + kURLNotAvailable = 0x01, + kAuthFailed = 0x02, + kTextTrackNotAvailable = 0x03, + kAudioTrackNotAvailable = 0x04, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 5, }; // Bitmap for Feature @@ -4443,13 +4530,17 @@ enum class Feature : uint32_t { kContentSearch = 0x1, kURLPlayback = 0x2, + kAdvancedSeek = 0x3, + kTextTracks = 0x4, + kAudioTracks = 0x5, }; // Bitmap for SupportedProtocolsBitmap enum class SupportedProtocolsBitmap : uint32_t { - kDash = 0x1, - kHls = 0x2, + kDash = 0x1, + kHls = 0x2, + kWebRTC = 0x2, }; } // namespace ContentLauncher @@ -4519,6 +4610,34 @@ enum class ApplicationStatusEnum : uint8_t namespace AccountLogin {} // namespace AccountLogin +namespace ContentControl { + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kScreenTime = 0x1, + kPINManagement = 0x2, + kBlockUnrated = 0x3, + kOnDemandContentRating = 0x4, + kScheduledContentRating = 0x5, +}; +} // namespace ContentControl + +namespace ContentAppObserver { + +// Enum for StatusEnum +enum class StatusEnum : uint8_t +{ + kSuccess = 0x00, + kUnexpectedData = 0x01, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 2, +}; +} // namespace ContentAppObserver + namespace ElectricalMeasurement {} // namespace ElectricalMeasurement namespace UnitTesting { 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 795f65aee985f7..c9ea1a045e35e2 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 @@ -20210,15 +20210,12 @@ namespace Events {} // namespace Events namespace Channel { namespace Structs { -namespace ChannelInfoStruct { +namespace ProgramCastStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kMajorNumber), majorNumber); - encoder.Encode(to_underlying(Fields::kMinorNumber), minorNumber); encoder.Encode(to_underlying(Fields::kName), name); - encoder.Encode(to_underlying(Fields::kCallSign), callSign); - encoder.Encode(to_underlying(Fields::kAffiliateCallSign), affiliateCallSign); + encoder.Encode(to_underlying(Fields::kRole), role); return encoder.Finalize(); } @@ -20236,25 +20233,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kMajorNumber)) - { - err = DataModel::Decode(reader, majorNumber); - } - else if (__context_tag == to_underlying(Fields::kMinorNumber)) - { - err = DataModel::Decode(reader, minorNumber); - } - else if (__context_tag == to_underlying(Fields::kName)) + if (__context_tag == to_underlying(Fields::kName)) { err = DataModel::Decode(reader, name); } - else if (__context_tag == to_underlying(Fields::kCallSign)) - { - err = DataModel::Decode(reader, callSign); - } - else if (__context_tag == to_underlying(Fields::kAffiliateCallSign)) + else if (__context_tag == to_underlying(Fields::kRole)) { - err = DataModel::Decode(reader, affiliateCallSign); + err = DataModel::Decode(reader, role); } else { @@ -20264,16 +20249,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace ChannelInfoStruct +} // namespace ProgramCastStruct -namespace LineupInfoStruct { +namespace ProgramCategoryStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kOperatorName), operatorName); - encoder.Encode(to_underlying(Fields::kLineupName), lineupName); - encoder.Encode(to_underlying(Fields::kPostalCode), postalCode); - encoder.Encode(to_underlying(Fields::kLineupInfoType), lineupInfoType); + encoder.Encode(to_underlying(Fields::kCategory), category); + encoder.Encode(to_underlying(Fields::kSubCategory), subCategory); return encoder.Finalize(); } @@ -20291,21 +20274,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kOperatorName)) - { - err = DataModel::Decode(reader, operatorName); - } - else if (__context_tag == to_underlying(Fields::kLineupName)) + if (__context_tag == to_underlying(Fields::kCategory)) { - err = DataModel::Decode(reader, lineupName); - } - else if (__context_tag == to_underlying(Fields::kPostalCode)) - { - err = DataModel::Decode(reader, postalCode); + err = DataModel::Decode(reader, category); } - else if (__context_tag == to_underlying(Fields::kLineupInfoType)) + else if (__context_tag == to_underlying(Fields::kSubCategory)) { - err = DataModel::Decode(reader, lineupInfoType); + err = DataModel::Decode(reader, subCategory); } else { @@ -20315,15 +20290,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace LineupInfoStruct -} // namespace Structs +} // namespace ProgramCategoryStruct -namespace Commands { -namespace ChangeChannel { +namespace SeriesInfoStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kMatch), match); + encoder.Encode(to_underlying(Fields::kSeason), season); + encoder.Encode(to_underlying(Fields::kEpisode), episode); return encoder.Finalize(); } @@ -20341,9 +20315,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kMatch)) + if (__context_tag == to_underlying(Fields::kSeason)) { - err = DataModel::Decode(reader, match); + err = DataModel::Decode(reader, season); + } + else if (__context_tag == to_underlying(Fields::kEpisode)) + { + err = DataModel::Decode(reader, episode); } else { @@ -20352,13 +20330,20 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace ChangeChannel. -namespace ChangeChannelResponse { + +} // namespace SeriesInfoStruct + +namespace ChannelInfoStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kStatus), status); - encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kMajorNumber), majorNumber); + encoder.Encode(to_underlying(Fields::kMinorNumber), minorNumber); + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kCallSign), callSign); + encoder.Encode(to_underlying(Fields::kAffiliateCallSign), affiliateCallSign); + encoder.Encode(to_underlying(Fields::kIdentifier), identifier); + encoder.Encode(to_underlying(Fields::kType), type); return encoder.Finalize(); } @@ -20376,13 +20361,33 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kStatus)) + if (__context_tag == to_underlying(Fields::kMajorNumber)) { - err = DataModel::Decode(reader, status); + err = DataModel::Decode(reader, majorNumber); } - else if (__context_tag == to_underlying(Fields::kData)) + else if (__context_tag == to_underlying(Fields::kMinorNumber)) { - err = DataModel::Decode(reader, data); + err = DataModel::Decode(reader, minorNumber); + } + else if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else if (__context_tag == to_underlying(Fields::kCallSign)) + { + err = DataModel::Decode(reader, callSign); + } + else if (__context_tag == to_underlying(Fields::kAffiliateCallSign)) + { + err = DataModel::Decode(reader, affiliateCallSign); + } + else if (__context_tag == to_underlying(Fields::kIdentifier)) + { + err = DataModel::Decode(reader, identifier); + } + else if (__context_tag == to_underlying(Fields::kType)) + { + err = DataModel::Decode(reader, type); } else { @@ -20391,13 +20396,32 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace ChangeChannelResponse. -namespace ChangeChannelByNumber { + +} // namespace ChannelInfoStruct + +namespace ProgramStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kMajorNumber), majorNumber); - encoder.Encode(to_underlying(Fields::kMinorNumber), minorNumber); + encoder.Encode(to_underlying(Fields::kIdentifier), identifier); + encoder.Encode(to_underlying(Fields::kChannel), channel); + encoder.Encode(to_underlying(Fields::kStartTime), startTime); + encoder.Encode(to_underlying(Fields::kEndTime), endTime); + encoder.Encode(to_underlying(Fields::kTitle), title); + encoder.Encode(to_underlying(Fields::kSubtitle), subtitle); + encoder.Encode(to_underlying(Fields::kDescription), description); + encoder.Encode(to_underlying(Fields::kAudioLanguages), audioLanguages); + encoder.Encode(to_underlying(Fields::kRatings), ratings); + encoder.Encode(to_underlying(Fields::kThumbnailUrl), thumbnailUrl); + encoder.Encode(to_underlying(Fields::kPosterArtUrl), posterArtUrl); + encoder.Encode(to_underlying(Fields::kDvbiUrl), dvbiUrl); + encoder.Encode(to_underlying(Fields::kReleaseDate), releaseDate); + encoder.Encode(to_underlying(Fields::kParentalGuidanceText), parentalGuidanceText); + encoder.Encode(to_underlying(Fields::kRecordingFlag), recordingFlag); + encoder.Encode(to_underlying(Fields::kSeriesInfo), seriesInfo); + encoder.Encode(to_underlying(Fields::kCategoryList), categoryList); + encoder.Encode(to_underlying(Fields::kCastList), castList); + encoder.Encode(to_underlying(Fields::kExternalIDList), externalIDList); return encoder.Finalize(); } @@ -20415,13 +20439,81 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kMajorNumber)) + if (__context_tag == to_underlying(Fields::kIdentifier)) { - err = DataModel::Decode(reader, majorNumber); + err = DataModel::Decode(reader, identifier); } - else if (__context_tag == to_underlying(Fields::kMinorNumber)) + else if (__context_tag == to_underlying(Fields::kChannel)) { - err = DataModel::Decode(reader, minorNumber); + err = DataModel::Decode(reader, channel); + } + else if (__context_tag == to_underlying(Fields::kStartTime)) + { + err = DataModel::Decode(reader, startTime); + } + else if (__context_tag == to_underlying(Fields::kEndTime)) + { + err = DataModel::Decode(reader, endTime); + } + else if (__context_tag == to_underlying(Fields::kTitle)) + { + err = DataModel::Decode(reader, title); + } + else if (__context_tag == to_underlying(Fields::kSubtitle)) + { + err = DataModel::Decode(reader, subtitle); + } + else if (__context_tag == to_underlying(Fields::kDescription)) + { + err = DataModel::Decode(reader, description); + } + else if (__context_tag == to_underlying(Fields::kAudioLanguages)) + { + err = DataModel::Decode(reader, audioLanguages); + } + else if (__context_tag == to_underlying(Fields::kRatings)) + { + err = DataModel::Decode(reader, ratings); + } + else if (__context_tag == to_underlying(Fields::kThumbnailUrl)) + { + err = DataModel::Decode(reader, thumbnailUrl); + } + else if (__context_tag == to_underlying(Fields::kPosterArtUrl)) + { + err = DataModel::Decode(reader, posterArtUrl); + } + else if (__context_tag == to_underlying(Fields::kDvbiUrl)) + { + err = DataModel::Decode(reader, dvbiUrl); + } + else if (__context_tag == to_underlying(Fields::kReleaseDate)) + { + err = DataModel::Decode(reader, releaseDate); + } + else if (__context_tag == to_underlying(Fields::kParentalGuidanceText)) + { + err = DataModel::Decode(reader, parentalGuidanceText); + } + else if (__context_tag == to_underlying(Fields::kRecordingFlag)) + { + err = DataModel::Decode(reader, recordingFlag); + } + else if (__context_tag == to_underlying(Fields::kSeriesInfo)) + { + err = DataModel::Decode(reader, seriesInfo); + } + else if (__context_tag == to_underlying(Fields::kCategoryList)) + { + err = DataModel::Decode(reader, categoryList); + } + else if (__context_tag == to_underlying(Fields::kCastList)) + { + err = DataModel::Decode(reader, castList); + } + else if (__context_tag == to_underlying(Fields::kExternalIDList)) + { + err = DataModel::Decode(reader, externalIDList); } else { @@ -20430,12 +20522,16 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace ChangeChannelByNumber. -namespace SkipChannel { + +} // namespace ProgramStruct + +namespace PageTokenStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kCount), count); + encoder.Encode(to_underlying(Fields::kLimit), limit); + encoder.Encode(to_underlying(Fields::kAfter), after); + encoder.Encode(to_underlying(Fields::kBefore), before); return encoder.Finalize(); } @@ -20453,9 +20549,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kCount)) + if (__context_tag == to_underlying(Fields::kLimit)) { - err = DataModel::Decode(reader, count); + err = DataModel::Decode(reader, limit); + } + else if (__context_tag == to_underlying(Fields::kAfter)) + { + err = DataModel::Decode(reader, after); + } + else if (__context_tag == to_underlying(Fields::kBefore)) + { + err = DataModel::Decode(reader, before); } else { @@ -20464,50 +20568,15 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace SkipChannel. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::ChannelList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, channelList); - case Attributes::Lineup::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, lineup); - case Attributes::CurrentChannel::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, currentChannel); - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, attributeList); - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, featureMap); - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, clusterRevision); - default: - return CHIP_NO_ERROR; - } -} -} // namespace Attributes - -namespace Events {} // namespace Events -} // namespace Channel -namespace TargetNavigator { -namespace Structs { +} // namespace PageTokenStruct -namespace TargetInfoStruct { +namespace ChannelPagingStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kIdentifier), identifier); - encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kPreviousToken), previousToken); + encoder.Encode(to_underlying(Fields::kNextToken), nextToken); return encoder.Finalize(); } @@ -20525,13 +20594,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kIdentifier)) + if (__context_tag == to_underlying(Fields::kPreviousToken)) { - err = DataModel::Decode(reader, identifier); + err = DataModel::Decode(reader, previousToken); } - else if (__context_tag == to_underlying(Fields::kName)) + else if (__context_tag == to_underlying(Fields::kNextToken)) { - err = DataModel::Decode(reader, name); + err = DataModel::Decode(reader, nextToken); } else { @@ -20541,16 +20610,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace TargetInfoStruct -} // namespace Structs +} // namespace ChannelPagingStruct -namespace Commands { -namespace NavigateTarget { +namespace AdditionalInfoStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kTarget), target); - encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kValue), value); return encoder.Finalize(); } @@ -20568,13 +20635,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kTarget)) + if (__context_tag == to_underlying(Fields::kName)) { - err = DataModel::Decode(reader, target); + err = DataModel::Decode(reader, name); } - else if (__context_tag == to_underlying(Fields::kData)) + else if (__context_tag == to_underlying(Fields::kValue)) { - err = DataModel::Decode(reader, data); + err = DataModel::Decode(reader, value); } else { @@ -20583,13 +20650,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace NavigateTarget. -namespace NavigateTargetResponse { + +} // namespace AdditionalInfoStruct + +namespace LineupInfoStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kStatus), status); - encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kOperatorName), operatorName); + encoder.Encode(to_underlying(Fields::kLineupName), lineupName); + encoder.Encode(to_underlying(Fields::kPostalCode), postalCode); + encoder.Encode(to_underlying(Fields::kLineupInfoType), lineupInfoType); return encoder.Finalize(); } @@ -20607,13 +20678,21 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kStatus)) + if (__context_tag == to_underlying(Fields::kOperatorName)) { - err = DataModel::Decode(reader, status); + err = DataModel::Decode(reader, operatorName); } - else if (__context_tag == to_underlying(Fields::kData)) + else if (__context_tag == to_underlying(Fields::kLineupName)) { - err = DataModel::Decode(reader, data); + err = DataModel::Decode(reader, lineupName); + } + else if (__context_tag == to_underlying(Fields::kPostalCode)) + { + err = DataModel::Decode(reader, postalCode); + } + else if (__context_tag == to_underlying(Fields::kLineupInfoType)) + { + err = DataModel::Decode(reader, lineupInfoType); } else { @@ -20622,15 +20701,524 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace NavigateTargetResponse. -} // namespace Commands -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::TargetList::TypeInfo::GetAttributeId(): +} // namespace LineupInfoStruct +} // namespace Structs + +namespace Commands { +namespace ChangeChannel { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kMatch), match); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kMatch)) + { + err = DataModel::Decode(reader, match); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ChangeChannel. +namespace ChangeChannelResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStatus), status); + encoder.Encode(to_underlying(Fields::kData), data); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStatus)) + { + err = DataModel::Decode(reader, status); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ChangeChannelResponse. +namespace ChangeChannelByNumber { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kMajorNumber), majorNumber); + encoder.Encode(to_underlying(Fields::kMinorNumber), minorNumber); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kMajorNumber)) + { + err = DataModel::Decode(reader, majorNumber); + } + else if (__context_tag == to_underlying(Fields::kMinorNumber)) + { + err = DataModel::Decode(reader, minorNumber); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ChangeChannelByNumber. +namespace SkipChannel { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kCount), count); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kCount)) + { + err = DataModel::Decode(reader, count); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SkipChannel. +namespace GetProgramGuide { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStartTime), startTime); + encoder.Encode(to_underlying(Fields::kEndTime), endTime); + encoder.Encode(to_underlying(Fields::kChannelList), channelList); + encoder.Encode(to_underlying(Fields::kPageToken), pageToken); + encoder.Encode(to_underlying(Fields::kRecordingFlag), recordingFlag); + encoder.Encode(to_underlying(Fields::kExternalIDList), externalIDList); + encoder.Encode(to_underlying(Fields::kData), data); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStartTime)) + { + err = DataModel::Decode(reader, startTime); + } + else if (__context_tag == to_underlying(Fields::kEndTime)) + { + err = DataModel::Decode(reader, endTime); + } + else if (__context_tag == to_underlying(Fields::kChannelList)) + { + err = DataModel::Decode(reader, channelList); + } + else if (__context_tag == to_underlying(Fields::kPageToken)) + { + err = DataModel::Decode(reader, pageToken); + } + else if (__context_tag == to_underlying(Fields::kRecordingFlag)) + { + err = DataModel::Decode(reader, recordingFlag); + } + else if (__context_tag == to_underlying(Fields::kExternalIDList)) + { + err = DataModel::Decode(reader, externalIDList); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace GetProgramGuide. +namespace ProgramGuideResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kChannelPagingStruct), channelPagingStruct); + encoder.Encode(to_underlying(Fields::kProgramList), programList); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kChannelPagingStruct)) + { + err = DataModel::Decode(reader, channelPagingStruct); + } + else if (__context_tag == to_underlying(Fields::kProgramList)) + { + err = DataModel::Decode(reader, programList); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ProgramGuideResponse. +namespace RecordProgram { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kProgramIdentifier), programIdentifier); + encoder.Encode(to_underlying(Fields::kShouldRecordSeries), shouldRecordSeries); + encoder.Encode(to_underlying(Fields::kExternalIDList), externalIDList); + encoder.Encode(to_underlying(Fields::kData), data); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kProgramIdentifier)) + { + err = DataModel::Decode(reader, programIdentifier); + } + else if (__context_tag == to_underlying(Fields::kShouldRecordSeries)) + { + err = DataModel::Decode(reader, shouldRecordSeries); + } + else if (__context_tag == to_underlying(Fields::kExternalIDList)) + { + err = DataModel::Decode(reader, externalIDList); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace RecordProgram. +namespace CancelRecordProgram { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kProgramIdentifier), programIdentifier); + encoder.Encode(to_underlying(Fields::kShouldRecordSeries), shouldRecordSeries); + encoder.Encode(to_underlying(Fields::kExternalIDList), externalIDList); + encoder.Encode(to_underlying(Fields::kData), data); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kProgramIdentifier)) + { + err = DataModel::Decode(reader, programIdentifier); + } + else if (__context_tag == to_underlying(Fields::kShouldRecordSeries)) + { + err = DataModel::Decode(reader, shouldRecordSeries); + } + else if (__context_tag == to_underlying(Fields::kExternalIDList)) + { + err = DataModel::Decode(reader, externalIDList); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace CancelRecordProgram. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::ChannelList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, channelList); + case Attributes::Lineup::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, lineup); + case Attributes::CurrentChannel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentChannel); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace Channel +namespace TargetNavigator { +namespace Structs { + +namespace TargetInfoStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kIdentifier), identifier); + encoder.Encode(to_underlying(Fields::kName), name); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kIdentifier)) + { + err = DataModel::Decode(reader, identifier); + } + else if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TargetInfoStruct +} // namespace Structs + +namespace Commands { +namespace NavigateTarget { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTarget), target); + encoder.Encode(to_underlying(Fields::kData), data); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTarget)) + { + err = DataModel::Decode(reader, target); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace NavigateTarget. +namespace NavigateTargetResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStatus), status); + encoder.Encode(to_underlying(Fields::kData), data); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStatus)) + { + err = DataModel::Decode(reader, status); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace NavigateTargetResponse. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::TargetList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, targetList); case Attributes::CurrentTarget::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, currentTarget); @@ -20652,18 +21240,939 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre } } // namespace Attributes +namespace Events { +namespace TargetUpdated { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kTargetList), targetList)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentTarget), currentTarget)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kData), data)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTargetList)) + { + err = DataModel::Decode(reader, targetList); + } + else if (__context_tag == to_underlying(Fields::kCurrentTarget)) + { + err = DataModel::Decode(reader, currentTarget); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace TargetUpdated. +} // namespace Events + +} // namespace TargetNavigator +namespace MediaPlayback { +namespace Structs { + +namespace TrackAttributesStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kLanguageCode), languageCode); + encoder.Encode(to_underlying(Fields::kDisplayName), displayName); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kLanguageCode)) + { + err = DataModel::Decode(reader, languageCode); + } + else if (__context_tag == to_underlying(Fields::kDisplayName)) + { + err = DataModel::Decode(reader, displayName); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TrackAttributesStruct + +namespace TrackStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kId), id); + encoder.Encode(to_underlying(Fields::kTrackAttributes), trackAttributes); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kId)) + { + err = DataModel::Decode(reader, id); + } + else if (__context_tag == to_underlying(Fields::kTrackAttributes)) + { + err = DataModel::Decode(reader, trackAttributes); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TrackStruct + +namespace PlaybackPositionStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kUpdatedAt), updatedAt); + encoder.Encode(to_underlying(Fields::kPosition), position); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kUpdatedAt)) + { + err = DataModel::Decode(reader, updatedAt); + } + else if (__context_tag == to_underlying(Fields::kPosition)) + { + err = DataModel::Decode(reader, position); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PlaybackPositionStruct +} // namespace Structs + +namespace Commands { +namespace Play { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace Play. +namespace Pause { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace Pause. +namespace Stop { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace Stop. +namespace StartOver { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace StartOver. +namespace Previous { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace Previous. +namespace Next { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace Next. +namespace Rewind { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAudioAdvanceUnmuted), audioAdvanceUnmuted); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kAudioAdvanceUnmuted)) + { + err = DataModel::Decode(reader, audioAdvanceUnmuted); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace Rewind. +namespace FastForward { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAudioAdvanceUnmuted), audioAdvanceUnmuted); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kAudioAdvanceUnmuted)) + { + err = DataModel::Decode(reader, audioAdvanceUnmuted); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace FastForward. +namespace SkipForward { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kDeltaPositionMilliseconds), deltaPositionMilliseconds); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kDeltaPositionMilliseconds)) + { + err = DataModel::Decode(reader, deltaPositionMilliseconds); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SkipForward. +namespace SkipBackward { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kDeltaPositionMilliseconds), deltaPositionMilliseconds); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kDeltaPositionMilliseconds)) + { + err = DataModel::Decode(reader, deltaPositionMilliseconds); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SkipBackward. +namespace PlaybackResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStatus), status); + encoder.Encode(to_underlying(Fields::kData), data); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStatus)) + { + err = DataModel::Decode(reader, status); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace PlaybackResponse. +namespace Seek { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPosition), position); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPosition)) + { + err = DataModel::Decode(reader, position); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace Seek. +namespace ActivateAudioTrack { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTrackID), trackID); + encoder.Encode(to_underlying(Fields::kAudioOutputIndex), audioOutputIndex); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTrackID)) + { + err = DataModel::Decode(reader, trackID); + } + else if (__context_tag == to_underlying(Fields::kAudioOutputIndex)) + { + err = DataModel::Decode(reader, audioOutputIndex); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ActivateAudioTrack. +namespace ActivateTextTrack { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTrackID), trackID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTrackID)) + { + err = DataModel::Decode(reader, trackID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ActivateTextTrack. +namespace DeactivateTextTrack { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace DeactivateTextTrack. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::CurrentState::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentState); + case Attributes::StartTime::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, startTime); + case Attributes::Duration::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, duration); + case Attributes::SampledPosition::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, sampledPosition); + case Attributes::PlaybackSpeed::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, playbackSpeed); + case Attributes::SeekRangeEnd::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, seekRangeEnd); + case Attributes::SeekRangeStart::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, seekRangeStart); + case Attributes::ActiveAudioTrack::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, activeAudioTrack); + case Attributes::AvailableAudioTracks::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, availableAudioTracks); + case Attributes::ActiveTextTrack::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, activeTextTrack); + case Attributes::AvailableTextTracks::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, availableTextTracks); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events { +namespace StateChanged { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentState), currentState)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kStartTime), startTime)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kDuration), duration)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSampledPosition), sampledPosition)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPlaybackSpeed), playbackSpeed)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSeekRangeEnd), seekRangeEnd)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSeekRangeStart), seekRangeStart)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kData), data)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kAudioAdvanceUnmuted), audioAdvanceUnmuted)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kCurrentState)) + { + err = DataModel::Decode(reader, currentState); + } + else if (__context_tag == to_underlying(Fields::kStartTime)) + { + err = DataModel::Decode(reader, startTime); + } + else if (__context_tag == to_underlying(Fields::kDuration)) + { + err = DataModel::Decode(reader, duration); + } + else if (__context_tag == to_underlying(Fields::kSampledPosition)) + { + err = DataModel::Decode(reader, sampledPosition); + } + else if (__context_tag == to_underlying(Fields::kPlaybackSpeed)) + { + err = DataModel::Decode(reader, playbackSpeed); + } + else if (__context_tag == to_underlying(Fields::kSeekRangeEnd)) + { + err = DataModel::Decode(reader, seekRangeEnd); + } + else if (__context_tag == to_underlying(Fields::kSeekRangeStart)) + { + err = DataModel::Decode(reader, seekRangeStart); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else if (__context_tag == to_underlying(Fields::kAudioAdvanceUnmuted)) + { + err = DataModel::Decode(reader, audioAdvanceUnmuted); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace StateChanged. +} // namespace Events + +} // namespace MediaPlayback +namespace MediaInput { +namespace Structs { + +namespace InputInfoStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kIndex), index); + encoder.Encode(to_underlying(Fields::kInputType), inputType); + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kDescription), description); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kIndex)) + { + err = DataModel::Decode(reader, index); + } + else if (__context_tag == to_underlying(Fields::kInputType)) + { + err = DataModel::Decode(reader, inputType); + } + else if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else if (__context_tag == to_underlying(Fields::kDescription)) + { + err = DataModel::Decode(reader, description); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace InputInfoStruct +} // namespace Structs + +namespace Commands { +namespace SelectInput { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kIndex), index); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kIndex)) + { + err = DataModel::Decode(reader, index); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SelectInput. +namespace ShowInputStatus { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace ShowInputStatus. +namespace HideInputStatus { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace HideInputStatus. +namespace RenameInput { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kIndex), index); + encoder.Encode(to_underlying(Fields::kName), name); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kIndex)) + { + err = DataModel::Decode(reader, index); + } + else if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace RenameInput. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::InputList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, inputList); + case Attributes::CurrentInput::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentInput); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + namespace Events {} // namespace Events -} // namespace TargetNavigator -namespace MediaPlayback { -namespace Structs { +} // namespace MediaInput +namespace LowPower { -namespace PlaybackPositionStruct { +namespace Commands { +namespace Sleep { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kUpdatedAt), updatedAt); - encoder.Encode(to_underlying(Fields::kPosition), position); return encoder.Finalize(); } @@ -20677,17 +22186,65 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } + } +} +} // namespace Sleep. +} // namespace Commands - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes - if (__context_tag == to_underlying(Fields::kUpdatedAt)) +namespace Events {} // namespace Events + +} // namespace LowPower +namespace KeypadInput { + +namespace Commands { +namespace SendKey { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kKeyCode), keyCode); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) { - err = DataModel::Decode(reader, updatedAt); + return std::get(__element); } - else if (__context_tag == to_underlying(Fields::kPosition)) + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kKeyCode)) { - err = DataModel::Decode(reader, position); + err = DataModel::Decode(reader, keyCode); } else { @@ -20696,15 +22253,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } - -} // namespace PlaybackPositionStruct -} // namespace Structs - -namespace Commands { -namespace Play { +} // namespace SendKey. +namespace SendKeyResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStatus), status); return encoder.Finalize(); } @@ -20718,13 +22272,60 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStatus)) + { + err = DataModel::Decode(reader, status); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace Play. -namespace Pause { +} // namespace SendKeyResponse. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace KeypadInput +namespace ContentLauncher { +namespace Structs { + +namespace DimensionStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWidth), width); + encoder.Encode(to_underlying(Fields::kHeight), height); + encoder.Encode(to_underlying(Fields::kMetric), metric); return encoder.Finalize(); } @@ -20738,13 +22339,39 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kWidth)) + { + err = DataModel::Decode(reader, width); + } + else if (__context_tag == to_underlying(Fields::kHeight)) + { + err = DataModel::Decode(reader, height); + } + else if (__context_tag == to_underlying(Fields::kMetric)) + { + err = DataModel::Decode(reader, metric); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace Pause. -namespace Stop { + +} // namespace DimensionStruct + +namespace TrackPreferenceStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kLanguageCode), languageCode); + encoder.Encode(to_underlying(Fields::kCharacteristics), characteristics); + encoder.Encode(to_underlying(Fields::kAudioOutputIndex), audioOutputIndex); return encoder.Finalize(); } @@ -20758,13 +22385,39 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kLanguageCode)) + { + err = DataModel::Decode(reader, languageCode); + } + else if (__context_tag == to_underlying(Fields::kCharacteristics)) + { + err = DataModel::Decode(reader, characteristics); + } + else if (__context_tag == to_underlying(Fields::kAudioOutputIndex)) + { + err = DataModel::Decode(reader, audioOutputIndex); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace Stop. -namespace StartOver { + +} // namespace TrackPreferenceStruct + +namespace PlaybackPreferencesStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPlaybackPosition), playbackPosition); + encoder.Encode(to_underlying(Fields::kTextTrack), textTrack); + encoder.Encode(to_underlying(Fields::kAudioTracks), audioTracks); return encoder.Finalize(); } @@ -20778,13 +22431,38 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPlaybackPosition)) + { + err = DataModel::Decode(reader, playbackPosition); + } + else if (__context_tag == to_underlying(Fields::kTextTrack)) + { + err = DataModel::Decode(reader, textTrack); + } + else if (__context_tag == to_underlying(Fields::kAudioTracks)) + { + err = DataModel::Decode(reader, audioTracks); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace StartOver. -namespace Previous { + +} // namespace PlaybackPreferencesStruct + +namespace AdditionalInfoStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kValue), value); return encoder.Finalize(); } @@ -20798,13 +22476,35 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else if (__context_tag == to_underlying(Fields::kValue)) + { + err = DataModel::Decode(reader, value); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace Previous. -namespace Next { + +} // namespace AdditionalInfoStruct + +namespace ParameterStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kType), type); + encoder.Encode(to_underlying(Fields::kValue), value); + encoder.Encode(to_underlying(Fields::kExternalIDList), externalIDList); return encoder.Finalize(); } @@ -20816,15 +22516,39 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) auto __element = __iterator.Next(); if (std::holds_alternative(__element)) { - return std::get(__element); + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kType)) + { + err = DataModel::Decode(reader, type); + } + else if (__context_tag == to_underlying(Fields::kValue)) + { + err = DataModel::Decode(reader, value); + } + else if (__context_tag == to_underlying(Fields::kExternalIDList)) + { + err = DataModel::Decode(reader, externalIDList); } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace Next. -namespace Rewind { + +} // namespace ParameterStruct + +namespace ContentSearchStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kParameterList), parameterList); return encoder.Finalize(); } @@ -20838,13 +22562,31 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kParameterList)) + { + err = DataModel::Decode(reader, parameterList); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace Rewind. -namespace FastForward { + +} // namespace ContentSearchStruct + +namespace StyleInformationStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kImageURL), imageURL); + encoder.Encode(to_underlying(Fields::kColor), color); + encoder.Encode(to_underlying(Fields::kSize), size); return encoder.Finalize(); } @@ -20858,14 +22600,42 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kImageURL)) + { + err = DataModel::Decode(reader, imageURL); + } + else if (__context_tag == to_underlying(Fields::kColor)) + { + err = DataModel::Decode(reader, color); + } + else if (__context_tag == to_underlying(Fields::kSize)) + { + err = DataModel::Decode(reader, size); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace FastForward. -namespace SkipForward { + +} // namespace StyleInformationStruct + +namespace BrandingInformationStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kDeltaPositionMilliseconds), deltaPositionMilliseconds); + encoder.Encode(to_underlying(Fields::kProviderName), providerName); + encoder.Encode(to_underlying(Fields::kBackground), background); + encoder.Encode(to_underlying(Fields::kLogo), logo); + encoder.Encode(to_underlying(Fields::kProgressBar), progressBar); + encoder.Encode(to_underlying(Fields::kSplash), splash); + encoder.Encode(to_underlying(Fields::kWaterMark), waterMark); return encoder.Finalize(); } @@ -20883,9 +22653,29 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kDeltaPositionMilliseconds)) + if (__context_tag == to_underlying(Fields::kProviderName)) { - err = DataModel::Decode(reader, deltaPositionMilliseconds); + err = DataModel::Decode(reader, providerName); + } + else if (__context_tag == to_underlying(Fields::kBackground)) + { + err = DataModel::Decode(reader, background); + } + else if (__context_tag == to_underlying(Fields::kLogo)) + { + err = DataModel::Decode(reader, logo); + } + else if (__context_tag == to_underlying(Fields::kProgressBar)) + { + err = DataModel::Decode(reader, progressBar); + } + else if (__context_tag == to_underlying(Fields::kSplash)) + { + err = DataModel::Decode(reader, splash); + } + else if (__context_tag == to_underlying(Fields::kWaterMark)) + { + err = DataModel::Decode(reader, waterMark); } else { @@ -20894,12 +22684,20 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace SkipForward. -namespace SkipBackward { + +} // namespace BrandingInformationStruct +} // namespace Structs + +namespace Commands { +namespace LaunchContent { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kDeltaPositionMilliseconds), deltaPositionMilliseconds); + encoder.Encode(to_underlying(Fields::kSearch), search); + encoder.Encode(to_underlying(Fields::kAutoPlay), autoPlay); + encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kPlaybackPreferences), playbackPreferences); + encoder.Encode(to_underlying(Fields::kUseCurrentContext), useCurrentContext); return encoder.Finalize(); } @@ -20917,9 +22715,25 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kDeltaPositionMilliseconds)) + if (__context_tag == to_underlying(Fields::kSearch)) { - err = DataModel::Decode(reader, deltaPositionMilliseconds); + err = DataModel::Decode(reader, search); + } + else if (__context_tag == to_underlying(Fields::kAutoPlay)) + { + err = DataModel::Decode(reader, autoPlay); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else if (__context_tag == to_underlying(Fields::kPlaybackPreferences)) + { + err = DataModel::Decode(reader, playbackPreferences); + } + else if (__context_tag == to_underlying(Fields::kUseCurrentContext)) + { + err = DataModel::Decode(reader, useCurrentContext); } else { @@ -20928,13 +22742,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace SkipBackward. -namespace PlaybackResponse { +} // namespace LaunchContent. +namespace LaunchURL { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kStatus), status); - encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kContentURL), contentURL); + encoder.Encode(to_underlying(Fields::kDisplayString), displayString); + encoder.Encode(to_underlying(Fields::kBrandingInformation), brandingInformation); return encoder.Finalize(); } @@ -20952,13 +22767,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kStatus)) + if (__context_tag == to_underlying(Fields::kContentURL)) { - err = DataModel::Decode(reader, status); + err = DataModel::Decode(reader, contentURL); } - else if (__context_tag == to_underlying(Fields::kData)) + else if (__context_tag == to_underlying(Fields::kDisplayString)) { - err = DataModel::Decode(reader, data); + err = DataModel::Decode(reader, displayString); + } + else if (__context_tag == to_underlying(Fields::kBrandingInformation)) + { + err = DataModel::Decode(reader, brandingInformation); } else { @@ -20967,12 +22786,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace PlaybackResponse. -namespace Seek { +} // namespace LaunchURL. +namespace LauncherResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kPosition), position); + encoder.Encode(to_underlying(Fields::kStatus), status); + encoder.Encode(to_underlying(Fields::kData), data); return encoder.Finalize(); } @@ -20990,9 +22810,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kPosition)) + if (__context_tag == to_underlying(Fields::kStatus)) { - err = DataModel::Decode(reader, position); + err = DataModel::Decode(reader, status); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); } else { @@ -21001,7 +22825,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace Seek. +} // namespace LauncherResponse. } // namespace Commands namespace Attributes { @@ -21009,20 +22833,10 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::CurrentState::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, currentState); - case Attributes::StartTime::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, startTime); - case Attributes::Duration::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, duration); - case Attributes::SampledPosition::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, sampledPosition); - case Attributes::PlaybackSpeed::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, playbackSpeed); - case Attributes::SeekRangeEnd::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, seekRangeEnd); - case Attributes::SeekRangeStart::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, seekRangeStart); + case Attributes::AcceptHeader::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptHeader); + case Attributes::SupportedStreamingProtocols::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, supportedStreamingProtocols); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, generatedCommandList); case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): @@ -21043,18 +22857,17 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace MediaPlayback -namespace MediaInput { +} // namespace ContentLauncher +namespace AudioOutput { namespace Structs { -namespace InputInfoStruct { +namespace OutputInfoStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; encoder.Encode(to_underlying(Fields::kIndex), index); - encoder.Encode(to_underlying(Fields::kInputType), inputType); + encoder.Encode(to_underlying(Fields::kOutputType), outputType); encoder.Encode(to_underlying(Fields::kName), name); - encoder.Encode(to_underlying(Fields::kDescription), description); return encoder.Finalize(); } @@ -21076,56 +22889,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, index); } - else if (__context_tag == to_underlying(Fields::kInputType)) + else if (__context_tag == to_underlying(Fields::kOutputType)) { - err = DataModel::Decode(reader, inputType); + err = DataModel::Decode(reader, outputType); } else if (__context_tag == to_underlying(Fields::kName)) { err = DataModel::Decode(reader, name); } - else if (__context_tag == to_underlying(Fields::kDescription)) - { - err = DataModel::Decode(reader, description); - } - else - { - } - - ReturnErrorOnFailure(err); - } -} - -} // namespace InputInfoStruct -} // namespace Structs - -namespace Commands { -namespace SelectInput { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kIndex), index); - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kIndex)) - { - err = DataModel::Decode(reader, index); - } else { } @@ -21133,31 +22904,16 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace SelectInput. -namespace ShowInputStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - return encoder.Finalize(); -} -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - } -} -} // namespace ShowInputStatus. -namespace HideInputStatus { +} // namespace OutputInfoStruct +} // namespace Structs + +namespace Commands { +namespace SelectOutput { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kIndex), index); return encoder.Finalize(); } @@ -21171,10 +22927,23 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kIndex)) + { + err = DataModel::Decode(reader, index); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace HideInputStatus. -namespace RenameInput { +} // namespace SelectOutput. +namespace RenameOutput { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; @@ -21212,7 +22981,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace RenameInput. +} // namespace RenameOutput. } // namespace Commands namespace Attributes { @@ -21220,10 +22989,10 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::InputList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, inputList); - case Attributes::CurrentInput::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, currentInput); + case Attributes::OutputList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, outputList); + case Attributes::CurrentOutput::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentOutput); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, generatedCommandList); case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): @@ -21244,14 +23013,16 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace MediaInput -namespace LowPower { +} // namespace AudioOutput +namespace ApplicationLauncher { +namespace Structs { -namespace Commands { -namespace Sleep { +namespace ApplicationEPStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kApplication), application); + encoder.Encode(to_underlying(Fields::kEndpoint), endpoint); return encoder.Finalize(); } @@ -21265,45 +23036,108 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kApplication)) + { + err = DataModel::Decode(reader, application); + } + else if (__context_tag == to_underlying(Fields::kEndpoint)) + { + err = DataModel::Decode(reader, endpoint); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace Sleep. -} // namespace Commands -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +} // namespace ApplicationEPStruct +} // namespace Structs + +namespace Commands { +namespace LaunchApp { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { - switch (path.mAttributeId) + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kApplication), application); + encoder.Encode(to_underlying(Fields::kData), data); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) { - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, attributeList); - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, featureMap); - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, clusterRevision); - default: - return CHIP_NO_ERROR; + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kApplication)) + { + err = DataModel::Decode(reader, application); + } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace Attributes +} // namespace LaunchApp. +namespace StopApp { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kApplication), application); + return encoder.Finalize(); +} -namespace Events {} // namespace Events +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } -} // namespace LowPower -namespace KeypadInput { + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); -namespace Commands { -namespace SendKey { + if (__context_tag == to_underlying(Fields::kApplication)) + { + err = DataModel::Decode(reader, application); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace StopApp. +namespace HideApp { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kKeyCode), keyCode); + encoder.Encode(to_underlying(Fields::kApplication), application); return encoder.Finalize(); } @@ -21321,9 +23155,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kKeyCode)) + if (__context_tag == to_underlying(Fields::kApplication)) { - err = DataModel::Decode(reader, keyCode); + err = DataModel::Decode(reader, application); } else { @@ -21332,12 +23166,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace SendKey. -namespace SendKeyResponse { +} // namespace HideApp. +namespace LauncherResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; encoder.Encode(to_underlying(Fields::kStatus), status); + encoder.Encode(to_underlying(Fields::kData), data); return encoder.Finalize(); } @@ -21359,6 +23194,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, status); } + else if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } else { } @@ -21366,7 +23205,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace SendKeyResponse. +} // namespace LauncherResponse. } // namespace Commands namespace Attributes { @@ -21374,6 +23213,10 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { + case Attributes::CatalogList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, catalogList); + case Attributes::CurrentApp::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentApp); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, generatedCommandList); case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): @@ -21394,17 +23237,62 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace KeypadInput -namespace ContentLauncher { -namespace Structs { +} // namespace ApplicationLauncher +namespace ApplicationBasic { +namespace Structs {} // namespace Structs -namespace DimensionStruct { +namespace Commands {} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::VendorName::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, vendorName); + case Attributes::VendorID::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, vendorID); + case Attributes::ApplicationName::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, applicationName); + case Attributes::ProductID::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, productID); + case Attributes::Application::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, application); + case Attributes::Status::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, status); + case Attributes::ApplicationVersion::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, applicationVersion); + case Attributes::AllowedVendorList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, allowedVendorList); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace ApplicationBasic +namespace AccountLogin { + +namespace Commands { +namespace GetSetupPIN { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kWidth), width); - encoder.Encode(to_underlying(Fields::kHeight), height); - encoder.Encode(to_underlying(Fields::kMetric), metric); + encoder.Encode(to_underlying(Fields::kTempAccountIdentifier), tempAccountIdentifier); return encoder.Finalize(); } @@ -21422,17 +23310,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kWidth)) - { - err = DataModel::Decode(reader, width); - } - else if (__context_tag == to_underlying(Fields::kHeight)) - { - err = DataModel::Decode(reader, height); - } - else if (__context_tag == to_underlying(Fields::kMetric)) + if (__context_tag == to_underlying(Fields::kTempAccountIdentifier)) { - err = DataModel::Decode(reader, metric); + err = DataModel::Decode(reader, tempAccountIdentifier); } else { @@ -21441,15 +23321,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } - -} // namespace DimensionStruct - -namespace AdditionalInfoStruct { +} // namespace GetSetupPIN. +namespace GetSetupPINResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kName), name); - encoder.Encode(to_underlying(Fields::kValue), value); + encoder.Encode(to_underlying(Fields::kSetupPIN), setupPIN); return encoder.Finalize(); } @@ -21467,13 +23344,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kName)) - { - err = DataModel::Decode(reader, name); - } - else if (__context_tag == to_underlying(Fields::kValue)) + if (__context_tag == to_underlying(Fields::kSetupPIN)) { - err = DataModel::Decode(reader, value); + err = DataModel::Decode(reader, setupPIN); } else { @@ -21482,16 +23355,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } - -} // namespace AdditionalInfoStruct - -namespace ParameterStruct { +} // namespace GetSetupPINResponse. +namespace Login { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kType), type); - encoder.Encode(to_underlying(Fields::kValue), value); - encoder.Encode(to_underlying(Fields::kExternalIDList), externalIDList); + encoder.Encode(to_underlying(Fields::kTempAccountIdentifier), tempAccountIdentifier); + encoder.Encode(to_underlying(Fields::kSetupPIN), setupPIN); + encoder.Encode(to_underlying(Fields::kNode), node); return encoder.Finalize(); } @@ -21509,17 +23380,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kType)) + if (__context_tag == to_underlying(Fields::kTempAccountIdentifier)) { - err = DataModel::Decode(reader, type); + err = DataModel::Decode(reader, tempAccountIdentifier); } - else if (__context_tag == to_underlying(Fields::kValue)) + else if (__context_tag == to_underlying(Fields::kSetupPIN)) { - err = DataModel::Decode(reader, value); + err = DataModel::Decode(reader, setupPIN); } - else if (__context_tag == to_underlying(Fields::kExternalIDList)) + else if (__context_tag == to_underlying(Fields::kNode)) { - err = DataModel::Decode(reader, externalIDList); + err = DataModel::Decode(reader, node); } else { @@ -21528,14 +23399,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } - -} // namespace ParameterStruct - -namespace ContentSearchStruct { +} // namespace Login. +namespace Logout { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kParameterList), parameterList); + encoder.Encode(to_underlying(Fields::kNode), node); return encoder.Finalize(); } @@ -21553,9 +23422,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kParameterList)) + if (__context_tag == to_underlying(Fields::kNode)) { - err = DataModel::Decode(reader, parameterList); + err = DataModel::Decode(reader, node); } else { @@ -21564,17 +23433,40 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } +} // namespace Logout. +} // namespace Commands -} // namespace ContentSearchStruct +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes -namespace StyleInformationStruct { +namespace Events { +namespace LoggedOut { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kImageURL), imageURL); - encoder.Encode(to_underlying(Fields::kColor), color); - encoder.Encode(to_underlying(Fields::kSize), size); - return encoder.Finalize(); + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kNode), node)); + return aWriter.EndContainer(outer); } CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) @@ -21591,17 +23483,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kImageURL)) - { - err = DataModel::Decode(reader, imageURL); - } - else if (__context_tag == to_underlying(Fields::kColor)) - { - err = DataModel::Decode(reader, color); - } - else if (__context_tag == to_underlying(Fields::kSize)) + if (__context_tag == to_underlying(Fields::kNode)) { - err = DataModel::Decode(reader, size); + err = DataModel::Decode(reader, node); } else { @@ -21610,19 +23494,19 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } +} // namespace LoggedOut. +} // namespace Events -} // namespace StyleInformationStruct +} // namespace AccountLogin +namespace ContentControl { +namespace Structs { -namespace BrandingInformationStruct { +namespace RatingNameStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kProviderName), providerName); - encoder.Encode(to_underlying(Fields::kBackground), background); - encoder.Encode(to_underlying(Fields::kLogo), logo); - encoder.Encode(to_underlying(Fields::kProgressBar), progressBar); - encoder.Encode(to_underlying(Fields::kSplash), splash); - encoder.Encode(to_underlying(Fields::kWaterMark), waterMark); + encoder.Encode(to_underlying(Fields::kRatingName), ratingName); + encoder.Encode(to_underlying(Fields::kRatingNameDesc), ratingNameDesc); return encoder.Finalize(); } @@ -21640,29 +23524,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kProviderName)) - { - err = DataModel::Decode(reader, providerName); - } - else if (__context_tag == to_underlying(Fields::kBackground)) - { - err = DataModel::Decode(reader, background); - } - else if (__context_tag == to_underlying(Fields::kLogo)) - { - err = DataModel::Decode(reader, logo); - } - else if (__context_tag == to_underlying(Fields::kProgressBar)) - { - err = DataModel::Decode(reader, progressBar); - } - else if (__context_tag == to_underlying(Fields::kSplash)) + if (__context_tag == to_underlying(Fields::kRatingName)) { - err = DataModel::Decode(reader, splash); + err = DataModel::Decode(reader, ratingName); } - else if (__context_tag == to_underlying(Fields::kWaterMark)) + else if (__context_tag == to_underlying(Fields::kRatingNameDesc)) { - err = DataModel::Decode(reader, waterMark); + err = DataModel::Decode(reader, ratingNameDesc); } else { @@ -21672,17 +23540,16 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace BrandingInformationStruct +} // namespace RatingNameStruct } // namespace Structs namespace Commands { -namespace LaunchContent { +namespace UpdatePIN { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kSearch), search); - encoder.Encode(to_underlying(Fields::kAutoPlay), autoPlay); - encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kOldPIN), oldPIN); + encoder.Encode(to_underlying(Fields::kNewPIN), newPIN); return encoder.Finalize(); } @@ -21700,17 +23567,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kSearch)) + if (__context_tag == to_underlying(Fields::kOldPIN)) { - err = DataModel::Decode(reader, search); - } - else if (__context_tag == to_underlying(Fields::kAutoPlay)) - { - err = DataModel::Decode(reader, autoPlay); + err = DataModel::Decode(reader, oldPIN); } - else if (__context_tag == to_underlying(Fields::kData)) + else if (__context_tag == to_underlying(Fields::kNewPIN)) { - err = DataModel::Decode(reader, data); + err = DataModel::Decode(reader, newPIN); } else { @@ -21719,14 +23582,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace LaunchContent. -namespace LaunchURL { +} // namespace UpdatePIN. +namespace ResetPIN { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kContentURL), contentURL); - encoder.Encode(to_underlying(Fields::kDisplayString), displayString); - encoder.Encode(to_underlying(Fields::kBrandingInformation), brandingInformation); return encoder.Finalize(); } @@ -21740,36 +23600,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kContentURL)) - { - err = DataModel::Decode(reader, contentURL); - } - else if (__context_tag == to_underlying(Fields::kDisplayString)) - { - err = DataModel::Decode(reader, displayString); - } - else if (__context_tag == to_underlying(Fields::kBrandingInformation)) - { - err = DataModel::Decode(reader, brandingInformation); - } - else - { - } - - ReturnErrorOnFailure(err); } } -} // namespace LaunchURL. -namespace LauncherResponse { +} // namespace ResetPIN. +namespace ResetPINResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kStatus), status); - encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kPINCode), PINCode); return encoder.Finalize(); } @@ -21787,13 +23625,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kStatus)) - { - err = DataModel::Decode(reader, status); - } - else if (__context_tag == to_underlying(Fields::kData)) + if (__context_tag == to_underlying(Fields::kPINCode)) { - err = DataModel::Decode(reader, data); + err = DataModel::Decode(reader, PINCode); } else { @@ -21802,49 +23636,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace LauncherResponse. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::AcceptHeader::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptHeader); - case Attributes::SupportedStreamingProtocols::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, supportedStreamingProtocols); - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, attributeList); - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, featureMap); - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, clusterRevision); - default: - return CHIP_NO_ERROR; - } -} -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace ContentLauncher -namespace AudioOutput { -namespace Structs { - -namespace OutputInfoStruct { +} // namespace ResetPINResponse. +namespace Enable { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kIndex), index); - encoder.Encode(to_underlying(Fields::kOutputType), outputType); - encoder.Encode(to_underlying(Fields::kName), name); return encoder.Finalize(); } @@ -21858,39 +23654,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kIndex)) - { - err = DataModel::Decode(reader, index); - } - else if (__context_tag == to_underlying(Fields::kOutputType)) - { - err = DataModel::Decode(reader, outputType); - } - else if (__context_tag == to_underlying(Fields::kName)) - { - err = DataModel::Decode(reader, name); - } - else - { - } - - ReturnErrorOnFailure(err); } } - -} // namespace OutputInfoStruct -} // namespace Structs - -namespace Commands { -namespace SelectOutput { +} // namespace Enable. +namespace Disable { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kIndex), index); return encoder.Finalize(); } @@ -21904,28 +23674,15 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kIndex)) - { - err = DataModel::Decode(reader, index); - } - else - { - } - - ReturnErrorOnFailure(err); } } -} // namespace SelectOutput. -namespace RenameOutput { +} // namespace Disable. +namespace AddBonusTime { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kIndex), index); - encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kPINCode), PINCode); + encoder.Encode(to_underlying(Fields::kBonusTime), bonusTime); return encoder.Finalize(); } @@ -21943,13 +23700,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kIndex)) + if (__context_tag == to_underlying(Fields::kPINCode)) { - err = DataModel::Decode(reader, index); + err = DataModel::Decode(reader, PINCode); } - else if (__context_tag == to_underlying(Fields::kName)) + else if (__context_tag == to_underlying(Fields::kBonusTime)) { - err = DataModel::Decode(reader, name); + err = DataModel::Decode(reader, bonusTime); } else { @@ -21958,48 +23715,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace RenameOutput. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::OutputList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, outputList); - case Attributes::CurrentOutput::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, currentOutput); - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, attributeList); - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, featureMap); - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, clusterRevision); - default: - return CHIP_NO_ERROR; - } -} -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace AudioOutput -namespace ApplicationLauncher { -namespace Structs { - -namespace ApplicationEPStruct { +} // namespace AddBonusTime. +namespace SetScreenDailyTime { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kApplication), application); - encoder.Encode(to_underlying(Fields::kEndpoint), endpoint); + encoder.Encode(to_underlying(Fields::kScreenTime), screenTime); return encoder.Finalize(); } @@ -22017,13 +23738,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kApplication)) - { - err = DataModel::Decode(reader, application); - } - else if (__context_tag == to_underlying(Fields::kEndpoint)) + if (__context_tag == to_underlying(Fields::kScreenTime)) { - err = DataModel::Decode(reader, endpoint); + err = DataModel::Decode(reader, screenTime); } else { @@ -22032,17 +23749,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } - -} // namespace ApplicationEPStruct -} // namespace Structs - -namespace Commands { -namespace LaunchApp { +} // namespace SetScreenDailyTime. +namespace BlockUnratedContent { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kApplication), application); - encoder.Encode(to_underlying(Fields::kData), data); return encoder.Finalize(); } @@ -22056,31 +23767,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kApplication)) - { - err = DataModel::Decode(reader, application); - } - else if (__context_tag == to_underlying(Fields::kData)) - { - err = DataModel::Decode(reader, data); - } - else - { - } - - ReturnErrorOnFailure(err); } } -} // namespace LaunchApp. -namespace StopApp { +} // namespace BlockUnratedContent. +namespace UnblockUnratedContent { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kApplication), application); return encoder.Finalize(); } @@ -22094,27 +23787,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kApplication)) - { - err = DataModel::Decode(reader, application); - } - else - { - } - - ReturnErrorOnFailure(err); } } -} // namespace StopApp. -namespace HideApp { +} // namespace UnblockUnratedContent. +namespace SetOnDemandRatingThreshold { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kApplication), application); + encoder.Encode(to_underlying(Fields::kRating), rating); return encoder.Finalize(); } @@ -22132,9 +23812,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kApplication)) + if (__context_tag == to_underlying(Fields::kRating)) { - err = DataModel::Decode(reader, application); + err = DataModel::Decode(reader, rating); } else { @@ -22143,13 +23823,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace HideApp. -namespace LauncherResponse { +} // namespace SetOnDemandRatingThreshold. +namespace SetScheduledContentRatingThreshold { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kStatus), status); - encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kRating), rating); return encoder.Finalize(); } @@ -22167,13 +23846,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kStatus)) - { - err = DataModel::Decode(reader, status); - } - else if (__context_tag == to_underlying(Fields::kData)) + if (__context_tag == to_underlying(Fields::kRating)) { - err = DataModel::Decode(reader, data); + err = DataModel::Decode(reader, rating); } else { @@ -22182,7 +23857,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace LauncherResponse. +} // namespace SetScheduledContentRatingThreshold. } // namespace Commands namespace Attributes { @@ -22190,57 +23865,22 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::CatalogList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, catalogList); - case Attributes::CurrentApp::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, currentApp); - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, attributeList); - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, featureMap); - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, clusterRevision); - default: - return CHIP_NO_ERROR; - } -} -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace ApplicationLauncher -namespace ApplicationBasic { -namespace Structs {} // namespace Structs - -namespace Commands {} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::VendorName::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, vendorName); - case Attributes::VendorID::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, vendorID); - case Attributes::ApplicationName::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, applicationName); - case Attributes::ProductID::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, productID); - case Attributes::Application::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, application); - case Attributes::Status::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, status); - case Attributes::ApplicationVersion::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, applicationVersion); - case Attributes::AllowedVendorList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, allowedVendorList); + case Attributes::Enabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, enabled); + case Attributes::OnDemandRatings::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, onDemandRatings); + case Attributes::OnDemandRatingThreshold::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, onDemandRatingThreshold); + case Attributes::ScheduledContentRatings::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, scheduledContentRatings); + case Attributes::ScheduledContentRatingThreshold::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, scheduledContentRatingThreshold); + case Attributes::ScreenDailyTime::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, screenDailyTime); + case Attributes::RemainingScreenTime::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, remainingScreenTime); + case Attributes::BlockUnrated::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, blockUnrated); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, generatedCommandList); case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): @@ -22259,18 +23899,13 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre } } // namespace Attributes -namespace Events {} // namespace Events - -} // namespace ApplicationBasic -namespace AccountLogin { - -namespace Commands { -namespace GetSetupPIN { +namespace Events { +namespace RemainingScreenTimeExpired { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kTempAccountIdentifier), tempAccountIdentifier); - return encoder.Finalize(); + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + return aWriter.EndContainer(outer); } CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) @@ -22283,27 +23918,21 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kTempAccountIdentifier)) - { - err = DataModel::Decode(reader, tempAccountIdentifier); - } - else - { - } - - ReturnErrorOnFailure(err); } } -} // namespace GetSetupPIN. -namespace GetSetupPINResponse { +} // namespace RemainingScreenTimeExpired. +} // namespace Events + +} // namespace ContentControl +namespace ContentAppObserver { + +namespace Commands { +namespace ContentAppMessage { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kSetupPIN), setupPIN); + encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kEncodingHint), encodingHint); return encoder.Finalize(); } @@ -22321,9 +23950,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kSetupPIN)) + if (__context_tag == to_underlying(Fields::kData)) { - err = DataModel::Decode(reader, setupPIN); + err = DataModel::Decode(reader, data); + } + else if (__context_tag == to_underlying(Fields::kEncodingHint)) + { + err = DataModel::Decode(reader, encodingHint); } else { @@ -22332,13 +23965,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace GetSetupPINResponse. -namespace Login { +} // namespace ContentAppMessage. +namespace ContentAppMessageResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kTempAccountIdentifier), tempAccountIdentifier); - encoder.Encode(to_underlying(Fields::kSetupPIN), setupPIN); + encoder.Encode(to_underlying(Fields::kStatus), status); + encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kEncodingHint), encodingHint); return encoder.Finalize(); } @@ -22356,13 +23990,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kTempAccountIdentifier)) + if (__context_tag == to_underlying(Fields::kStatus)) { - err = DataModel::Decode(reader, tempAccountIdentifier); + err = DataModel::Decode(reader, status); } - else if (__context_tag == to_underlying(Fields::kSetupPIN)) + else if (__context_tag == to_underlying(Fields::kData)) { - err = DataModel::Decode(reader, setupPIN); + err = DataModel::Decode(reader, data); + } + else if (__context_tag == to_underlying(Fields::kEncodingHint)) + { + err = DataModel::Decode(reader, encodingHint); } else { @@ -22371,27 +24009,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace Login. -namespace Logout { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - } -} -} // namespace Logout. +} // namespace ContentAppMessageResponse. } // namespace Commands namespace Attributes { @@ -22419,7 +24037,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace AccountLogin +} // namespace ContentAppObserver namespace ElectricalMeasurement { namespace Commands { @@ -25808,6 +27426,20 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::ContentControl::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::ContentAppObserver::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::ElectricalMeasurement::Id: { switch (aCommand) { 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 3a3ebd1e3c0295..4b7d700dfc0585 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 @@ -31535,6 +31535,75 @@ struct TypeInfo } // namespace WakeOnLan namespace Channel { namespace Structs { +namespace ProgramCastStruct { +enum class Fields : uint8_t +{ + kName = 0, + kRole = 1, +}; + +struct Type +{ +public: + chip::CharSpan name; + chip::CharSpan role; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace ProgramCastStruct +namespace ProgramCategoryStruct { +enum class Fields : uint8_t +{ + kCategory = 0, + kSubCategory = 1, +}; + +struct Type +{ +public: + chip::CharSpan category; + Optional subCategory; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace ProgramCategoryStruct +namespace SeriesInfoStruct { +enum class Fields : uint8_t +{ + kSeason = 0, + kEpisode = 1, +}; + +struct Type +{ +public: + chip::CharSpan season; + chip::CharSpan episode; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace SeriesInfoStruct namespace ChannelInfoStruct { enum class Fields : uint8_t { @@ -31543,6 +31612,8 @@ enum class Fields : uint8_t kName = 2, kCallSign = 3, kAffiliateCallSign = 4, + kIdentifier = 5, + kType = 6, }; struct Type @@ -31553,6 +31624,8 @@ struct Type Optional name; Optional callSign; Optional affiliateCallSign; + Optional identifier; + Optional type; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -31564,6 +31637,158 @@ struct Type using DecodableType = Type; } // namespace ChannelInfoStruct +namespace ProgramStruct { +enum class Fields : uint8_t +{ + kIdentifier = 0, + kChannel = 1, + kStartTime = 2, + kEndTime = 3, + kTitle = 4, + kSubtitle = 5, + kDescription = 6, + kAudioLanguages = 7, + kRatings = 8, + kThumbnailUrl = 9, + kPosterArtUrl = 10, + kDvbiUrl = 11, + kReleaseDate = 12, + kParentalGuidanceText = 13, + kRecordingFlag = 14, + kSeriesInfo = 15, + kCategoryList = 16, + kCastList = 17, + kExternalIDList = 18, +}; + +struct Type +{ +public: + chip::CharSpan identifier; + Structs::ChannelInfoStruct::Type channel; + uint32_t startTime = static_cast(0); + uint32_t endTime = static_cast(0); + chip::CharSpan title; + Optional subtitle; + Optional description; + Optional> audioLanguages; + Optional> ratings; + Optional thumbnailUrl; + Optional posterArtUrl; + Optional dvbiUrl; + Optional releaseDate; + Optional parentalGuidanceText; + Optional> recordingFlag; + Optional> seriesInfo; + Optional> categoryList; + Optional> castList; + Optional> externalIDList; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + chip::CharSpan identifier; + Structs::ChannelInfoStruct::DecodableType channel; + uint32_t startTime = static_cast(0); + uint32_t endTime = static_cast(0); + chip::CharSpan title; + Optional subtitle; + Optional description; + Optional> audioLanguages; + Optional> ratings; + Optional thumbnailUrl; + Optional posterArtUrl; + Optional dvbiUrl; + Optional releaseDate; + Optional parentalGuidanceText; + Optional> recordingFlag; + Optional> seriesInfo; + Optional> categoryList; + Optional> castList; + Optional> externalIDList; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace ProgramStruct +namespace PageTokenStruct { +enum class Fields : uint8_t +{ + kLimit = 0, + kAfter = 1, + kBefore = 2, +}; + +struct Type +{ +public: + Optional limit; + Optional after; + Optional before; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace PageTokenStruct +namespace ChannelPagingStruct { +enum class Fields : uint8_t +{ + kPreviousToken = 0, + kNextToken = 1, +}; + +struct Type +{ +public: + Optional> previousToken; + Optional> nextToken; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace ChannelPagingStruct +namespace AdditionalInfoStruct { +enum class Fields : uint8_t +{ + kName = 0, + kValue = 1, +}; + +struct Type +{ +public: + chip::CharSpan name; + chip::CharSpan value; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace AdditionalInfoStruct namespace LineupInfoStruct { enum class Fields : uint8_t { @@ -31616,6 +31841,26 @@ struct Type; struct DecodableType; } // namespace SkipChannel +namespace GetProgramGuide { +struct Type; +struct DecodableType; +} // namespace GetProgramGuide + +namespace ProgramGuideResponse { +struct Type; +struct DecodableType; +} // namespace ProgramGuideResponse + +namespace RecordProgram { +struct Type; +struct DecodableType; +} // namespace RecordProgram + +namespace CancelRecordProgram { +struct Type; +struct DecodableType; +} // namespace CancelRecordProgram + } // namespace Commands namespace Commands { @@ -31753,6 +31998,173 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SkipChannel +namespace GetProgramGuide { +enum class Fields : uint8_t +{ + kStartTime = 0, + kEndTime = 1, + kChannelList = 2, + kPageToken = 3, + kRecordingFlag = 4, + kExternalIDList = 5, + kData = 6, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::GetProgramGuide::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } + + Optional startTime; + Optional endTime; + Optional> channelList; + Optional pageToken; + Optional> recordingFlag; + Optional> externalIDList; + Optional data; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::Channel::Commands::ProgramGuideResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::GetProgramGuide::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } + + Optional startTime; + Optional endTime; + Optional> channelList; + Optional pageToken; + Optional> recordingFlag; + Optional> externalIDList; + Optional data; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace GetProgramGuide +namespace ProgramGuideResponse { +enum class Fields : uint8_t +{ + kChannelPagingStruct = 0, + kProgramList = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ProgramGuideResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } + + int16_t channelPagingStruct = static_cast(0); + DataModel::List programList; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ProgramGuideResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } + + int16_t channelPagingStruct = static_cast(0); + DataModel::DecodableList programList; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ProgramGuideResponse +namespace RecordProgram { +enum class Fields : uint8_t +{ + kProgramIdentifier = 0, + kShouldRecordSeries = 1, + kExternalIDList = 2, + kData = 3, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::RecordProgram::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } + + chip::CharSpan programIdentifier; + bool shouldRecordSeries = static_cast(0); + DataModel::List externalIDList; + chip::ByteSpan data; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::RecordProgram::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } + + chip::CharSpan programIdentifier; + bool shouldRecordSeries = static_cast(0); + DataModel::DecodableList externalIDList; + chip::ByteSpan data; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace RecordProgram +namespace CancelRecordProgram { +enum class Fields : uint8_t +{ + kProgramIdentifier = 0, + kShouldRecordSeries = 1, + kExternalIDList = 2, + kData = 3, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::CancelRecordProgram::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } + + chip::CharSpan programIdentifier; + bool shouldRecordSeries = static_cast(0); + DataModel::List externalIDList; + chip::ByteSpan data; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::CancelRecordProgram::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } + + chip::CharSpan programIdentifier; + bool shouldRecordSeries = static_cast(0); + DataModel::DecodableList externalIDList; + chip::ByteSpan data; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace CancelRecordProgram } // namespace Commands namespace Attributes { @@ -32054,23 +32466,110 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace TargetNavigator -namespace MediaPlayback { -namespace Structs { -namespace PlaybackPositionStruct { +namespace Events { +namespace TargetUpdated { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + enum class Fields : uint8_t { - kUpdatedAt = 0, - kPosition = 1, + kTargetList = 0, + kCurrentTarget = 1, + kData = 2, }; struct Type { public: - uint64_t updatedAt = static_cast(0); - DataModel::Nullable position; - - CHIP_ERROR Decode(TLV::TLVReader & reader); + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::TargetUpdated::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } + static constexpr bool kIsFabricScoped = false; + + DataModel::List targetList; + uint8_t currentTarget = static_cast(0); + chip::ByteSpan data; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::TargetUpdated::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } + + DataModel::DecodableList targetList; + uint8_t currentTarget = static_cast(0); + chip::ByteSpan data; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace TargetUpdated +} // namespace Events +} // namespace TargetNavigator +namespace MediaPlayback { +namespace Structs { +namespace TrackAttributesStruct { +enum class Fields : uint8_t +{ + kLanguageCode = 0, + kDisplayName = 1, +}; + +struct Type +{ +public: + chip::CharSpan languageCode; + Optional> displayName; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace TrackAttributesStruct +namespace TrackStruct { +enum class Fields : uint8_t +{ + kId = 0, + kTrackAttributes = 1, +}; + +struct Type +{ +public: + chip::CharSpan id; + DataModel::Nullable trackAttributes; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace TrackStruct +namespace PlaybackPositionStruct { +enum class Fields : uint8_t +{ + kUpdatedAt = 0, + kPosition = 1, +}; + +struct Type +{ +public: + uint64_t updatedAt = static_cast(0); + DataModel::Nullable position; + + CHIP_ERROR Decode(TLV::TLVReader & reader); static constexpr bool kIsFabricScoped = false; @@ -32145,6 +32644,21 @@ struct Type; struct DecodableType; } // namespace Seek +namespace ActivateAudioTrack { +struct Type; +struct DecodableType; +} // namespace ActivateAudioTrack + +namespace ActivateTextTrack { +struct Type; +struct DecodableType; +} // namespace ActivateTextTrack + +namespace DeactivateTextTrack { +struct Type; +struct DecodableType; +} // namespace DeactivateTextTrack + } // namespace Commands namespace Commands { @@ -32319,6 +32833,7 @@ struct DecodableType namespace Rewind { enum class Fields : uint8_t { + kAudioAdvanceUnmuted = 0, }; struct Type @@ -32328,6 +32843,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::Rewind::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + Optional audioAdvanceUnmuted; + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; @@ -32341,12 +32858,14 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::Rewind::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + Optional audioAdvanceUnmuted; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace Rewind namespace FastForward { enum class Fields : uint8_t { + kAudioAdvanceUnmuted = 0, }; struct Type @@ -32356,6 +32875,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::FastForward::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + Optional audioAdvanceUnmuted; + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; @@ -32369,6 +32890,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::FastForward::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + Optional audioAdvanceUnmuted; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace FastForward @@ -32503,6 +33025,101 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace Seek +namespace ActivateAudioTrack { +enum class Fields : uint8_t +{ + kTrackID = 0, + kAudioOutputIndex = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ActivateAudioTrack::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + + chip::CharSpan trackID; + uint8_t audioOutputIndex = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ActivateAudioTrack::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + + chip::CharSpan trackID; + uint8_t audioOutputIndex = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ActivateAudioTrack +namespace ActivateTextTrack { +enum class Fields : uint8_t +{ + kTrackID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ActivateTextTrack::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + + chip::CharSpan trackID; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ActivateTextTrack::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + + chip::CharSpan trackID; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ActivateTextTrack +namespace DeactivateTextTrack { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::DeactivateTextTrack::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::DeactivateTextTrack::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace DeactivateTextTrack } // namespace Commands namespace Attributes { @@ -32593,6 +33210,62 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace SeekRangeStart +namespace ActiveAudioTrack { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ActiveAudioTrack::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ActiveAudioTrack +namespace AvailableAudioTracks { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable< + chip::app::DataModel::List>; + using DecodableType = chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList>; + using DecodableArgType = const chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> &; + + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AvailableAudioTracks::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AvailableAudioTracks +namespace ActiveTextTrack { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ActiveTextTrack::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ActiveTextTrack +namespace AvailableTextTracks { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable< + chip::app::DataModel::List>; + using DecodableType = chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList>; + using DecodableArgType = const chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> &; + + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AvailableTextTracks::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AvailableTextTracks namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -32646,6 +33319,10 @@ struct TypeInfo Attributes::PlaybackSpeed::TypeInfo::DecodableType playbackSpeed = static_cast(0); Attributes::SeekRangeEnd::TypeInfo::DecodableType seekRangeEnd; Attributes::SeekRangeStart::TypeInfo::DecodableType seekRangeStart; + Attributes::ActiveAudioTrack::TypeInfo::DecodableType activeAudioTrack; + Attributes::AvailableAudioTracks::TypeInfo::DecodableType availableAudioTracks; + Attributes::ActiveTextTrack::TypeInfo::DecodableType activeTextTrack; + Attributes::AvailableTextTracks::TypeInfo::DecodableType availableTextTracks; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; @@ -32655,6 +33332,65 @@ struct TypeInfo }; }; } // namespace Attributes +namespace Events { +namespace StateChanged { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kCurrentState = 0, + kStartTime = 1, + kDuration = 2, + kSampledPosition = 3, + kPlaybackSpeed = 4, + kSeekRangeEnd = 5, + kSeekRangeStart = 6, + kData = 7, + kAudioAdvanceUnmuted = 8, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::StateChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + static constexpr bool kIsFabricScoped = false; + + PlaybackStateEnum currentState = static_cast(0); + uint64_t startTime = static_cast(0); + uint64_t duration = static_cast(0); + Structs::PlaybackPositionStruct::Type sampledPosition; + float playbackSpeed = static_cast(0); + uint64_t seekRangeEnd = static_cast(0); + uint64_t seekRangeStart = static_cast(0); + Optional data; + bool audioAdvanceUnmuted = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::StateChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } + + PlaybackStateEnum currentState = static_cast(0); + uint64_t startTime = static_cast(0); + uint64_t duration = static_cast(0); + Structs::PlaybackPositionStruct::DecodableType sampledPosition; + float playbackSpeed = static_cast(0); + uint64_t seekRangeEnd = static_cast(0); + uint64_t seekRangeStart = static_cast(0); + Optional data; + bool audioAdvanceUnmuted = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace StateChanged +} // namespace Events } // namespace MediaPlayback namespace MediaInput { namespace Structs { @@ -33191,43 +33927,53 @@ struct Type using DecodableType = Type; } // namespace DimensionStruct -namespace AdditionalInfoStruct { +namespace TrackPreferenceStruct { enum class Fields : uint8_t { - kName = 0, - kValue = 1, + kLanguageCode = 0, + kCharacteristics = 1, + kAudioOutputIndex = 2, }; struct Type { public: - chip::CharSpan name; - chip::CharSpan value; - - CHIP_ERROR Decode(TLV::TLVReader & reader); + chip::CharSpan languageCode; + Optional> characteristics; + uint8_t audioOutputIndex = static_cast(0); static constexpr bool kIsFabricScoped = false; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; }; -using DecodableType = Type; +struct DecodableType +{ +public: + chip::CharSpan languageCode; + Optional> characteristics; + uint8_t audioOutputIndex = static_cast(0); -} // namespace AdditionalInfoStruct -namespace ParameterStruct { + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace TrackPreferenceStruct +namespace PlaybackPreferencesStruct { enum class Fields : uint8_t { - kType = 0, - kValue = 1, - kExternalIDList = 2, + kPlaybackPosition = 0, + kTextTrack = 1, + kAudioTracks = 2, }; struct Type { public: - ParameterEnum type = static_cast(0); - chip::CharSpan value; - Optional> externalIDList; + uint64_t playbackPosition = static_cast(0); + Structs::TrackPreferenceStruct::Type textTrack; + Optional> audioTracks; static constexpr bool kIsFabricScoped = false; @@ -33237,26 +33983,82 @@ struct Type struct DecodableType { public: - ParameterEnum type = static_cast(0); - chip::CharSpan value; - Optional> externalIDList; + uint64_t playbackPosition = static_cast(0); + Structs::TrackPreferenceStruct::DecodableType textTrack; + Optional> audioTracks; CHIP_ERROR Decode(TLV::TLVReader & reader); static constexpr bool kIsFabricScoped = false; }; -} // namespace ParameterStruct -namespace ContentSearchStruct { +} // namespace PlaybackPreferencesStruct +namespace AdditionalInfoStruct { enum class Fields : uint8_t { - kParameterList = 0, + kName = 0, + kValue = 1, }; struct Type { public: - DataModel::List parameterList; + chip::CharSpan name; + chip::CharSpan value; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace AdditionalInfoStruct +namespace ParameterStruct { +enum class Fields : uint8_t +{ + kType = 0, + kValue = 1, + kExternalIDList = 2, +}; + +struct Type +{ +public: + ParameterEnum type = static_cast(0); + chip::CharSpan value; + Optional> externalIDList; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + ParameterEnum type = static_cast(0); + chip::CharSpan value; + Optional> externalIDList; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace ParameterStruct +namespace ContentSearchStruct { +enum class Fields : uint8_t +{ + kParameterList = 0, +}; + +struct Type +{ +public: + DataModel::List parameterList; static constexpr bool kIsFabricScoped = false; @@ -33356,9 +34158,11 @@ namespace Commands { namespace LaunchContent { enum class Fields : uint8_t { - kSearch = 0, - kAutoPlay = 1, - kData = 2, + kSearch = 0, + kAutoPlay = 1, + kData = 2, + kPlaybackPreferences = 3, + kUseCurrentContext = 4, }; struct Type @@ -33371,6 +34175,8 @@ struct Type Structs::ContentSearchStruct::Type search; bool autoPlay = static_cast(0); Optional data; + Optional playbackPreferences; + Optional useCurrentContext; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -33388,6 +34194,8 @@ struct DecodableType Structs::ContentSearchStruct::DecodableType search; bool autoPlay = static_cast(0); Optional data; + Optional playbackPreferences; + Optional useCurrentContext; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace LaunchContent @@ -34291,6 +35099,7 @@ enum class Fields : uint8_t { kTempAccountIdentifier = 0, kSetupPIN = 1, + kNode = 2, }; struct Type @@ -34302,6 +35111,7 @@ struct Type chip::CharSpan tempAccountIdentifier; chip::CharSpan setupPIN; + Optional node; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -34318,12 +35128,14 @@ struct DecodableType chip::CharSpan tempAccountIdentifier; chip::CharSpan setupPIN; + Optional node; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace Login namespace Logout { enum class Fields : uint8_t { + kNode = 0, }; struct Type @@ -34333,6 +35145,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::Logout::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } + Optional node; + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; using ResponseType = DataModel::NullObjectType; @@ -34346,6 +35160,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::Logout::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } + Optional node; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace Logout @@ -34407,7 +35222,817 @@ struct TypeInfo }; }; } // namespace Attributes +namespace Events { +namespace LoggedOut { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; + +enum class Fields : uint8_t +{ + kNode = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::LoggedOut::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } + static constexpr bool kIsFabricScoped = false; + + Optional node; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::LoggedOut::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } + + Optional node; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace LoggedOut +} // namespace Events } // namespace AccountLogin +namespace ContentControl { +namespace Structs { +namespace RatingNameStruct { +enum class Fields : uint8_t +{ + kRatingName = 0, + kRatingNameDesc = 1, +}; + +struct Type +{ +public: + chip::CharSpan ratingName; + Optional ratingNameDesc; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace RatingNameStruct +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace UpdatePIN { +struct Type; +struct DecodableType; +} // namespace UpdatePIN + +namespace ResetPIN { +struct Type; +struct DecodableType; +} // namespace ResetPIN + +namespace ResetPINResponse { +struct Type; +struct DecodableType; +} // namespace ResetPINResponse + +namespace Enable { +struct Type; +struct DecodableType; +} // namespace Enable + +namespace Disable { +struct Type; +struct DecodableType; +} // namespace Disable + +namespace AddBonusTime { +struct Type; +struct DecodableType; +} // namespace AddBonusTime + +namespace SetScreenDailyTime { +struct Type; +struct DecodableType; +} // namespace SetScreenDailyTime + +namespace BlockUnratedContent { +struct Type; +struct DecodableType; +} // namespace BlockUnratedContent + +namespace UnblockUnratedContent { +struct Type; +struct DecodableType; +} // namespace UnblockUnratedContent + +namespace SetOnDemandRatingThreshold { +struct Type; +struct DecodableType; +} // namespace SetOnDemandRatingThreshold + +namespace SetScheduledContentRatingThreshold { +struct Type; +struct DecodableType; +} // namespace SetScheduledContentRatingThreshold + +} // namespace Commands + +namespace Commands { +namespace UpdatePIN { +enum class Fields : uint8_t +{ + kOldPIN = 0, + kNewPIN = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::UpdatePIN::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + Optional oldPIN; + chip::CharSpan newPIN; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::UpdatePIN::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + Optional oldPIN; + chip::CharSpan newPIN; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace UpdatePIN +namespace ResetPIN { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ResetPIN::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::ContentControl::Commands::ResetPINResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ResetPIN::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ResetPIN +namespace ResetPINResponse { +enum class Fields : uint8_t +{ + kPINCode = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ResetPINResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + chip::CharSpan PINCode; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ResetPINResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + chip::CharSpan PINCode; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ResetPINResponse +namespace Enable { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Enable::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Enable::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Enable +namespace Disable { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Disable::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Disable::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Disable +namespace AddBonusTime { +enum class Fields : uint8_t +{ + kPINCode = 0, + kBonusTime = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AddBonusTime::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + Optional PINCode; + Optional bonusTime; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AddBonusTime::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + Optional PINCode; + Optional bonusTime; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AddBonusTime +namespace SetScreenDailyTime { +enum class Fields : uint8_t +{ + kScreenTime = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetScreenDailyTime::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + uint32_t screenTime = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetScreenDailyTime::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + uint32_t screenTime = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetScreenDailyTime +namespace BlockUnratedContent { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::BlockUnratedContent::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::BlockUnratedContent::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace BlockUnratedContent +namespace UnblockUnratedContent { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::UnblockUnratedContent::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::UnblockUnratedContent::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace UnblockUnratedContent +namespace SetOnDemandRatingThreshold { +enum class Fields : uint8_t +{ + kRating = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetOnDemandRatingThreshold::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + chip::CharSpan rating; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetOnDemandRatingThreshold::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + chip::CharSpan rating; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetOnDemandRatingThreshold +namespace SetScheduledContentRatingThreshold { +enum class Fields : uint8_t +{ + kRating = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetScheduledContentRatingThreshold::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + chip::CharSpan rating; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetScheduledContentRatingThreshold::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + chip::CharSpan rating; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetScheduledContentRatingThreshold +} // namespace Commands + +namespace Attributes { + +namespace Enabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Enabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Enabled +namespace OnDemandRatings { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OnDemandRatings::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OnDemandRatings +namespace OnDemandRatingThreshold { +struct TypeInfo +{ + using Type = chip::CharSpan; + using DecodableType = chip::CharSpan; + using DecodableArgType = chip::CharSpan; + + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OnDemandRatingThreshold::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 8; } +}; +} // namespace OnDemandRatingThreshold +namespace ScheduledContentRatings { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ScheduledContentRatings::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ScheduledContentRatings +namespace ScheduledContentRatingThreshold { +struct TypeInfo +{ + using Type = chip::CharSpan; + using DecodableType = chip::CharSpan; + using DecodableArgType = chip::CharSpan; + + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ScheduledContentRatingThreshold::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 8; } +}; +} // namespace ScheduledContentRatingThreshold +namespace ScreenDailyTime { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ScreenDailyTime::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ScreenDailyTime +namespace RemainingScreenTime { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::RemainingScreenTime::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace RemainingScreenTime +namespace BlockUnrated { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::BlockUnrated::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace BlockUnrated +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::Enabled::TypeInfo::DecodableType enabled = static_cast(0); + Attributes::OnDemandRatings::TypeInfo::DecodableType onDemandRatings; + Attributes::OnDemandRatingThreshold::TypeInfo::DecodableType onDemandRatingThreshold; + Attributes::ScheduledContentRatings::TypeInfo::DecodableType scheduledContentRatings; + Attributes::ScheduledContentRatingThreshold::TypeInfo::DecodableType scheduledContentRatingThreshold; + Attributes::ScreenDailyTime::TypeInfo::DecodableType screenDailyTime = static_cast(0); + Attributes::RemainingScreenTime::TypeInfo::DecodableType remainingScreenTime = static_cast(0); + Attributes::BlockUnrated::TypeInfo::DecodableType blockUnrated = static_cast(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +namespace Events { +namespace RemainingScreenTimeExpired { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::RemainingScreenTimeExpired::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::RemainingScreenTimeExpired::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentControl::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace RemainingScreenTimeExpired +} // namespace Events +} // namespace ContentControl +namespace ContentAppObserver { + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace ContentAppMessage { +struct Type; +struct DecodableType; +} // namespace ContentAppMessage + +namespace ContentAppMessageResponse { +struct Type; +struct DecodableType; +} // namespace ContentAppMessageResponse + +} // namespace Commands + +namespace Commands { +namespace ContentAppMessage { +enum class Fields : uint8_t +{ + kData = 0, + kEncodingHint = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ContentAppMessage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } + + Optional data; + chip::CharSpan encodingHint; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ContentAppMessage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } + + Optional data; + chip::CharSpan encodingHint; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ContentAppMessage +namespace ContentAppMessageResponse { +enum class Fields : uint8_t +{ + kStatus = 0, + kData = 1, + kEncodingHint = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ContentAppMessageResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } + + Optional status; + chip::CharSpan data; + chip::CharSpan encodingHint; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ContentAppMessageResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } + + Optional status; + chip::CharSpan data; + chip::CharSpan encodingHint; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ContentAppMessageResponse +} // namespace Commands + +namespace Attributes { + +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::ContentAppObserver::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace ContentAppObserver namespace ElectricalMeasurement { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 4999209762972f..87714609e2a5b5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -6196,6 +6196,22 @@ namespace SeekRangeStart { static constexpr AttributeId Id = 0x00000006; } // namespace SeekRangeStart +namespace ActiveAudioTrack { +static constexpr AttributeId Id = 0x00000007; +} // namespace ActiveAudioTrack + +namespace AvailableAudioTracks { +static constexpr AttributeId Id = 0x00000008; +} // namespace AvailableAudioTracks + +namespace ActiveTextTrack { +static constexpr AttributeId Id = 0x00000009; +} // namespace ActiveTextTrack + +namespace AvailableTextTracks { +static constexpr AttributeId Id = 0x0000000A; +} // namespace AvailableTextTracks + namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; } // namespace GeneratedCommandList @@ -6527,6 +6543,98 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace AccountLogin +namespace ContentControl { +namespace Attributes { + +namespace Enabled { +static constexpr AttributeId Id = 0x00000000; +} // namespace Enabled + +namespace OnDemandRatings { +static constexpr AttributeId Id = 0x00000001; +} // namespace OnDemandRatings + +namespace OnDemandRatingThreshold { +static constexpr AttributeId Id = 0x00000002; +} // namespace OnDemandRatingThreshold + +namespace ScheduledContentRatings { +static constexpr AttributeId Id = 0x00000003; +} // namespace ScheduledContentRatings + +namespace ScheduledContentRatingThreshold { +static constexpr AttributeId Id = 0x00000004; +} // namespace ScheduledContentRatingThreshold + +namespace ScreenDailyTime { +static constexpr AttributeId Id = 0x00000005; +} // namespace ScreenDailyTime + +namespace RemainingScreenTime { +static constexpr AttributeId Id = 0x00000006; +} // namespace RemainingScreenTime + +namespace BlockUnrated { +static constexpr AttributeId Id = 0x00000007; +} // namespace BlockUnrated + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ContentControl + +namespace ContentAppObserver { +namespace Attributes { + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ContentAppObserver + namespace ElectricalMeasurement { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 9a1d55e2371d81..229911e96755b4 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -337,6 +337,12 @@ static constexpr ClusterId Id = 0x0000050D; namespace AccountLogin { static constexpr ClusterId Id = 0x0000050E; } // namespace AccountLogin +namespace ContentControl { +static constexpr ClusterId Id = 0x0000050F; +} // namespace ContentControl +namespace ContentAppObserver { +static constexpr ClusterId Id = 0x00000510; +} // namespace ContentAppObserver namespace ElectricalMeasurement { static constexpr ClusterId Id = 0x00000B04; } // namespace ElectricalMeasurement diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 2f01ca9dd5b428..963edaddc0cbea 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1296,6 +1296,22 @@ namespace SkipChannel { static constexpr CommandId Id = 0x00000003; } // namespace SkipChannel +namespace GetProgramGuide { +static constexpr CommandId Id = 0x00000004; +} // namespace GetProgramGuide + +namespace ProgramGuideResponse { +static constexpr CommandId Id = 0x00000005; +} // namespace ProgramGuideResponse + +namespace RecordProgram { +static constexpr CommandId Id = 0x00000006; +} // namespace RecordProgram + +namespace CancelRecordProgram { +static constexpr CommandId Id = 0x00000007; +} // namespace CancelRecordProgram + } // namespace Commands } // namespace Channel @@ -1364,6 +1380,18 @@ namespace Seek { static constexpr CommandId Id = 0x0000000B; } // namespace Seek +namespace ActivateAudioTrack { +static constexpr CommandId Id = 0x0000000C; +} // namespace ActivateAudioTrack + +namespace ActivateTextTrack { +static constexpr CommandId Id = 0x0000000D; +} // namespace ActivateTextTrack + +namespace DeactivateTextTrack { +static constexpr CommandId Id = 0x0000000E; +} // namespace DeactivateTextTrack + } // namespace Commands } // namespace MediaPlayback @@ -1489,6 +1517,70 @@ static constexpr CommandId Id = 0x00000003; } // namespace Commands } // namespace AccountLogin +namespace ContentControl { +namespace Commands { + +namespace UpdatePIN { +static constexpr CommandId Id = 0x00000000; +} // namespace UpdatePIN + +namespace ResetPIN { +static constexpr CommandId Id = 0x00000001; +} // namespace ResetPIN + +namespace ResetPINResponse { +static constexpr CommandId Id = 0x00000002; +} // namespace ResetPINResponse + +namespace Enable { +static constexpr CommandId Id = 0x00000003; +} // namespace Enable + +namespace Disable { +static constexpr CommandId Id = 0x00000004; +} // namespace Disable + +namespace AddBonusTime { +static constexpr CommandId Id = 0x00000005; +} // namespace AddBonusTime + +namespace SetScreenDailyTime { +static constexpr CommandId Id = 0x00000006; +} // namespace SetScreenDailyTime + +namespace BlockUnratedContent { +static constexpr CommandId Id = 0x00000007; +} // namespace BlockUnratedContent + +namespace UnblockUnratedContent { +static constexpr CommandId Id = 0x00000008; +} // namespace UnblockUnratedContent + +namespace SetOnDemandRatingThreshold { +static constexpr CommandId Id = 0x00000009; +} // namespace SetOnDemandRatingThreshold + +namespace SetScheduledContentRatingThreshold { +static constexpr CommandId Id = 0x0000000A; +} // namespace SetScheduledContentRatingThreshold + +} // namespace Commands +} // namespace ContentControl + +namespace ContentAppObserver { +namespace Commands { + +namespace ContentAppMessage { +static constexpr CommandId Id = 0x00000000; +} // namespace ContentAppMessage + +namespace ContentAppMessageResponse { +static constexpr CommandId Id = 0x00000001; +} // namespace ContentAppMessageResponse + +} // namespace Commands +} // namespace ContentAppObserver + namespace ElectricalMeasurement { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index e598cd11e55bc7..73fa8af3d826fb 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -547,6 +547,46 @@ static constexpr EventId Id = 0x00000010; } // namespace Events } // namespace PumpConfigurationAndControl +namespace TargetNavigator { +namespace Events { + +namespace TargetUpdated { +static constexpr EventId Id = 0x00000000; +} // namespace TargetUpdated + +} // namespace Events +} // namespace TargetNavigator + +namespace MediaPlayback { +namespace Events { + +namespace StateChanged { +static constexpr EventId Id = 0x00000000; +} // namespace StateChanged + +} // namespace Events +} // namespace MediaPlayback + +namespace AccountLogin { +namespace Events { + +namespace LoggedOut { +static constexpr EventId Id = 0x00000000; +} // namespace LoggedOut + +} // namespace Events +} // namespace AccountLogin + +namespace ContentControl { +namespace Events { + +namespace RemainingScreenTimeExpired { +static constexpr EventId Id = 0x00000000; +} // namespace RemainingScreenTimeExpired + +} // namespace Events +} // namespace ContentControl + namespace UnitTesting { namespace Events { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index 8e3daedd46a4cb..25ed613bcf34a5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -707,6 +707,18 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_CONTENT_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_CONTENT_CONTROL_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_CONTENT_CONTROL_CLUSTER { chip::app::Clusters::ContentControl::Id, "Content Control" }, +#else +#define CHIP_PRINTCLUSTER_CONTENT_CONTROL_CLUSTER +#endif + +#if defined(ZCL_USING_CONTENT_APP_OBSERVER_CLUSTER_SERVER) || defined(ZCL_USING_CONTENT_APP_OBSERVER_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_CONTENT_APP_OBSERVER_CLUSTER { chip::app::Clusters::ContentAppObserver::Id, "Content App Observer" }, +#else +#define CHIP_PRINTCLUSTER_CONTENT_APP_OBSERVER_CLUSTER +#endif + #if defined(ZCL_USING_ELECTRICAL_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_ELECTRICAL_MEASUREMENT_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ { chip::app::Clusters::ElectricalMeasurement::Id, "Electrical Measurement" }, @@ -837,6 +849,8 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_CONTENT_CONTROL_CLUSTER \ + CHIP_PRINTCLUSTER_CONTENT_APP_OBSERVER_CLUSTER \ CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER \ CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 610e325a4e7dfa..e872590aac7742 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -138,6 +138,8 @@ | ApplicationLauncher | 0x050C | | ApplicationBasic | 0x050D | | AccountLogin | 0x050E | +| ContentControl | 0x050F | +| ContentAppObserver | 0x0510 | | ElectricalMeasurement | 0x0B04 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| @@ -10056,6 +10058,9 @@ class ColorControlStepColorTemperature : public ClusterCommand | * ChangeChannel | 0x00 | | * ChangeChannelByNumber | 0x02 | | * SkipChannel | 0x03 | +| * GetProgramGuide | 0x04 | +| * RecordProgram | 0x06 | +| * CancelRecordProgram | 0x07 | |------------------------------------------------------------------------------| | Attributes: | | | * ChannelList | 0x0000 | @@ -10184,6 +10189,144 @@ class ChannelSkipChannel : public ClusterCommand chip::app::Clusters::Channel::Commands::SkipChannel::Type mRequest; }; +/* + * Command GetProgramGuide + */ +class ChannelGetProgramGuide : public ClusterCommand +{ +public: + ChannelGetProgramGuide(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("get-program-guide", credsIssuerConfig), mComplex_ChannelList(&mRequest.channelList), + mComplex_PageToken(&mRequest.pageToken), mComplex_ExternalIDList(&mRequest.externalIDList) + { + AddArgument("StartTime", 0, UINT32_MAX, &mRequest.startTime); + AddArgument("EndTime", 0, UINT32_MAX, &mRequest.endTime); + AddArgument("ChannelList", &mComplex_ChannelList); + AddArgument("PageToken", &mComplex_PageToken); + AddArgument("RecordingFlag", 0, UINT32_MAX, &mRequest.recordingFlag); + AddArgument("ExternalIDList", &mComplex_ExternalIDList); + AddArgument("Data", &mRequest.data); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Channel::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Channel::Commands::GetProgramGuide::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Channel::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Channel::Commands::GetProgramGuide::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::Channel::Commands::GetProgramGuide::Type mRequest; + TypedComplexArgument< + chip::Optional>> + mComplex_ChannelList; + TypedComplexArgument> mComplex_PageToken; + TypedComplexArgument< + chip::Optional>> + mComplex_ExternalIDList; +}; + +/* + * Command RecordProgram + */ +class ChannelRecordProgram : public ClusterCommand +{ +public: + ChannelRecordProgram(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("record-program", credsIssuerConfig), mComplex_ExternalIDList(&mRequest.externalIDList) + { + AddArgument("ProgramIdentifier", &mRequest.programIdentifier); + AddArgument("ShouldRecordSeries", 0, 1, &mRequest.shouldRecordSeries); + AddArgument("ExternalIDList", &mComplex_ExternalIDList); + AddArgument("Data", &mRequest.data); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Channel::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Channel::Commands::RecordProgram::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Channel::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Channel::Commands::RecordProgram::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::Channel::Commands::RecordProgram::Type mRequest; + TypedComplexArgument> + mComplex_ExternalIDList; +}; + +/* + * Command CancelRecordProgram + */ +class ChannelCancelRecordProgram : public ClusterCommand +{ +public: + ChannelCancelRecordProgram(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("cancel-record-program", credsIssuerConfig), mComplex_ExternalIDList(&mRequest.externalIDList) + { + AddArgument("ProgramIdentifier", &mRequest.programIdentifier); + AddArgument("ShouldRecordSeries", 0, 1, &mRequest.shouldRecordSeries); + AddArgument("ExternalIDList", &mComplex_ExternalIDList); + AddArgument("Data", &mRequest.data); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Channel::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Channel::Commands::CancelRecordProgram::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Channel::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Channel::Commands::CancelRecordProgram::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::Channel::Commands::CancelRecordProgram::Type mRequest; + TypedComplexArgument> + mComplex_ExternalIDList; +}; + /*----------------------------------------------------------------------------*\ | Cluster TargetNavigator | 0x0505 | |------------------------------------------------------------------------------| @@ -10201,6 +10344,7 @@ class ChannelSkipChannel : public ClusterCommand | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * TargetUpdated | 0x0000 | \*----------------------------------------------------------------------------*/ /* @@ -10257,6 +10401,9 @@ class TargetNavigatorNavigateTarget : public ClusterCommand | * SkipForward | 0x08 | | * SkipBackward | 0x09 | | * Seek | 0x0B | +| * ActivateAudioTrack | 0x0C | +| * ActivateTextTrack | 0x0D | +| * DeactivateTextTrack | 0x0E | |------------------------------------------------------------------------------| | Attributes: | | | * CurrentState | 0x0000 | @@ -10266,6 +10413,10 @@ class TargetNavigatorNavigateTarget : public ClusterCommand | * PlaybackSpeed | 0x0004 | | * SeekRangeEnd | 0x0005 | | * SeekRangeStart | 0x0006 | +| * ActiveAudioTrack | 0x0007 | +| * AvailableAudioTracks | 0x0008 | +| * ActiveTextTrack | 0x0009 | +| * AvailableTextTracks | 0x000A | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -10274,6 +10425,7 @@ class TargetNavigatorNavigateTarget : public ClusterCommand | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * StateChanged | 0x0000 | \*----------------------------------------------------------------------------*/ /* @@ -10500,6 +10652,7 @@ class MediaPlaybackRewind : public ClusterCommand public: MediaPlaybackRewind(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("rewind", credsIssuerConfig) { + AddArgument("AudioAdvanceUnmuted", 0, 1, &mRequest.audioAdvanceUnmuted); ClusterCommand::AddArguments(); } @@ -10536,6 +10689,7 @@ class MediaPlaybackFastForward : public ClusterCommand public: MediaPlaybackFastForward(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("fast-forward", credsIssuerConfig) { + AddArgument("AudioAdvanceUnmuted", 0, 1, &mRequest.audioAdvanceUnmuted); ClusterCommand::AddArguments(); } @@ -10675,6 +10829,120 @@ class MediaPlaybackSeek : public ClusterCommand chip::app::Clusters::MediaPlayback::Commands::Seek::Type mRequest; }; +/* + * Command ActivateAudioTrack + */ +class MediaPlaybackActivateAudioTrack : public ClusterCommand +{ +public: + MediaPlaybackActivateAudioTrack(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("activate-audio-track", credsIssuerConfig) + { + AddArgument("TrackID", &mRequest.trackID); + AddArgument("AudioOutputIndex", 0, UINT8_MAX, &mRequest.audioOutputIndex); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Type mRequest; +}; + +/* + * Command ActivateTextTrack + */ +class MediaPlaybackActivateTextTrack : public ClusterCommand +{ +public: + MediaPlaybackActivateTextTrack(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("activate-text-track", credsIssuerConfig) + { + AddArgument("TrackID", &mRequest.trackID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Type mRequest; +}; + +/* + * Command DeactivateTextTrack + */ +class MediaPlaybackDeactivateTextTrack : public ClusterCommand +{ +public: + MediaPlaybackDeactivateTextTrack(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("deactivate-text-track", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster MediaInput | 0x0507 | |------------------------------------------------------------------------------| @@ -10978,11 +11246,14 @@ class ContentLauncherLaunchContent : public ClusterCommand { public: ContentLauncherLaunchContent(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("launch-content", credsIssuerConfig), mComplex_Search(&mRequest.search) + ClusterCommand("launch-content", credsIssuerConfig), mComplex_Search(&mRequest.search), + mComplex_PlaybackPreferences(&mRequest.playbackPreferences) { AddArgument("Search", &mComplex_Search); AddArgument("AutoPlay", 0, 1, &mRequest.autoPlay); AddArgument("Data", &mRequest.data); + AddArgument("PlaybackPreferences", &mComplex_PlaybackPreferences); + AddArgument("UseCurrentContext", 0, 1, &mRequest.useCurrentContext); ClusterCommand::AddArguments(); } @@ -11010,6 +11281,8 @@ class ContentLauncherLaunchContent : public ClusterCommand private: chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type mRequest; TypedComplexArgument mComplex_Search; + TypedComplexArgument> + mComplex_PlaybackPreferences; }; /* @@ -11171,23 +11444,519 @@ class AudioOutputRenameOutput : public ClusterCommand \*----------------------------------------------------------------------------*/ /* - * Command LaunchApp + * Command LaunchApp + */ +class ApplicationLauncherLaunchApp : public ClusterCommand +{ +public: + ApplicationLauncherLaunchApp(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("launch-app", credsIssuerConfig), mComplex_Application(&mRequest.application) + { + AddArgument("Application", &mComplex_Application); + AddArgument("Data", &mRequest.data); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type mRequest; + TypedComplexArgument> + mComplex_Application; +}; + +/* + * Command StopApp + */ +class ApplicationLauncherStopApp : public ClusterCommand +{ +public: + ApplicationLauncherStopApp(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("stop-app", credsIssuerConfig), mComplex_Application(&mRequest.application) + { + AddArgument("Application", &mComplex_Application); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type mRequest; + TypedComplexArgument> + mComplex_Application; +}; + +/* + * Command HideApp + */ +class ApplicationLauncherHideApp : public ClusterCommand +{ +public: + ApplicationLauncherHideApp(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("hide-app", credsIssuerConfig), mComplex_Application(&mRequest.application) + { + AddArgument("Application", &mComplex_Application); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type mRequest; + TypedComplexArgument> + mComplex_Application; +}; + +/*----------------------------------------------------------------------------*\ +| Cluster ApplicationBasic | 0x050D | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * VendorName | 0x0000 | +| * VendorID | 0x0001 | +| * ApplicationName | 0x0002 | +| * ProductID | 0x0003 | +| * Application | 0x0004 | +| * Status | 0x0005 | +| * ApplicationVersion | 0x0006 | +| * AllowedVendorList | 0x0007 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*\ +| Cluster AccountLogin | 0x050E | +|------------------------------------------------------------------------------| +| Commands: | | +| * GetSetupPIN | 0x00 | +| * Login | 0x02 | +| * Logout | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * LoggedOut | 0x0000 | +\*----------------------------------------------------------------------------*/ + +/* + * Command GetSetupPIN + */ +class AccountLoginGetSetupPIN : public ClusterCommand +{ +public: + AccountLoginGetSetupPIN(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("get-setup-pin", credsIssuerConfig) + { + AddArgument("TempAccountIdentifier", &mRequest.tempAccountIdentifier); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type mRequest; +}; + +/* + * Command Login + */ +class AccountLoginLogin : public ClusterCommand +{ +public: + AccountLoginLogin(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("login", credsIssuerConfig) + { + AddArgument("TempAccountIdentifier", &mRequest.tempAccountIdentifier); + AddArgument("SetupPIN", &mRequest.setupPIN); + AddArgument("Node", 0, UINT64_MAX, &mRequest.node); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::Login::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::Login::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::AccountLogin::Commands::Login::Type mRequest; +}; + +/* + * Command Logout + */ +class AccountLoginLogout : public ClusterCommand +{ +public: + AccountLoginLogout(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("logout", credsIssuerConfig) + { + AddArgument("Node", 0, UINT64_MAX, &mRequest.node); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::Logout::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::Logout::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::AccountLogin::Commands::Logout::Type mRequest; +}; + +/*----------------------------------------------------------------------------*\ +| Cluster ContentControl | 0x050F | +|------------------------------------------------------------------------------| +| Commands: | | +| * UpdatePIN | 0x00 | +| * ResetPIN | 0x01 | +| * Enable | 0x03 | +| * Disable | 0x04 | +| * AddBonusTime | 0x05 | +| * SetScreenDailyTime | 0x06 | +| * BlockUnratedContent | 0x07 | +| * UnblockUnratedContent | 0x08 | +| * SetOnDemandRatingThreshold | 0x09 | +| * SetScheduledContentRatingThreshold | 0x0A | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Enabled | 0x0000 | +| * OnDemandRatings | 0x0001 | +| * OnDemandRatingThreshold | 0x0002 | +| * ScheduledContentRatings | 0x0003 | +| * ScheduledContentRatingThreshold | 0x0004 | +| * ScreenDailyTime | 0x0005 | +| * RemainingScreenTime | 0x0006 | +| * BlockUnrated | 0x0007 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * RemainingScreenTimeExpired | 0x0000 | +\*----------------------------------------------------------------------------*/ + +/* + * Command UpdatePIN + */ +class ContentControlUpdatePIN : public ClusterCommand +{ +public: + ContentControlUpdatePIN(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("update-pin", credsIssuerConfig) + { + AddArgument("OldPIN", &mRequest.oldPIN); + AddArgument("NewPIN", &mRequest.newPIN); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::UpdatePIN::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::UpdatePIN::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ContentControl::Commands::UpdatePIN::Type mRequest; +}; + +/* + * Command ResetPIN + */ +class ContentControlResetPIN : public ClusterCommand +{ +public: + ContentControlResetPIN(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("reset-pin", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::ResetPIN::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::ResetPIN::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ContentControl::Commands::ResetPIN::Type mRequest; +}; + +/* + * Command Enable + */ +class ContentControlEnable : public ClusterCommand +{ +public: + ContentControlEnable(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("enable", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::Enable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::Enable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ContentControl::Commands::Enable::Type mRequest; +}; + +/* + * Command Disable + */ +class ContentControlDisable : public ClusterCommand +{ +public: + ContentControlDisable(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("disable", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::Disable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::Disable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ContentControl::Commands::Disable::Type mRequest; +}; + +/* + * Command AddBonusTime + */ +class ContentControlAddBonusTime : public ClusterCommand +{ +public: + ContentControlAddBonusTime(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("add-bonus-time", credsIssuerConfig) + { + AddArgument("PINCode", &mRequest.PINCode); + AddArgument("BonusTime", 0, UINT32_MAX, &mRequest.bonusTime); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::AddBonusTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::AddBonusTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ContentControl::Commands::AddBonusTime::Type mRequest; +}; + +/* + * Command SetScreenDailyTime */ -class ApplicationLauncherLaunchApp : public ClusterCommand +class ContentControlSetScreenDailyTime : public ClusterCommand { public: - ApplicationLauncherLaunchApp(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("launch-app", credsIssuerConfig), mComplex_Application(&mRequest.application) + ContentControlSetScreenDailyTime(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-screen-daily-time", credsIssuerConfig) { - AddArgument("Application", &mComplex_Application); - AddArgument("Data", &mRequest.data); + AddArgument("ScreenTime", 0, UINT32_MAX, &mRequest.screenTime); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::SetScreenDailyTime::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -11196,8 +11965,8 @@ class ApplicationLauncherLaunchApp : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::SetScreenDailyTime::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -11206,28 +11975,25 @@ class ApplicationLauncherLaunchApp : public ClusterCommand } private: - chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type mRequest; - TypedComplexArgument> - mComplex_Application; + chip::app::Clusters::ContentControl::Commands::SetScreenDailyTime::Type mRequest; }; /* - * Command StopApp + * Command BlockUnratedContent */ -class ApplicationLauncherStopApp : public ClusterCommand +class ContentControlBlockUnratedContent : public ClusterCommand { public: - ApplicationLauncherStopApp(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("stop-app", credsIssuerConfig), mComplex_Application(&mRequest.application) + ContentControlBlockUnratedContent(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("block-unrated-content", credsIssuerConfig) { - AddArgument("Application", &mComplex_Application); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::BlockUnratedContent::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -11236,8 +12002,8 @@ class ApplicationLauncherStopApp : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::BlockUnratedContent::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -11246,28 +12012,25 @@ class ApplicationLauncherStopApp : public ClusterCommand } private: - chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type mRequest; - TypedComplexArgument> - mComplex_Application; + chip::app::Clusters::ContentControl::Commands::BlockUnratedContent::Type mRequest; }; /* - * Command HideApp + * Command UnblockUnratedContent */ -class ApplicationLauncherHideApp : public ClusterCommand +class ContentControlUnblockUnratedContent : public ClusterCommand { public: - ApplicationLauncherHideApp(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("hide-app", credsIssuerConfig), mComplex_Application(&mRequest.application) + ContentControlUnblockUnratedContent(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("unblock-unrated-content", credsIssuerConfig) { - AddArgument("Application", &mComplex_Application); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::UnblockUnratedContent::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -11276,8 +12039,8 @@ class ApplicationLauncherHideApp : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ApplicationLauncher::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::UnblockUnratedContent::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -11286,70 +12049,26 @@ class ApplicationLauncherHideApp : public ClusterCommand } private: - chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type mRequest; - TypedComplexArgument> - mComplex_Application; + chip::app::Clusters::ContentControl::Commands::UnblockUnratedContent::Type mRequest; }; -/*----------------------------------------------------------------------------*\ -| Cluster ApplicationBasic | 0x050D | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * VendorName | 0x0000 | -| * VendorID | 0x0001 | -| * ApplicationName | 0x0002 | -| * ProductID | 0x0003 | -| * Application | 0x0004 | -| * Status | 0x0005 | -| * ApplicationVersion | 0x0006 | -| * AllowedVendorList | 0x0007 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * EventList | 0xFFFA | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------------*\ -| Cluster AccountLogin | 0x050E | -|------------------------------------------------------------------------------| -| Commands: | | -| * GetSetupPIN | 0x00 | -| * Login | 0x02 | -| * Logout | 0x03 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * EventList | 0xFFFA | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command GetSetupPIN + * Command SetOnDemandRatingThreshold */ -class AccountLoginGetSetupPIN : public ClusterCommand +class ContentControlSetOnDemandRatingThreshold : public ClusterCommand { public: - AccountLoginGetSetupPIN(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("get-setup-pin", credsIssuerConfig) + ContentControlSetOnDemandRatingThreshold(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-on-demand-rating-threshold", credsIssuerConfig) { - AddArgument("TempAccountIdentifier", &mRequest.tempAccountIdentifier); + AddArgument("Rating", &mRequest.rating); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::SetOnDemandRatingThreshold::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -11358,8 +12077,8 @@ class AccountLoginGetSetupPIN : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::SetOnDemandRatingThreshold::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -11368,26 +12087,26 @@ class AccountLoginGetSetupPIN : public ClusterCommand } private: - chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type mRequest; + chip::app::Clusters::ContentControl::Commands::SetOnDemandRatingThreshold::Type mRequest; }; /* - * Command Login + * Command SetScheduledContentRatingThreshold */ -class AccountLoginLogin : public ClusterCommand +class ContentControlSetScheduledContentRatingThreshold : public ClusterCommand { public: - AccountLoginLogin(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("login", credsIssuerConfig) + ContentControlSetScheduledContentRatingThreshold(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-scheduled-content-rating-threshold", credsIssuerConfig) { - AddArgument("TempAccountIdentifier", &mRequest.tempAccountIdentifier); - AddArgument("SetupPIN", &mRequest.setupPIN); + AddArgument("Rating", &mRequest.rating); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::Login::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::SetScheduledContentRatingThreshold::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -11396,8 +12115,8 @@ class AccountLoginLogin : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::Login::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::SetScheduledContentRatingThreshold::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -11406,24 +12125,44 @@ class AccountLoginLogin : public ClusterCommand } private: - chip::app::Clusters::AccountLogin::Commands::Login::Type mRequest; + chip::app::Clusters::ContentControl::Commands::SetScheduledContentRatingThreshold::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster ContentAppObserver | 0x0510 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ContentAppMessage | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Command Logout + * Command ContentAppMessage */ -class AccountLoginLogout : public ClusterCommand +class ContentAppObserverContentAppMessage : public ClusterCommand { public: - AccountLoginLogout(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("logout", credsIssuerConfig) + ContentAppObserverContentAppMessage(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("content-app-message", credsIssuerConfig) { + AddArgument("Data", &mRequest.data); + AddArgument("EncodingHint", &mRequest.encodingHint); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::Logout::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -11432,8 +12171,8 @@ class AccountLoginLogout : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::AccountLogin::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::AccountLogin::Commands::Logout::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -11442,7 +12181,7 @@ class AccountLoginLogout : public ClusterCommand } private: - chip::app::Clusters::AccountLogin::Commands::Logout::Type mRequest; + chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Type mRequest; }; /*----------------------------------------------------------------------------*\ @@ -21879,6 +22618,9 @@ void registerClusterChannel(Commands & commands, CredentialIssuerCommands * cred make_unique(credsIssuerConfig), // make_unique(credsIssuerConfig), // make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // @@ -21989,8 +22731,10 @@ void registerClusterTargetNavigator(Commands & commands, CredentialIssuerCommand // // Events // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "target-updated", Events::TargetUpdated::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "target-updated", Events::TargetUpdated::Id, credsIssuerConfig), // }; commands.RegisterCluster(clusterName, clusterCommands); @@ -22005,18 +22749,21 @@ void registerClusterMediaPlayback(Commands & commands, CredentialIssuerCommands // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // @@ -22028,6 +22775,10 @@ void registerClusterMediaPlayback(Commands & commands, CredentialIssuerCommands make_unique(Id, "playback-speed", Attributes::PlaybackSpeed::Id, credsIssuerConfig), // make_unique(Id, "seek-range-end", Attributes::SeekRangeEnd::Id, credsIssuerConfig), // make_unique(Id, "seek-range-start", Attributes::SeekRangeStart::Id, credsIssuerConfig), // + make_unique(Id, "active-audio-track", Attributes::ActiveAudioTrack::Id, credsIssuerConfig), // + make_unique(Id, "available-audio-tracks", Attributes::AvailableAudioTracks::Id, credsIssuerConfig), // + make_unique(Id, "active-text-track", Attributes::ActiveTextTrack::Id, credsIssuerConfig), // + make_unique(Id, "available-text-tracks", Attributes::AvailableTextTracks::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -22052,6 +22803,19 @@ void registerClusterMediaPlayback(Commands & commands, CredentialIssuerCommands make_unique>>(Id, "seek-range-start", 0, UINT64_MAX, Attributes::SeekRangeStart::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "active-audio-track", Attributes::ActiveAudioTrack::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>>( + Id, "available-audio-tracks", Attributes::AvailableAudioTracks::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "active-text-track", Attributes::ActiveTextTrack::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>>( + Id, "available-text-tracks", Attributes::AvailableTextTracks::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -22073,6 +22837,10 @@ void registerClusterMediaPlayback(Commands & commands, CredentialIssuerCommands make_unique(Id, "playback-speed", Attributes::PlaybackSpeed::Id, credsIssuerConfig), // make_unique(Id, "seek-range-end", Attributes::SeekRangeEnd::Id, credsIssuerConfig), // make_unique(Id, "seek-range-start", Attributes::SeekRangeStart::Id, credsIssuerConfig), // + make_unique(Id, "active-audio-track", Attributes::ActiveAudioTrack::Id, credsIssuerConfig), // + make_unique(Id, "available-audio-tracks", Attributes::AvailableAudioTracks::Id, credsIssuerConfig), // + make_unique(Id, "active-text-track", Attributes::ActiveTextTrack::Id, credsIssuerConfig), // + make_unique(Id, "available-text-tracks", Attributes::AvailableTextTracks::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -22082,8 +22850,10 @@ void registerClusterMediaPlayback(Commands & commands, CredentialIssuerCommands // // Events // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "state-changed", Events::StateChanged::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "state-changed", Events::StateChanged::Id, credsIssuerConfig), // }; commands.RegisterCluster(clusterName, clusterCommands); @@ -22576,6 +23346,164 @@ void registerClusterAccountLogin(Commands & commands, CredentialIssuerCommands * // // Events // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "logged-out", Events::LoggedOut::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "logged-out", Events::LoggedOut::Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} +void registerClusterContentControl(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::ContentControl; + + const char * clusterName = "ContentControl"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "enabled", Attributes::Enabled::Id, credsIssuerConfig), // + make_unique(Id, "on-demand-ratings", Attributes::OnDemandRatings::Id, credsIssuerConfig), // + make_unique(Id, "on-demand-rating-threshold", Attributes::OnDemandRatingThreshold::Id, credsIssuerConfig), // + make_unique(Id, "scheduled-content-ratings", Attributes::ScheduledContentRatings::Id, credsIssuerConfig), // + make_unique(Id, "scheduled-content-rating-threshold", Attributes::ScheduledContentRatingThreshold::Id, + credsIssuerConfig), // + make_unique(Id, "screen-daily-time", Attributes::ScreenDailyTime::Id, credsIssuerConfig), // + make_unique(Id, "remaining-screen-time", Attributes::RemainingScreenTime::Id, credsIssuerConfig), // + make_unique(Id, "block-unrated", Attributes::BlockUnrated::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>(Id, "enabled", 0, 1, Attributes::Enabled::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "on-demand-ratings", Attributes::OnDemandRatings::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "on-demand-rating-threshold", Attributes::OnDemandRatingThreshold::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "scheduled-content-ratings", Attributes::ScheduledContentRatings::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "scheduled-content-rating-threshold", + Attributes::ScheduledContentRatingThreshold::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "screen-daily-time", 0, UINT32_MAX, Attributes::ScreenDailyTime::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "remaining-screen-time", 0, UINT32_MAX, Attributes::RemainingScreenTime::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "block-unrated", 0, 1, Attributes::BlockUnrated::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "enabled", Attributes::Enabled::Id, credsIssuerConfig), // + make_unique(Id, "on-demand-ratings", Attributes::OnDemandRatings::Id, credsIssuerConfig), // + make_unique(Id, "on-demand-rating-threshold", Attributes::OnDemandRatingThreshold::Id, + credsIssuerConfig), // + make_unique(Id, "scheduled-content-ratings", Attributes::ScheduledContentRatings::Id, + credsIssuerConfig), // + make_unique(Id, "scheduled-content-rating-threshold", Attributes::ScheduledContentRatingThreshold::Id, + credsIssuerConfig), // + make_unique(Id, "screen-daily-time", Attributes::ScreenDailyTime::Id, credsIssuerConfig), // + make_unique(Id, "remaining-screen-time", Attributes::RemainingScreenTime::Id, credsIssuerConfig), // + make_unique(Id, "block-unrated", Attributes::BlockUnrated::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "remaining-screen-time-expired", Events::RemainingScreenTimeExpired::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "remaining-screen-time-expired", Events::RemainingScreenTimeExpired::Id, + credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} +void registerClusterContentAppObserver(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::ContentAppObserver; + + const char * clusterName = "ContentAppObserver"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // make_unique(Id, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // }; @@ -23962,6 +24890,8 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterApplicationLauncher(commands, credsIssuerConfig); registerClusterApplicationBasic(commands, credsIssuerConfig); registerClusterAccountLogin(commands, credsIssuerConfig); + registerClusterContentControl(commands, credsIssuerConfig); + registerClusterContentAppObserver(commands, credsIssuerConfig); registerClusterElectricalMeasurement(commands, credsIssuerConfig); registerClusterUnitTesting(commands, credsIssuerConfig); registerClusterFaultInjection(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index d7054e21dd700b..17bb154ec9319a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -2704,6 +2704,99 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::T ComplexArgumentParser::Finalize(request.coolSetpoint); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Channel::Structs::ProgramCastStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ProgramCastStruct.name", "name", value.isMember("name"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ProgramCastStruct.role", "role", value.isMember("role"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); + valueCopy.removeMember("name"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "role"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.role, value["role"])); + valueCopy.removeMember("role"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Channel::Structs::ProgramCastStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.name); + ComplexArgumentParser::Finalize(request.role); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Channel::Structs::ProgramCategoryStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ProgramCategoryStruct.category", "category", value.isMember("category"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "category"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.category, value["category"])); + valueCopy.removeMember("category"); + + if (value.isMember("subCategory")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "subCategory"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.subCategory, value["subCategory"])); + } + valueCopy.removeMember("subCategory"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Channel::Structs::ProgramCategoryStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.category); + ComplexArgumentParser::Finalize(request.subCategory); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Channel::Structs::SeriesInfoStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SeriesInfoStruct.season", "season", value.isMember("season"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SeriesInfoStruct.episode", "episode", value.isMember("episode"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "season"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.season, value["season"])); + valueCopy.removeMember("season"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "episode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.episode, value["episode"])); + valueCopy.removeMember("episode"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Channel::Structs::SeriesInfoStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.season); + ComplexArgumentParser::Finalize(request.episode); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Channel::Structs::ChannelInfoStruct::Type & request, Json::Value & value) @@ -2748,6 +2841,20 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, } valueCopy.removeMember("affiliateCallSign"); + if (value.isMember("identifier")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "identifier"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.identifier, value["identifier"])); + } + valueCopy.removeMember("identifier"); + + if (value.isMember("type")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "type"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.type, value["type"])); + } + valueCopy.removeMember("type"); + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } @@ -2758,6 +2865,273 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::Channel::Structs::Chan ComplexArgumentParser::Finalize(request.name); ComplexArgumentParser::Finalize(request.callSign); ComplexArgumentParser::Finalize(request.affiliateCallSign); + ComplexArgumentParser::Finalize(request.identifier); + ComplexArgumentParser::Finalize(request.type); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Channel::Structs::ProgramStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ProgramStruct.identifier", "identifier", value.isMember("identifier"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ProgramStruct.channel", "channel", value.isMember("channel"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ProgramStruct.startTime", "startTime", value.isMember("startTime"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ProgramStruct.endTime", "endTime", value.isMember("endTime"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ProgramStruct.title", "title", value.isMember("title"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "identifier"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.identifier, value["identifier"])); + valueCopy.removeMember("identifier"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "channel"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.channel, value["channel"])); + valueCopy.removeMember("channel"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "startTime"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.startTime, value["startTime"])); + valueCopy.removeMember("startTime"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "endTime"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.endTime, value["endTime"])); + valueCopy.removeMember("endTime"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "title"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.title, value["title"])); + valueCopy.removeMember("title"); + + if (value.isMember("subtitle")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "subtitle"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.subtitle, value["subtitle"])); + } + valueCopy.removeMember("subtitle"); + + if (value.isMember("description")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "description"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.description, value["description"])); + } + valueCopy.removeMember("description"); + + if (value.isMember("audioLanguages")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "audioLanguages"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.audioLanguages, value["audioLanguages"])); + } + valueCopy.removeMember("audioLanguages"); + + if (value.isMember("ratings")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "ratings"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.ratings, value["ratings"])); + } + valueCopy.removeMember("ratings"); + + if (value.isMember("thumbnailUrl")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "thumbnailUrl"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.thumbnailUrl, value["thumbnailUrl"])); + } + valueCopy.removeMember("thumbnailUrl"); + + if (value.isMember("posterArtUrl")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "posterArtUrl"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.posterArtUrl, value["posterArtUrl"])); + } + valueCopy.removeMember("posterArtUrl"); + + if (value.isMember("dvbiUrl")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "dvbiUrl"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.dvbiUrl, value["dvbiUrl"])); + } + valueCopy.removeMember("dvbiUrl"); + + if (value.isMember("releaseDate")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "releaseDate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.releaseDate, value["releaseDate"])); + } + valueCopy.removeMember("releaseDate"); + + if (value.isMember("parentalGuidanceText")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "parentalGuidanceText"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.parentalGuidanceText, value["parentalGuidanceText"])); + } + valueCopy.removeMember("parentalGuidanceText"); + + if (value.isMember("recordingFlag")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "recordingFlag"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.recordingFlag, value["recordingFlag"])); + } + valueCopy.removeMember("recordingFlag"); + + if (value.isMember("seriesInfo")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "seriesInfo"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.seriesInfo, value["seriesInfo"])); + } + valueCopy.removeMember("seriesInfo"); + + if (value.isMember("categoryList")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "categoryList"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.categoryList, value["categoryList"])); + } + valueCopy.removeMember("categoryList"); + + if (value.isMember("castList")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "castList"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.castList, value["castList"])); + } + valueCopy.removeMember("castList"); + + if (value.isMember("externalIDList")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "externalIDList"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.externalIDList, value["externalIDList"])); + } + valueCopy.removeMember("externalIDList"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Channel::Structs::ProgramStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.identifier); + ComplexArgumentParser::Finalize(request.channel); + ComplexArgumentParser::Finalize(request.startTime); + ComplexArgumentParser::Finalize(request.endTime); + ComplexArgumentParser::Finalize(request.title); + ComplexArgumentParser::Finalize(request.subtitle); + ComplexArgumentParser::Finalize(request.description); + ComplexArgumentParser::Finalize(request.audioLanguages); + ComplexArgumentParser::Finalize(request.ratings); + ComplexArgumentParser::Finalize(request.thumbnailUrl); + ComplexArgumentParser::Finalize(request.posterArtUrl); + ComplexArgumentParser::Finalize(request.dvbiUrl); + ComplexArgumentParser::Finalize(request.releaseDate); + ComplexArgumentParser::Finalize(request.parentalGuidanceText); + ComplexArgumentParser::Finalize(request.recordingFlag); + ComplexArgumentParser::Finalize(request.seriesInfo); + ComplexArgumentParser::Finalize(request.categoryList); + ComplexArgumentParser::Finalize(request.castList); + ComplexArgumentParser::Finalize(request.externalIDList); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Channel::Structs::PageTokenStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + char labelWithMember[kMaxLabelLength]; + if (value.isMember("limit")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "limit"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.limit, value["limit"])); + } + valueCopy.removeMember("limit"); + + if (value.isMember("after")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "after"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.after, value["after"])); + } + valueCopy.removeMember("after"); + + if (value.isMember("before")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "before"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.before, value["before"])); + } + valueCopy.removeMember("before"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Channel::Structs::PageTokenStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.limit); + ComplexArgumentParser::Finalize(request.after); + ComplexArgumentParser::Finalize(request.before); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Channel::Structs::ChannelPagingStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + char labelWithMember[kMaxLabelLength]; + if (value.isMember("previousToken")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "previousToken"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.previousToken, value["previousToken"])); + } + valueCopy.removeMember("previousToken"); + + if (value.isMember("nextToken")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "nextToken"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.nextToken, value["nextToken"])); + } + valueCopy.removeMember("nextToken"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Channel::Structs::ChannelPagingStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.previousToken); + ComplexArgumentParser::Finalize(request.nextToken); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Channel::Structs::AdditionalInfoStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AdditionalInfoStruct.name", "name", value.isMember("name"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AdditionalInfoStruct.value", "value", value.isMember("value"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); + valueCopy.removeMember("name"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "value"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"])); + valueCopy.removeMember("value"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Channel::Structs::AdditionalInfoStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.name); + ComplexArgumentParser::Finalize(request.value); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Channel::Structs::LineupInfoStruct::Type & request, @@ -2838,6 +3212,70 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::TargetNavigator::Struc ComplexArgumentParser::Finalize(request.name); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::MediaPlayback::Structs::TrackAttributesStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TrackAttributesStruct.languageCode", "languageCode", + value.isMember("languageCode"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "languageCode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.languageCode, value["languageCode"])); + valueCopy.removeMember("languageCode"); + + if (value.isMember("displayName")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "displayName"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.displayName, value["displayName"])); + } + valueCopy.removeMember("displayName"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::MediaPlayback::Structs::TrackAttributesStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.languageCode); + ComplexArgumentParser::Finalize(request.displayName); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::MediaPlayback::Structs::TrackStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TrackStruct.id", "id", value.isMember("id"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TrackStruct.trackAttributes", "trackAttributes", + value.isMember("trackAttributes"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "id"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.id, value["id"])); + valueCopy.removeMember("id"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "trackAttributes"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.trackAttributes, value["trackAttributes"])); + valueCopy.removeMember("trackAttributes"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::MediaPlayback::Structs::TrackStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.id); + ComplexArgumentParser::Finalize(request.trackAttributes); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::MediaPlayback::Structs::PlaybackPositionStruct::Type & request, Json::Value & value) @@ -2950,6 +3388,86 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentLauncher::Struc ComplexArgumentParser::Finalize(request.metric); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ContentLauncher::Structs::TrackPreferenceStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TrackPreferenceStruct.languageCode", "languageCode", + value.isMember("languageCode"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TrackPreferenceStruct.audioOutputIndex", "audioOutputIndex", + value.isMember("audioOutputIndex"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "languageCode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.languageCode, value["languageCode"])); + valueCopy.removeMember("languageCode"); + + if (value.isMember("characteristics")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "characteristics"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.characteristics, value["characteristics"])); + } + valueCopy.removeMember("characteristics"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "audioOutputIndex"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.audioOutputIndex, value["audioOutputIndex"])); + valueCopy.removeMember("audioOutputIndex"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentLauncher::Structs::TrackPreferenceStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.languageCode); + ComplexArgumentParser::Finalize(request.characteristics); + ComplexArgumentParser::Finalize(request.audioOutputIndex); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ContentLauncher::Structs::PlaybackPreferencesStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PlaybackPreferencesStruct.playbackPosition", "playbackPosition", + value.isMember("playbackPosition"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("PlaybackPreferencesStruct.textTrack", "textTrack", value.isMember("textTrack"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "playbackPosition"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.playbackPosition, value["playbackPosition"])); + valueCopy.removeMember("playbackPosition"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "textTrack"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.textTrack, value["textTrack"])); + valueCopy.removeMember("textTrack"); + + if (value.isMember("audioTracks")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "audioTracks"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.audioTracks, value["audioTracks"])); + } + valueCopy.removeMember("audioTracks"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentLauncher::Structs::PlaybackPreferencesStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.playbackPosition); + ComplexArgumentParser::Finalize(request.textTrack); + ComplexArgumentParser::Finalize(request.audioTracks); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::Type & request, Json::Value & value) @@ -3219,6 +3737,39 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::S ComplexArgumentParser::Finalize(request.endpoint); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ContentControl::Structs::RatingNameStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("RatingNameStruct.ratingName", "ratingName", value.isMember("ratingName"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "ratingName"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.ratingName, value["ratingName"])); + valueCopy.removeMember("ratingName"); + + if (value.isMember("ratingNameDesc")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "ratingNameDesc"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.ratingNameDesc, value["ratingNameDesc"])); + } + valueCopy.removeMember("ratingNameDesc"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentControl::Structs::RatingNameStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.ratingName); + ComplexArgumentParser::Finalize(request.ratingNameDesc); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 34a3712ce0f24a..cf97dceec4101b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -339,11 +339,46 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Str static void Finalize(chip::app::Clusters::Thermostat::Structs::ThermostatScheduleTransition::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Channel::Structs::ProgramCastStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Channel::Structs::ProgramCastStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Channel::Structs::ProgramCategoryStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Channel::Structs::ProgramCategoryStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Channel::Structs::SeriesInfoStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Channel::Structs::SeriesInfoStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Channel::Structs::ChannelInfoStruct::Type & request, Json::Value & value); static void Finalize(chip::app::Clusters::Channel::Structs::ChannelInfoStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Channel::Structs::ProgramStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Channel::Structs::ProgramStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Channel::Structs::PageTokenStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Channel::Structs::PageTokenStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Channel::Structs::ChannelPagingStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Channel::Structs::ChannelPagingStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Channel::Structs::AdditionalInfoStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Channel::Structs::AdditionalInfoStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Channel::Structs::LineupInfoStruct::Type & request, Json::Value & value); @@ -354,6 +389,16 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::TargetNavigator static void Finalize(chip::app::Clusters::TargetNavigator::Structs::TargetInfoStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::MediaPlayback::Structs::TrackAttributesStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::MediaPlayback::Structs::TrackAttributesStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::MediaPlayback::Structs::TrackStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::MediaPlayback::Structs::TrackStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::MediaPlayback::Structs::PlaybackPositionStruct::Type & request, Json::Value & value); @@ -369,6 +414,17 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentLauncher static void Finalize(chip::app::Clusters::ContentLauncher::Structs::DimensionStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentLauncher::Structs::TrackPreferenceStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ContentLauncher::Structs::TrackPreferenceStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::ContentLauncher::Structs::PlaybackPreferencesStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ContentLauncher::Structs::PlaybackPreferencesStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::Type & request, Json::Value & value); @@ -405,6 +461,11 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLaun static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentControl::Structs::RatingNameStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ContentControl::Structs::RatingNameStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::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 c629bfc4dbdfcb..e055a0e282b46b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2381,6 +2381,81 @@ 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::Channel::Structs::ProgramCastStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Name", indent + 1, value.name); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Role", indent + 1, value.role); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Role'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::ProgramCategoryStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Category", indent + 1, value.category); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Category'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("SubCategory", indent + 1, value.subCategory); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SubCategory'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::SeriesInfoStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Season", indent + 1, value.season); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Season'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Episode", indent + 1, value.episode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Episode'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Channel::Structs::ChannelInfoStruct::DecodableType & value) { @@ -2425,6 +2500,266 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return err; } } + { + CHIP_ERROR err = LogValue("Identifier", indent + 1, value.identifier); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Identifier'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Type", indent + 1, value.type); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Type'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::ProgramStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Identifier", indent + 1, value.identifier); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Identifier'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Channel", indent + 1, value.channel); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Channel'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("StartTime", indent + 1, value.startTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StartTime'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("EndTime", indent + 1, value.endTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'EndTime'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Title", indent + 1, value.title); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Title'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Subtitle", indent + 1, value.subtitle); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Subtitle'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Description", indent + 1, value.description); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Description'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("AudioLanguages", indent + 1, value.audioLanguages); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AudioLanguages'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Ratings", indent + 1, value.ratings); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Ratings'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ThumbnailUrl", indent + 1, value.thumbnailUrl); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ThumbnailUrl'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("PosterArtUrl", indent + 1, value.posterArtUrl); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PosterArtUrl'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("DvbiUrl", indent + 1, value.dvbiUrl); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DvbiUrl'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ReleaseDate", indent + 1, value.releaseDate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ReleaseDate'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ParentalGuidanceText", indent + 1, value.parentalGuidanceText); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ParentalGuidanceText'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("RecordingFlag", indent + 1, value.recordingFlag); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'RecordingFlag'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("SeriesInfo", indent + 1, value.seriesInfo); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SeriesInfo'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("CategoryList", indent + 1, value.categoryList); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CategoryList'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("CastList", indent + 1, value.castList); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CastList'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ExternalIDList", indent + 1, value.externalIDList); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ExternalIDList'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::PageTokenStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Limit", indent + 1, value.limit); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Limit'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("After", indent + 1, value.after); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'After'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Before", indent + 1, value.before); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Before'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::ChannelPagingStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("PreviousToken", indent + 1, value.previousToken); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PreviousToken'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NextToken", indent + 1, value.nextToken); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NextToken'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::AdditionalInfoStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Name", indent + 1, value.name); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Value", indent + 1, value.value); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Value'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; @@ -2496,6 +2831,57 @@ CHIP_ERROR 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::MediaPlayback::Structs::TrackAttributesStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("LanguageCode", indent + 1, value.languageCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LanguageCode'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("DisplayName", indent + 1, value.displayName); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DisplayName'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::MediaPlayback::Structs::TrackStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Id", indent + 1, value.id); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Id'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TrackAttributes", indent + 1, value.trackAttributes); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TrackAttributes'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::MediaPlayback::Structs::PlaybackPositionStruct::DecodableType & value) @@ -2596,6 +2982,74 @@ CHIP_ERROR 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::ContentLauncher::Structs::TrackPreferenceStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("LanguageCode", indent + 1, value.languageCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LanguageCode'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Characteristics", indent + 1, value.characteristics); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Characteristics'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("AudioOutputIndex", indent + 1, value.audioOutputIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AudioOutputIndex'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ContentLauncher::Structs::PlaybackPreferencesStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("PlaybackPosition", indent + 1, value.playbackPosition); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PlaybackPosition'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TextTrack", indent + 1, value.textTrack); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TextTrack'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("AudioTracks", indent + 1, value.audioTracks); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AudioTracks'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::DecodableType & value) @@ -2824,6 +3278,31 @@ 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::ContentControl::Structs::RatingNameStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("RatingName", indent + 1, value.ratingName); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'RatingName'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("RatingNameDesc", indent + 1, value.ratingNameDesc); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'RatingNameDesc'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value) { @@ -5048,7 +5527,39 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::PumpMotorFatalFailure::DecodableType & value) + const PumpConfigurationAndControl::Events::PumpMotorFatalFailure::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PumpConfigurationAndControl::Events::PumpBlocked::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PumpConfigurationAndControl::Events::SensorFailure::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); DataModelLogger::LogString(indent, "}"); @@ -5056,7 +5567,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::DecodableType & value) + const PumpConfigurationAndControl::Events::ElectronicFatalFailure::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); DataModelLogger::LogString(indent, "}"); @@ -5064,7 +5575,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::PumpBlocked::DecodableType & value) + const PumpConfigurationAndControl::Events::GeneralFault::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); DataModelLogger::LogString(indent, "}"); @@ -5072,7 +5583,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::SensorFailure::DecodableType & value) + const PumpConfigurationAndControl::Events::Leakage::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); DataModelLogger::LogString(indent, "}"); @@ -5080,7 +5591,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::DecodableType & value) + const PumpConfigurationAndControl::Events::AirDetection::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); DataModelLogger::LogString(indent, "}"); @@ -5088,7 +5599,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::ElectronicFatalFailure::DecodableType & value) + const PumpConfigurationAndControl::Events::TurbineOperation::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); DataModelLogger::LogString(indent, "}"); @@ -5096,31 +5607,135 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::GeneralFault::DecodableType & value) + const TargetNavigator::Events::TargetUpdated::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("TargetList", indent + 1, value.targetList); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TargetList'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentTarget", indent + 1, value.currentTarget); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentTarget'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Data", indent + 1, value.data); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Data'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::Leakage::DecodableType & value) + const MediaPlayback::Events::StateChanged::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentState", indent + 1, value.currentState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentState'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("StartTime", indent + 1, value.startTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StartTime'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Duration", indent + 1, value.duration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Duration'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SampledPosition", indent + 1, value.sampledPosition); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SampledPosition'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("PlaybackSpeed", indent + 1, value.playbackSpeed); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PlaybackSpeed'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SeekRangeEnd", indent + 1, value.seekRangeEnd); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SeekRangeEnd'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SeekRangeStart", indent + 1, value.seekRangeStart); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SeekRangeStart'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Data", indent + 1, value.data); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Data'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("AudioAdvanceUnmuted", indent + 1, value.audioAdvanceUnmuted); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AudioAdvanceUnmuted'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::AirDetection::DecodableType & value) + const AccountLogin::Events::LoggedOut::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Node", indent + 1, value.node); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Node'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::TurbineOperation::DecodableType & value) + const ContentControl::Events::RemainingScreenTimeExpired::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); DataModelLogger::LogString(indent, "}"); @@ -5708,6 +6323,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Channel::Commands::ProgramGuideResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("channelPagingStruct", indent + 1, value.channelPagingStruct)); + ReturnErrorOnFailure(DataModelLogger::LogValue("programList", indent + 1, value.programList)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const TargetNavigator::Commands::NavigateTargetResponse::DecodableType & value) { @@ -5760,6 +6384,24 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ContentControl::Commands::ResetPINResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("PINCode", indent + 1, value.PINCode)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); + ReturnErrorOnFailure(DataModelLogger::LogValue("encodingHint", indent + 1, value.encodingHint)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType & value) { @@ -13525,6 +14167,30 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SeekRangeStart", 1, value); } + case MediaPlayback::Attributes::ActiveAudioTrack::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActiveAudioTrack", 1, value); + } + case MediaPlayback::Attributes::AvailableAudioTracks::Id: { + chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AvailableAudioTracks", 1, value); + } + case MediaPlayback::Attributes::ActiveTextTrack::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActiveTextTrack", 1, value); + } + case MediaPlayback::Attributes::AvailableTextTracks::Id: { + chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AvailableTextTracks", 1, value); + } case MediaPlayback::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -13927,6 +14593,120 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case ContentControl::Id: { + switch (path.mAttributeId) + { + case ContentControl::Attributes::Enabled::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Enabled", 1, value); + } + case ContentControl::Attributes::OnDemandRatings::Id: { + chip::app::DataModel::DecodableList + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OnDemandRatings", 1, value); + } + case ContentControl::Attributes::OnDemandRatingThreshold::Id: { + chip::CharSpan value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OnDemandRatingThreshold", 1, value); + } + case ContentControl::Attributes::ScheduledContentRatings::Id: { + chip::app::DataModel::DecodableList + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ScheduledContentRatings", 1, value); + } + case ContentControl::Attributes::ScheduledContentRatingThreshold::Id: { + chip::CharSpan value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ScheduledContentRatingThreshold", 1, value); + } + case ContentControl::Attributes::ScreenDailyTime::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ScreenDailyTime", 1, value); + } + case ContentControl::Attributes::RemainingScreenTime::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("RemainingScreenTime", 1, value); + } + case ContentControl::Attributes::BlockUnrated::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BlockUnrated", 1, value); + } + case ContentControl::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case ContentControl::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case ContentControl::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case ContentControl::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case ContentControl::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case ContentControl::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } + case ContentAppObserver::Id: { + switch (path.mAttributeId) + { + case ContentAppObserver::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case ContentAppObserver::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case ContentAppObserver::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case ContentAppObserver::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case ContentAppObserver::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case ContentAppObserver::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case ElectricalMeasurement::Id: { switch (path.mAttributeId) { @@ -15539,6 +16319,11 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeChannelResponse", 1, value); } + case Channel::Commands::ProgramGuideResponse::Id: { + Channel::Commands::ProgramGuideResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ProgramGuideResponse", 1, value); + } } break; } @@ -15608,6 +16393,28 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case ContentControl::Id: { + switch (path.mCommandId) + { + case ContentControl::Commands::ResetPINResponse::Id: { + ContentControl::Commands::ResetPINResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ResetPINResponse", 1, value); + } + } + break; + } + case ContentAppObserver::Id: { + switch (path.mCommandId) + { + case ContentAppObserver::Commands::ContentAppMessageResponse::Id: { + ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ContentAppMessageResponse", 1, value); + } + } + break; + } case ElectricalMeasurement::Id: { switch (path.mCommandId) { @@ -16351,6 +17158,50 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case TargetNavigator::Id: { + switch (header.mPath.mEventId) + { + case TargetNavigator::Events::TargetUpdated::Id: { + chip::app::Clusters::TargetNavigator::Events::TargetUpdated::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TargetUpdated", 1, value); + } + } + break; + } + case MediaPlayback::Id: { + switch (header.mPath.mEventId) + { + case MediaPlayback::Events::StateChanged::Id: { + chip::app::Clusters::MediaPlayback::Events::StateChanged::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("StateChanged", 1, value); + } + } + break; + } + case AccountLogin::Id: { + switch (header.mPath.mEventId) + { + case AccountLogin::Events::LoggedOut::Id: { + chip::app::Clusters::AccountLogin::Events::LoggedOut::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LoggedOut", 1, value); + } + } + break; + } + case ContentControl::Id: { + switch (header.mPath.mEventId) + { + case ContentControl::Events::RemainingScreenTimeExpired::Id: { + chip::app::Clusters::ContentControl::Events::RemainingScreenTimeExpired::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("RemainingScreenTimeExpired", 1, value); + } + } + break; + } case UnitTesting::Id: { switch (header.mPath.mEventId) { 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 82102ec08c82f3..764456afeb2fd6 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -214,15 +214,42 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Structs::ThermostatScheduleTransition::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::ProgramCastStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::ProgramCategoryStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::SeriesInfoStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Channel::Structs::ChannelInfoStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::ProgramStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::PageTokenStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::ChannelPagingStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::AdditionalInfoStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Channel::Structs::LineupInfoStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TargetNavigator::Structs::TargetInfoStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::MediaPlayback::Structs::TrackAttributesStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::MediaPlayback::Structs::TrackStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::MediaPlayback::Structs::PlaybackPositionStruct::DecodableType & value); @@ -232,6 +259,12 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentLauncher::Structs::DimensionStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ContentLauncher::Structs::TrackPreferenceStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ContentLauncher::Structs::PlaybackPreferencesStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::DecodableType & value); @@ -253,6 +286,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, 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::ContentControl::Structs::RatingNameStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value); @@ -474,6 +510,14 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::PumpConfigurationAndControl::Events::AirDetection::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::PumpConfigurationAndControl::Events::TurbineOperation::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::TargetNavigator::Events::TargetUpdated::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::MediaPlayback::Events::StateChanged::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::AccountLogin::Events::LoggedOut::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ContentControl::Events::RemainingScreenTimeExpired::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Events::TestEvent::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, @@ -593,6 +637,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Commands::ProgramGuideResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, @@ -605,6 +651,11 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ContentControl::Commands::ResetPINResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType & value); 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 4358b5753c47c4..f1508bc6d7b9d7 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -141,6 +141,8 @@ | ApplicationLauncher | 0x050C | | ApplicationBasic | 0x050D | | AccountLogin | 0x050E | +| ContentControl | 0x050F | +| ContentAppObserver | 0x0510 | | ElectricalMeasurement | 0x0B04 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| @@ -132534,6 +132536,9 @@ class SubscribeAttributeWakeOnLanClusterRevision : public SubscribeAttribute { | * ChangeChannel | 0x00 | | * ChangeChannelByNumber | 0x02 | | * SkipChannel | 0x03 | +| * GetProgramGuide | 0x04 | +| * RecordProgram | 0x06 | +| * CancelRecordProgram | 0x07 | |------------------------------------------------------------------------------| | Attributes: | | | * ChannelList | 0x0000 | @@ -132698,6 +132703,362 @@ class ChannelSkipChannel : public ClusterCommand { chip::app::Clusters::Channel::Commands::SkipChannel::Type mRequest; }; +#if MTR_ENABLE_PROVISIONAL +/* + * Command GetProgramGuide + */ +class ChannelGetProgramGuide : public ClusterCommand { +public: + ChannelGetProgramGuide() + : ClusterCommand("get-program-guide") + , mComplex_ChannelList(&mRequest.channelList) + , mComplex_PageToken(&mRequest.pageToken) + , mComplex_ExternalIDList(&mRequest.externalIDList) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("StartTime", 0, UINT32_MAX, &mRequest.startTime); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("EndTime", 0, UINT32_MAX, &mRequest.endTime); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ChannelList", &mComplex_ChannelList); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("PageToken", &mComplex_PageToken); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("RecordingFlag", 0, UINT32_MAX, &mRequest.recordingFlag); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ExternalIDList", &mComplex_ExternalIDList); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Data", &mRequest.data); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Channel::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Channel::Commands::GetProgramGuide::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRChannelClusterGetProgramGuideParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.startTime.HasValue()) { + params.startTime = [NSNumber numberWithUnsignedInt:mRequest.startTime.Value()]; + } else { + params.startTime = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.endTime.HasValue()) { + params.endTime = [NSNumber numberWithUnsignedInt:mRequest.endTime.Value()]; + } else { + params.endTime = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.channelList.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.channelList.Value()) { + MTRChannelClusterChannelInfoStruct * newElement_1; + newElement_1 = [MTRChannelClusterChannelInfoStruct new]; + newElement_1.majorNumber = [NSNumber numberWithUnsignedShort:entry_1.majorNumber]; + newElement_1.minorNumber = [NSNumber numberWithUnsignedShort:entry_1.minorNumber]; + if (entry_1.name.HasValue()) { + newElement_1.name = [[NSString alloc] initWithBytes:entry_1.name.Value().data() length:entry_1.name.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_1.name = nil; + } + if (entry_1.callSign.HasValue()) { + newElement_1.callSign = [[NSString alloc] initWithBytes:entry_1.callSign.Value().data() length:entry_1.callSign.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_1.callSign = nil; + } + if (entry_1.affiliateCallSign.HasValue()) { + newElement_1.affiliateCallSign = [[NSString alloc] initWithBytes:entry_1.affiliateCallSign.Value().data() length:entry_1.affiliateCallSign.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_1.affiliateCallSign = nil; + } + if (entry_1.identifier.HasValue()) { + newElement_1.identifier = [[NSString alloc] initWithBytes:entry_1.identifier.Value().data() length:entry_1.identifier.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_1.identifier = nil; + } + if (entry_1.type.HasValue()) { + newElement_1.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.type.Value())]; + } else { + newElement_1.type = nil; + } + [array_1 addObject:newElement_1]; + } + params.channelList = array_1; + } + } else { + params.channelList = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.pageToken.HasValue()) { + params.pageToken = [MTRChannelClusterPageTokenStruct new]; + if (mRequest.pageToken.Value().limit.HasValue()) { + params.pageToken.limit = [NSNumber numberWithUnsignedShort:mRequest.pageToken.Value().limit.Value()]; + } else { + params.pageToken.limit = nil; + } + if (mRequest.pageToken.Value().after.HasValue()) { + params.pageToken.after = [[NSString alloc] initWithBytes:mRequest.pageToken.Value().after.Value().data() length:mRequest.pageToken.Value().after.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.pageToken.after = nil; + } + if (mRequest.pageToken.Value().before.HasValue()) { + params.pageToken.before = [[NSString alloc] initWithBytes:mRequest.pageToken.Value().before.Value().data() length:mRequest.pageToken.Value().before.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.pageToken.before = nil; + } + } else { + params.pageToken = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.recordingFlag.HasValue()) { + params.recordingFlag = [NSNumber numberWithUnsignedInt:mRequest.recordingFlag.Value().Raw()]; + } else { + params.recordingFlag = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.externalIDList.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.externalIDList.Value()) { + MTRChannelClusterAdditionalInfoStruct * newElement_1; + newElement_1 = [MTRChannelClusterAdditionalInfoStruct new]; + newElement_1.name = [[NSString alloc] initWithBytes:entry_1.name.data() length:entry_1.name.size() encoding:NSUTF8StringEncoding]; + newElement_1.value = [[NSString alloc] initWithBytes:entry_1.value.data() length:entry_1.value.size() encoding:NSUTF8StringEncoding]; + [array_1 addObject:newElement_1]; + } + params.externalIDList = array_1; + } + } else { + params.externalIDList = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.data.HasValue()) { + params.data = [NSData dataWithBytes:mRequest.data.Value().data() length:mRequest.data.Value().size()]; + } else { + params.data = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getProgramGuideWithParams:params completion: + ^(MTRChannelClusterProgramGuideResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::Channel::Commands::ProgramGuideResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::Channel::Commands::ProgramGuideResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::Channel::Commands::GetProgramGuide::Type mRequest; + TypedComplexArgument>> mComplex_ChannelList; + TypedComplexArgument> mComplex_PageToken; + TypedComplexArgument>> mComplex_ExternalIDList; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command RecordProgram + */ +class ChannelRecordProgram : public ClusterCommand { +public: + ChannelRecordProgram() + : ClusterCommand("record-program") + , mComplex_ExternalIDList(&mRequest.externalIDList) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ProgramIdentifier", &mRequest.programIdentifier); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ShouldRecordSeries", 0, 1, &mRequest.shouldRecordSeries); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ExternalIDList", &mComplex_ExternalIDList); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Data", &mRequest.data); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Channel::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Channel::Commands::RecordProgram::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRChannelClusterRecordProgramParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.programIdentifier = [[NSString alloc] initWithBytes:mRequest.programIdentifier.data() length:mRequest.programIdentifier.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.shouldRecordSeries = [NSNumber numberWithBool:mRequest.shouldRecordSeries]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.externalIDList) { + MTRChannelClusterAdditionalInfoStruct * newElement_0; + newElement_0 = [MTRChannelClusterAdditionalInfoStruct new]; + newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() length:entry_0.name.size() encoding:NSUTF8StringEncoding]; + newElement_0.value = [[NSString alloc] initWithBytes:entry_0.value.data() length:entry_0.value.size() encoding:NSUTF8StringEncoding]; + [array_0 addObject:newElement_0]; + } + params.externalIDList = array_0; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.data = [NSData dataWithBytes:mRequest.data.data() length:mRequest.data.size()]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster recordProgramWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::Channel::Commands::RecordProgram::Type mRequest; + TypedComplexArgument> mComplex_ExternalIDList; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command CancelRecordProgram + */ +class ChannelCancelRecordProgram : public ClusterCommand { +public: + ChannelCancelRecordProgram() + : ClusterCommand("cancel-record-program") + , mComplex_ExternalIDList(&mRequest.externalIDList) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ProgramIdentifier", &mRequest.programIdentifier); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ShouldRecordSeries", 0, 1, &mRequest.shouldRecordSeries); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ExternalIDList", &mComplex_ExternalIDList); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Data", &mRequest.data); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Channel::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Channel::Commands::CancelRecordProgram::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRChannelClusterCancelRecordProgramParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.programIdentifier = [[NSString alloc] initWithBytes:mRequest.programIdentifier.data() length:mRequest.programIdentifier.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.shouldRecordSeries = [NSNumber numberWithBool:mRequest.shouldRecordSeries]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.externalIDList) { + MTRChannelClusterAdditionalInfoStruct * newElement_0; + newElement_0 = [MTRChannelClusterAdditionalInfoStruct new]; + newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() length:entry_0.name.size() encoding:NSUTF8StringEncoding]; + newElement_0.value = [[NSString alloc] initWithBytes:entry_0.value.data() length:entry_0.value.size() encoding:NSUTF8StringEncoding]; + [array_0 addObject:newElement_0]; + } + params.externalIDList = array_0; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.data = [NSData dataWithBytes:mRequest.data.data() length:mRequest.data.size()]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster cancelRecordProgramWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::Channel::Commands::CancelRecordProgram::Type mRequest; + TypedComplexArgument> mComplex_ExternalIDList; +}; + +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute ChannelList */ @@ -133457,6 +133818,7 @@ class SubscribeAttributeChannelClusterRevision : public SubscribeAttribute { | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * TargetUpdated | 0x0000 | \*----------------------------------------------------------------------------*/ /* @@ -134193,6 +134555,9 @@ class SubscribeAttributeTargetNavigatorClusterRevision : public SubscribeAttribu | * SkipForward | 0x08 | | * SkipBackward | 0x09 | | * Seek | 0x0B | +| * ActivateAudioTrack | 0x0C | +| * ActivateTextTrack | 0x0D | +| * DeactivateTextTrack | 0x0E | |------------------------------------------------------------------------------| | Attributes: | | | * CurrentState | 0x0000 | @@ -134202,6 +134567,10 @@ class SubscribeAttributeTargetNavigatorClusterRevision : public SubscribeAttribu | * PlaybackSpeed | 0x0004 | | * SeekRangeEnd | 0x0005 | | * SeekRangeStart | 0x0006 | +| * ActiveAudioTrack | 0x0007 | +| * AvailableAudioTracks | 0x0008 | +| * ActiveTextTrack | 0x0009 | +| * AvailableTextTracks | 0x000A | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -134210,6 +134579,7 @@ class SubscribeAttributeTargetNavigatorClusterRevision : public SubscribeAttribu | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * StateChanged | 0x0000 | \*----------------------------------------------------------------------------*/ /* @@ -134520,6 +134890,9 @@ class MediaPlaybackRewind : public ClusterCommand { MediaPlaybackRewind() : ClusterCommand("rewind") { +#if MTR_ENABLE_PROVISIONAL + AddArgument("AudioAdvanceUnmuted", 0, 1, &mRequest.audioAdvanceUnmuted); +#endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -134534,6 +134907,13 @@ class MediaPlaybackRewind : public ClusterCommand { __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRMediaPlaybackClusterRewindParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.audioAdvanceUnmuted.HasValue()) { + params.audioAdvanceUnmuted = [NSNumber numberWithBool:mRequest.audioAdvanceUnmuted.Value()]; + } else { + params.audioAdvanceUnmuted = nil; + } +#endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -134560,6 +134940,7 @@ class MediaPlaybackRewind : public ClusterCommand { } private: + chip::app::Clusters::MediaPlayback::Commands::Rewind::Type mRequest; }; /* @@ -134570,6 +134951,9 @@ class MediaPlaybackFastForward : public ClusterCommand { MediaPlaybackFastForward() : ClusterCommand("fast-forward") { +#if MTR_ENABLE_PROVISIONAL + AddArgument("AudioAdvanceUnmuted", 0, 1, &mRequest.audioAdvanceUnmuted); +#endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -134584,6 +134968,13 @@ class MediaPlaybackFastForward : public ClusterCommand { __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRMediaPlaybackClusterFastForwardParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.audioAdvanceUnmuted.HasValue()) { + params.audioAdvanceUnmuted = [NSNumber numberWithBool:mRequest.audioAdvanceUnmuted.Value()]; + } else { + params.audioAdvanceUnmuted = nil; + } +#endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -134610,6 +135001,7 @@ class MediaPlaybackFastForward : public ClusterCommand { } private: + chip::app::Clusters::MediaPlayback::Commands::FastForward::Type mRequest; }; /* @@ -134771,6 +135163,165 @@ class MediaPlaybackSeek : public ClusterCommand { chip::app::Clusters::MediaPlayback::Commands::Seek::Type mRequest; }; +#if MTR_ENABLE_PROVISIONAL +/* + * Command ActivateAudioTrack + */ +class MediaPlaybackActivateAudioTrack : public ClusterCommand { +public: + MediaPlaybackActivateAudioTrack() + : ClusterCommand("activate-audio-track") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("TrackID", &mRequest.trackID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("AudioOutputIndex", 0, UINT8_MAX, &mRequest.audioOutputIndex); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRMediaPlaybackClusterActivateAudioTrackParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.trackID = [[NSString alloc] initWithBytes:mRequest.trackID.data() length:mRequest.trackID.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.audioOutputIndex = [NSNumber numberWithUnsignedChar:mRequest.audioOutputIndex]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster activateAudioTrackWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command ActivateTextTrack + */ +class MediaPlaybackActivateTextTrack : public ClusterCommand { +public: + MediaPlaybackActivateTextTrack() + : ClusterCommand("activate-text-track") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("TrackID", &mRequest.trackID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRMediaPlaybackClusterActivateTextTrackParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.trackID = [[NSString alloc] initWithBytes:mRequest.trackID.data() length:mRequest.trackID.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster activateTextTrackWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command DeactivateTextTrack + */ +class MediaPlaybackDeactivateTextTrack : public ClusterCommand { +public: + MediaPlaybackDeactivateTextTrack() + : ClusterCommand("deactivate-text-track") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRMediaPlaybackClusterDeactivateTextTrackParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster deactivateTextTrackWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute CurrentState */ @@ -135345,6 +135896,347 @@ class SubscribeAttributeMediaPlaybackSeekRangeStart : public SubscribeAttribute } }; +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ActiveAudioTrack + */ +class ReadMediaPlaybackActiveAudioTrack : public ReadAttribute { +public: + ReadMediaPlaybackActiveAudioTrack() + : ReadAttribute("active-audio-track") + { + } + + ~ReadMediaPlaybackActiveAudioTrack() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeActiveAudioTrackWithCompletion:^(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.ActiveAudioTrack response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MediaPlayback ActiveAudioTrack read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMediaPlaybackActiveAudioTrack : public SubscribeAttribute { +public: + SubscribeAttributeMediaPlaybackActiveAudioTrack() + : SubscribeAttribute("active-audio-track") + { + } + + ~SubscribeAttributeMediaPlaybackActiveAudioTrack() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeActiveAudioTrackWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.ActiveAudioTrack response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AvailableAudioTracks + */ +class ReadMediaPlaybackAvailableAudioTracks : public ReadAttribute { +public: + ReadMediaPlaybackAvailableAudioTracks() + : ReadAttribute("available-audio-tracks") + { + } + + ~ReadMediaPlaybackAvailableAudioTracks() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAvailableAudioTracksWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.AvailableAudioTracks response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MediaPlayback AvailableAudioTracks read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMediaPlaybackAvailableAudioTracks : public SubscribeAttribute { +public: + SubscribeAttributeMediaPlaybackAvailableAudioTracks() + : SubscribeAttribute("available-audio-tracks") + { + } + + ~SubscribeAttributeMediaPlaybackAvailableAudioTracks() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAvailableAudioTracksWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.AvailableAudioTracks response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ActiveTextTrack + */ +class ReadMediaPlaybackActiveTextTrack : public ReadAttribute { +public: + ReadMediaPlaybackActiveTextTrack() + : ReadAttribute("active-text-track") + { + } + + ~ReadMediaPlaybackActiveTextTrack() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeActiveTextTrackWithCompletion:^(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.ActiveTextTrack response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MediaPlayback ActiveTextTrack read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMediaPlaybackActiveTextTrack : public SubscribeAttribute { +public: + SubscribeAttributeMediaPlaybackActiveTextTrack() + : SubscribeAttribute("active-text-track") + { + } + + ~SubscribeAttributeMediaPlaybackActiveTextTrack() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeActiveTextTrackWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRMediaPlaybackClusterTrackStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.ActiveTextTrack response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AvailableTextTracks + */ +class ReadMediaPlaybackAvailableTextTracks : public ReadAttribute { +public: + ReadMediaPlaybackAvailableTextTracks() + : ReadAttribute("available-text-tracks") + { + } + + ~ReadMediaPlaybackAvailableTextTracks() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAvailableTextTracksWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.AvailableTextTracks response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MediaPlayback AvailableTextTracks read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMediaPlaybackAvailableTextTracks : public SubscribeAttribute { +public: + SubscribeAttributeMediaPlaybackAvailableTextTracks() + : SubscribeAttribute("available-text-tracks") + { + } + + ~SubscribeAttributeMediaPlaybackAvailableTextTracks() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MediaPlayback::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAvailableTextTracksWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.AvailableTextTracks response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute GeneratedCommandList */ @@ -137858,10 +138750,17 @@ class ContentLauncherLaunchContent : public ClusterCommand { ContentLauncherLaunchContent() : ClusterCommand("launch-content") , mComplex_Search(&mRequest.search) + , mComplex_PlaybackPreferences(&mRequest.playbackPreferences) { AddArgument("Search", &mComplex_Search); AddArgument("AutoPlay", 0, 1, &mRequest.autoPlay); AddArgument("Data", &mRequest.data); +#if MTR_ENABLE_PROVISIONAL + AddArgument("PlaybackPreferences", &mComplex_PlaybackPreferences); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("UseCurrentContext", 0, 1, &mRequest.useCurrentContext); +#endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -137909,6 +138808,65 @@ class ContentLauncherLaunchContent : public ClusterCommand { } else { params.data = nil; } +#if MTR_ENABLE_PROVISIONAL + if (mRequest.playbackPreferences.HasValue()) { + params.playbackPreferences = [MTRContentLauncherClusterPlaybackPreferencesStruct new]; + params.playbackPreferences.playbackPosition = [NSNumber numberWithUnsignedLongLong:mRequest.playbackPreferences.Value().playbackPosition]; + params.playbackPreferences.textTrack = [MTRContentLauncherClusterTrackPreferenceStruct new]; + params.playbackPreferences.textTrack.languageCode = [[NSString alloc] initWithBytes:mRequest.playbackPreferences.Value().textTrack.languageCode.data() length:mRequest.playbackPreferences.Value().textTrack.languageCode.size() encoding:NSUTF8StringEncoding]; + if (mRequest.playbackPreferences.Value().textTrack.characteristics.HasValue()) { + { // Scope for our temporary variables + auto * array_4 = [NSMutableArray new]; + for (auto & entry_4 : mRequest.playbackPreferences.Value().textTrack.characteristics.Value()) { + NSNumber * newElement_4; + newElement_4 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_4)]; + [array_4 addObject:newElement_4]; + } + params.playbackPreferences.textTrack.characteristics = array_4; + } + } else { + params.playbackPreferences.textTrack.characteristics = nil; + } + params.playbackPreferences.textTrack.audioOutputIndex = [NSNumber numberWithUnsignedChar:mRequest.playbackPreferences.Value().textTrack.audioOutputIndex]; + if (mRequest.playbackPreferences.Value().audioTracks.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : mRequest.playbackPreferences.Value().audioTracks.Value()) { + MTRContentLauncherClusterTrackPreferenceStruct * newElement_3; + newElement_3 = [MTRContentLauncherClusterTrackPreferenceStruct new]; + newElement_3.languageCode = [[NSString alloc] initWithBytes:entry_3.languageCode.data() length:entry_3.languageCode.size() encoding:NSUTF8StringEncoding]; + if (entry_3.characteristics.HasValue()) { + { // Scope for our temporary variables + auto * array_6 = [NSMutableArray new]; + for (auto & entry_6 : entry_3.characteristics.Value()) { + NSNumber * newElement_6; + newElement_6 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_6)]; + [array_6 addObject:newElement_6]; + } + newElement_3.characteristics = array_6; + } + } else { + newElement_3.characteristics = nil; + } + newElement_3.audioOutputIndex = [NSNumber numberWithUnsignedChar:entry_3.audioOutputIndex]; + [array_3 addObject:newElement_3]; + } + params.playbackPreferences.audioTracks = array_3; + } + } else { + params.playbackPreferences.audioTracks = nil; + } + } else { + params.playbackPreferences = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.useCurrentContext.HasValue()) { + params.useCurrentContext = [NSNumber numberWithBool:mRequest.useCurrentContext.Value()]; + } else { + params.useCurrentContext = nil; + } +#endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -137937,6 +138895,7 @@ class ContentLauncherLaunchContent : public ClusterCommand { private: chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type mRequest; TypedComplexArgument mComplex_Search; + TypedComplexArgument> mComplex_PlaybackPreferences; }; /* @@ -141621,6 +142580,7 @@ class SubscribeAttributeApplicationBasicClusterRevision : public SubscribeAttrib | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * LoggedOut | 0x0000 | \*----------------------------------------------------------------------------*/ /* @@ -141686,6 +142646,9 @@ class AccountLoginLogin : public ClusterCommand { { AddArgument("TempAccountIdentifier", &mRequest.tempAccountIdentifier); AddArgument("SetupPIN", &mRequest.setupPIN); +#if MTR_ENABLE_PROVISIONAL + AddArgument("Node", 0, UINT64_MAX, &mRequest.node); +#endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -141702,6 +142665,13 @@ class AccountLoginLogin : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.tempAccountIdentifier = [[NSString alloc] initWithBytes:mRequest.tempAccountIdentifier.data() length:mRequest.tempAccountIdentifier.size() encoding:NSUTF8StringEncoding]; params.setupPIN = [[NSString alloc] initWithBytes:mRequest.setupPIN.data() length:mRequest.setupPIN.size() encoding:NSUTF8StringEncoding]; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.node.HasValue()) { + params.node = [NSNumber numberWithUnsignedLongLong:mRequest.node.Value()]; + } else { + params.node = nil; + } +#endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -141733,6 +142703,9 @@ class AccountLoginLogout : public ClusterCommand { AccountLoginLogout() : ClusterCommand("logout") { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Node", 0, UINT64_MAX, &mRequest.node); +#endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -141747,6 +142720,13 @@ class AccountLoginLogout : public ClusterCommand { __auto_type * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRAccountLoginClusterLogoutParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.node.HasValue()) { + params.node = [NSNumber numberWithUnsignedLongLong:mRequest.node.Value()]; + } else { + params.node = nil; + } +#endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -141767,6 +142747,7 @@ class AccountLoginLogout : public ClusterCommand { } private: + chip::app::Clusters::AccountLogin::Commands::Logout::Type mRequest; }; /* @@ -142265,6 +143246,2358 @@ class SubscribeAttributeAccountLoginClusterRevision : public SubscribeAttribute } }; +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster ContentControl | 0x050F | +|------------------------------------------------------------------------------| +| Commands: | | +| * UpdatePIN | 0x00 | +| * ResetPIN | 0x01 | +| * Enable | 0x03 | +| * Disable | 0x04 | +| * AddBonusTime | 0x05 | +| * SetScreenDailyTime | 0x06 | +| * BlockUnratedContent | 0x07 | +| * UnblockUnratedContent | 0x08 | +| * SetOnDemandRatingThreshold | 0x09 | +| * SetScheduledContentRatingThreshold | 0x0A | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Enabled | 0x0000 | +| * OnDemandRatings | 0x0001 | +| * OnDemandRatingThreshold | 0x0002 | +| * ScheduledContentRatings | 0x0003 | +| * ScheduledContentRatingThreshold | 0x0004 | +| * ScreenDailyTime | 0x0005 | +| * RemainingScreenTime | 0x0006 | +| * BlockUnrated | 0x0007 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * RemainingScreenTimeExpired | 0x0000 | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command UpdatePIN + */ +class ContentControlUpdatePIN : public ClusterCommand { +public: + ContentControlUpdatePIN() + : ClusterCommand("update-pin") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("OldPIN", &mRequest.oldPIN); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("NewPIN", &mRequest.newPIN); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::UpdatePIN::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentControlClusterUpdatePINParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.oldPIN.HasValue()) { + params.oldPIN = [[NSString alloc] initWithBytes:mRequest.oldPIN.Value().data() length:mRequest.oldPIN.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.oldPIN = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.newPIN = [[NSString alloc] initWithBytes:mRequest.newPIN.data() length:mRequest.newPIN.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster updatePINWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ContentControl::Commands::UpdatePIN::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command ResetPIN + */ +class ContentControlResetPIN : public ClusterCommand { +public: + ContentControlResetPIN() + : ClusterCommand("reset-pin") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::ResetPIN::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentControlClusterResetPINParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster resetPINWithParams:params completion: + ^(MTRContentControlClusterResetPINResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::ContentControl::Commands::ResetPINResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::ContentControl::Commands::ResetPINResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command Enable + */ +class ContentControlEnable : public ClusterCommand { +public: + ContentControlEnable() + : ClusterCommand("enable") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::Enable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentControlClusterEnableParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster enableWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command Disable + */ +class ContentControlDisable : public ClusterCommand { +public: + ContentControlDisable() + : ClusterCommand("disable") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::Disable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentControlClusterDisableParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster disableWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command AddBonusTime + */ +class ContentControlAddBonusTime : public ClusterCommand { +public: + ContentControlAddBonusTime() + : ClusterCommand("add-bonus-time") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("PINCode", &mRequest.PINCode); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("BonusTime", 0, UINT32_MAX, &mRequest.bonusTime); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::AddBonusTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentControlClusterAddBonusTimeParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.PINCode.HasValue()) { + params.pinCode = [[NSString alloc] initWithBytes:mRequest.PINCode.Value().data() length:mRequest.PINCode.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.pinCode = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.bonusTime.HasValue()) { + params.bonusTime = [NSNumber numberWithUnsignedInt:mRequest.bonusTime.Value()]; + } else { + params.bonusTime = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster addBonusTimeWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ContentControl::Commands::AddBonusTime::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetScreenDailyTime + */ +class ContentControlSetScreenDailyTime : public ClusterCommand { +public: + ContentControlSetScreenDailyTime() + : ClusterCommand("set-screen-daily-time") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ScreenTime", 0, UINT32_MAX, &mRequest.screenTime); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::SetScreenDailyTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentControlClusterSetScreenDailyTimeParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.screenTime = [NSNumber numberWithUnsignedInt:mRequest.screenTime]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setScreenDailyTimeWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ContentControl::Commands::SetScreenDailyTime::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command BlockUnratedContent + */ +class ContentControlBlockUnratedContent : public ClusterCommand { +public: + ContentControlBlockUnratedContent() + : ClusterCommand("block-unrated-content") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::BlockUnratedContent::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentControlClusterBlockUnratedContentParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster blockUnratedContentWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command UnblockUnratedContent + */ +class ContentControlUnblockUnratedContent : public ClusterCommand { +public: + ContentControlUnblockUnratedContent() + : ClusterCommand("unblock-unrated-content") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::UnblockUnratedContent::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentControlClusterUnblockUnratedContentParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster unblockUnratedContentWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetOnDemandRatingThreshold + */ +class ContentControlSetOnDemandRatingThreshold : public ClusterCommand { +public: + ContentControlSetOnDemandRatingThreshold() + : ClusterCommand("set-on-demand-rating-threshold") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Rating", &mRequest.rating); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::SetOnDemandRatingThreshold::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentControlClusterSetOnDemandRatingThresholdParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.rating = [[NSString alloc] initWithBytes:mRequest.rating.data() length:mRequest.rating.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setOnDemandRatingThresholdWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ContentControl::Commands::SetOnDemandRatingThreshold::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetScheduledContentRatingThreshold + */ +class ContentControlSetScheduledContentRatingThreshold : public ClusterCommand { +public: + ContentControlSetScheduledContentRatingThreshold() + : ClusterCommand("set-scheduled-content-rating-threshold") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Rating", &mRequest.rating); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentControl::Commands::SetScheduledContentRatingThreshold::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentControlClusterSetScheduledContentRatingThresholdParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.rating = [[NSString alloc] initWithBytes:mRequest.rating.data() length:mRequest.rating.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setScheduledContentRatingThresholdWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ContentControl::Commands::SetScheduledContentRatingThreshold::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute Enabled + */ +class ReadContentControlEnabled : public ReadAttribute { +public: + ReadContentControlEnabled() + : ReadAttribute("enabled") + { + } + + ~ReadContentControlEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::Enabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.Enabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl Enabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlEnabled : public SubscribeAttribute { +public: + SubscribeAttributeContentControlEnabled() + : SubscribeAttribute("enabled") + { + } + + ~SubscribeAttributeContentControlEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::Enabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.Enabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute OnDemandRatings + */ +class ReadContentControlOnDemandRatings : public ReadAttribute { +public: + ReadContentControlOnDemandRatings() + : ReadAttribute("on-demand-ratings") + { + } + + ~ReadContentControlOnDemandRatings() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::OnDemandRatings::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeOnDemandRatingsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.OnDemandRatings response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl OnDemandRatings read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlOnDemandRatings : public SubscribeAttribute { +public: + SubscribeAttributeContentControlOnDemandRatings() + : SubscribeAttribute("on-demand-ratings") + { + } + + ~SubscribeAttributeContentControlOnDemandRatings() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::OnDemandRatings::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeOnDemandRatingsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.OnDemandRatings response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute OnDemandRatingThreshold + */ +class ReadContentControlOnDemandRatingThreshold : public ReadAttribute { +public: + ReadContentControlOnDemandRatingThreshold() + : ReadAttribute("on-demand-rating-threshold") + { + } + + ~ReadContentControlOnDemandRatingThreshold() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::OnDemandRatingThreshold::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeOnDemandRatingThresholdWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.OnDemandRatingThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl OnDemandRatingThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlOnDemandRatingThreshold : public SubscribeAttribute { +public: + SubscribeAttributeContentControlOnDemandRatingThreshold() + : SubscribeAttribute("on-demand-rating-threshold") + { + } + + ~SubscribeAttributeContentControlOnDemandRatingThreshold() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::OnDemandRatingThreshold::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeOnDemandRatingThresholdWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.OnDemandRatingThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ScheduledContentRatings + */ +class ReadContentControlScheduledContentRatings : public ReadAttribute { +public: + ReadContentControlScheduledContentRatings() + : ReadAttribute("scheduled-content-ratings") + { + } + + ~ReadContentControlScheduledContentRatings() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::ScheduledContentRatings::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeScheduledContentRatingsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.ScheduledContentRatings response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl ScheduledContentRatings read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlScheduledContentRatings : public SubscribeAttribute { +public: + SubscribeAttributeContentControlScheduledContentRatings() + : SubscribeAttribute("scheduled-content-ratings") + { + } + + ~SubscribeAttributeContentControlScheduledContentRatings() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::ScheduledContentRatings::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeScheduledContentRatingsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.ScheduledContentRatings response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ScheduledContentRatingThreshold + */ +class ReadContentControlScheduledContentRatingThreshold : public ReadAttribute { +public: + ReadContentControlScheduledContentRatingThreshold() + : ReadAttribute("scheduled-content-rating-threshold") + { + } + + ~ReadContentControlScheduledContentRatingThreshold() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::ScheduledContentRatingThreshold::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeScheduledContentRatingThresholdWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.ScheduledContentRatingThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl ScheduledContentRatingThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlScheduledContentRatingThreshold : public SubscribeAttribute { +public: + SubscribeAttributeContentControlScheduledContentRatingThreshold() + : SubscribeAttribute("scheduled-content-rating-threshold") + { + } + + ~SubscribeAttributeContentControlScheduledContentRatingThreshold() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::ScheduledContentRatingThreshold::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeScheduledContentRatingThresholdWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.ScheduledContentRatingThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ScreenDailyTime + */ +class ReadContentControlScreenDailyTime : public ReadAttribute { +public: + ReadContentControlScreenDailyTime() + : ReadAttribute("screen-daily-time") + { + } + + ~ReadContentControlScreenDailyTime() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::ScreenDailyTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeScreenDailyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.ScreenDailyTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl ScreenDailyTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlScreenDailyTime : public SubscribeAttribute { +public: + SubscribeAttributeContentControlScreenDailyTime() + : SubscribeAttribute("screen-daily-time") + { + } + + ~SubscribeAttributeContentControlScreenDailyTime() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::ScreenDailyTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeScreenDailyTimeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.ScreenDailyTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute RemainingScreenTime + */ +class ReadContentControlRemainingScreenTime : public ReadAttribute { +public: + ReadContentControlRemainingScreenTime() + : ReadAttribute("remaining-screen-time") + { + } + + ~ReadContentControlRemainingScreenTime() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::RemainingScreenTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeRemainingScreenTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.RemainingScreenTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl RemainingScreenTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlRemainingScreenTime : public SubscribeAttribute { +public: + SubscribeAttributeContentControlRemainingScreenTime() + : SubscribeAttribute("remaining-screen-time") + { + } + + ~SubscribeAttributeContentControlRemainingScreenTime() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::RemainingScreenTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeRemainingScreenTimeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.RemainingScreenTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute BlockUnrated + */ +class ReadContentControlBlockUnrated : public ReadAttribute { +public: + ReadContentControlBlockUnrated() + : ReadAttribute("block-unrated") + { + } + + ~ReadContentControlBlockUnrated() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::BlockUnrated::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeBlockUnratedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.BlockUnrated response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl BlockUnrated read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlBlockUnrated : public SubscribeAttribute { +public: + SubscribeAttributeContentControlBlockUnrated() + : SubscribeAttribute("block-unrated") + { + } + + ~SubscribeAttributeContentControlBlockUnrated() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::BlockUnrated::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeBlockUnratedWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.BlockUnrated response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadContentControlGeneratedCommandList : public ReadAttribute { +public: + ReadContentControlGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadContentControlGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeContentControlGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeContentControlGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadContentControlAcceptedCommandList : public ReadAttribute { +public: + ReadContentControlAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadContentControlAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeContentControlAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeContentControlAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadContentControlEventList : public ReadAttribute { +public: + ReadContentControlEventList() + : ReadAttribute("event-list") + { + } + + ~ReadContentControlEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlEventList : public SubscribeAttribute { +public: + SubscribeAttributeContentControlEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeContentControlEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadContentControlAttributeList : public ReadAttribute { +public: + ReadContentControlAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadContentControlAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeContentControlAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeContentControlAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadContentControlFeatureMap : public ReadAttribute { +public: + ReadContentControlFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadContentControlFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeContentControlFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeContentControlFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadContentControlClusterRevision : public ReadAttribute { +public: + ReadContentControlClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadContentControlClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentControl::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentControlClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeContentControlClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeContentControlClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentControl::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster ContentAppObserver | 0x0510 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ContentAppMessage | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command ContentAppMessage + */ +class ContentAppObserverContentAppMessage : public ClusterCommand { +public: + ContentAppObserverContentAppMessage() + : ClusterCommand("content-app-message") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Data", &mRequest.data); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("EncodingHint", &mRequest.encodingHint); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRContentAppObserverClusterContentAppMessageParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.data.HasValue()) { + params.data = [[NSString alloc] initWithBytes:mRequest.data.Value().data() length:mRequest.data.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.data = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.encodingHint = [[NSString alloc] initWithBytes:mRequest.encodingHint.data() length:mRequest.encodingHint.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster contentAppMessageWithParams:params completion: + ^(MTRContentAppObserverClusterContentAppMessageResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadContentAppObserverGeneratedCommandList : public ReadAttribute { +public: + ReadContentAppObserverGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadContentAppObserverGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentAppObserver GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentAppObserverGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeContentAppObserverGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeContentAppObserverGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadContentAppObserverAcceptedCommandList : public ReadAttribute { +public: + ReadContentAppObserverAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadContentAppObserverAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentAppObserver AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentAppObserverAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeContentAppObserverAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeContentAppObserverAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadContentAppObserverEventList : public ReadAttribute { +public: + ReadContentAppObserverEventList() + : ReadAttribute("event-list") + { + } + + ~ReadContentAppObserverEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentAppObserver EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentAppObserverEventList : public SubscribeAttribute { +public: + SubscribeAttributeContentAppObserverEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeContentAppObserverEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadContentAppObserverAttributeList : public ReadAttribute { +public: + ReadContentAppObserverAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadContentAppObserverAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentAppObserver AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentAppObserverAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeContentAppObserverAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeContentAppObserverAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadContentAppObserverFeatureMap : public ReadAttribute { +public: + ReadContentAppObserverFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadContentAppObserverFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentAppObserver FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentAppObserverFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeContentAppObserverFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeContentAppObserverFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadContentAppObserverClusterRevision : public ReadAttribute { +public: + ReadContentAppObserverClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadContentAppObserverClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ContentAppObserver ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeContentAppObserverClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeContentAppObserverClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeContentAppObserverClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ContentAppObserver::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ContentAppObserver::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterContentAppObserver alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentAppObserver.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ | Cluster ElectricalMeasurement | 0x0B04 | |------------------------------------------------------------------------------| @@ -173032,6 +176365,15 @@ void registerClusterChannel(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // make_unique(Id), // @@ -173089,6 +176431,8 @@ void registerClusterTargetNavigator(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(Id), // + make_unique(Id), // }; commands.RegisterCluster(clusterName, clusterCommands); @@ -173112,6 +176456,15 @@ void registerClusterMediaPlayback(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // make_unique(Id), // @@ -173129,6 +176482,22 @@ void registerClusterMediaPlayback(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // make_unique(), // @@ -173143,6 +176512,8 @@ void registerClusterMediaPlayback(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(Id), // + make_unique(Id), // }; commands.RegisterCluster(clusterName, clusterCommands); @@ -173423,9 +176794,160 @@ void registerClusterAccountLogin(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(Id), // + make_unique(Id), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} +void registerClusterContentControl(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::ContentControl; + + const char * clusterName = "ContentControl"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // }; commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} +void registerClusterContentAppObserver(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::ContentAppObserver; + + const char * clusterName = "ContentAppObserver"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL } void registerClusterElectricalMeasurement(Commands & commands) { @@ -174195,6 +177717,8 @@ void registerClusters(Commands & commands) registerClusterApplicationLauncher(commands); registerClusterApplicationBasic(commands); registerClusterAccountLogin(commands); + registerClusterContentControl(commands); + registerClusterContentAppObserver(commands); registerClusterElectricalMeasurement(commands); registerClusterUnitTesting(commands); registerClusterSampleMei(commands); 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 3f8c5a6b3730fa..5ac773479b3c86 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -80802,23 +80802,24 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster fastForwardWithCompletion: - ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - if (err != nil) { - NSLog(@"Step 3: Sends a FastForward command: Error: %@", err); - } else { - NSLog(@"Step 3: Sends a FastForward command: Success"); - } + __auto_type * params = [[MTRMediaPlaybackClusterFastForwardParams alloc] init]; + [cluster fastForwardWithParams:params completion: + ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 3: Sends a FastForward command: Error: %@", err); + } else { + NSLog(@"Step 3: Sends a FastForward command: Success"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -80894,23 +80895,24 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster fastForwardWithCompletion: - ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - if (err != nil) { - NSLog(@"Step 6: Sends a FastForward command: Error: %@", err); - } else { - NSLog(@"Step 6: Sends a FastForward command: Success"); - } + __auto_type * params = [[MTRMediaPlaybackClusterFastForwardParams alloc] init]; + [cluster fastForwardWithParams:params completion: + ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 6: Sends a FastForward command: Error: %@", err); + } else { + NSLog(@"Step 6: Sends a FastForward command: Success"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -80959,23 +80961,24 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster rewindWithCompletion: - ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - if (err != nil) { - NSLog(@"Step 8: Sends a Rewind command to the DUT: Error: %@", err); - } else { - NSLog(@"Step 8: Sends a Rewind command to the DUT: Success"); - } + __auto_type * params = [[MTRMediaPlaybackClusterRewindParams alloc] init]; + [cluster rewindWithParams:params completion: + ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 8: Sends a Rewind command to the DUT: Error: %@", err); + } else { + NSLog(@"Step 8: Sends a Rewind command to the DUT: Success"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -81051,23 +81054,24 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster rewindWithCompletion: - ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - if (err != nil) { - NSLog(@"Step 11: Sends a Rewind command to the DUT: Error: %@", err); - } else { - NSLog(@"Step 11: Sends a Rewind command to the DUT: Success"); - } + __auto_type * params = [[MTRMediaPlaybackClusterRewindParams alloc] init]; + [cluster rewindWithParams:params completion: + ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 11: Sends a Rewind command to the DUT: Error: %@", err); + } else { + NSLog(@"Step 11: Sends a Rewind command to the DUT: Success"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -82685,7 +82689,7 @@ class Test_TC_ALOGIN_12_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinLength("setupPIN", values.setupPIN, 11)); + VerifyOrReturn(CheckConstraintMinLength("setupPIN", values.setupPIN, 8)); { setupPIN = values.setupPIN; } @@ -82707,6 +82711,7 @@ class Test_TC_ALOGIN_12_1 : public TestCommandBridge { params.tempAccountIdentifier = mTempAccountIdentifier.HasValue() ? [[NSString alloc] initWithBytes:mTempAccountIdentifier.Value().data() length:mTempAccountIdentifier.Value().size() encoding:NSUTF8StringEncoding] : @"1111"; params.setupPIN = [setupPIN copy]; + params.node = mNodeId.HasValue() ? [NSNumber numberWithUnsignedLongLong:mNodeId.Value()] : [NSNumber numberWithUnsignedLongLong:305414945ULL]; [cluster loginWithParams:params completion: ^(NSError * _Nullable err) { if (err != nil) { @@ -82730,18 +82735,20 @@ class Test_TC_ALOGIN_12_1 : public TestCommandBridge { __auto_type * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device endpointID:@(3) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster logoutWithCompletion: - ^(NSError * _Nullable err) { - if (err != nil) { - NSLog(@"Step 3: TH sends a Logout command to the DUT with test values provided by the product maker.: Error: %@", err); - } else { - NSLog(@"Step 3: TH sends a Logout command to the DUT with test values provided by the product maker.: Success"); - } + __auto_type * params = [[MTRAccountLoginClusterLogoutParams alloc] init]; + params.node = mNodeId.HasValue() ? [NSNumber numberWithUnsignedLongLong:mNodeId.Value()] : [NSNumber numberWithUnsignedLongLong:305414945ULL]; + [cluster logoutWithParams:params completion: + ^(NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 3: TH sends a Logout command to the DUT with test values provided by the product maker.: Error: %@", err); + } else { + NSLog(@"Step 3: TH sends a Logout command to the DUT with test values provided by the product maker.: Success"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -82912,6 +82919,38 @@ class Test_TC_CONTENTLAUNCHER_10_3 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:false]; params.data = mData.HasValue() ? [[NSString alloc] initWithBytes:mData.Value().data() length:mData.Value().size() encoding:NSUTF8StringEncoding] : @"exampleData"; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + + params.useCurrentContext = + [NSNumber numberWithBool:false]; [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -82978,6 +83017,38 @@ class Test_TC_CONTENTLAUNCHER_10_3 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; params.data = mData.HasValue() ? [[NSString alloc] initWithBytes:mData.Value().data() length:mData.Value().size() encoding:NSUTF8StringEncoding] : @"exampleData"; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + + params.useCurrentContext = + [NSNumber numberWithBool:false]; [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -83790,6 +83861,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -83842,6 +83943,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -83894,6 +84025,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:false]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -83946,6 +84107,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -83998,6 +84189,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -84050,6 +84271,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -84102,6 +84353,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -84154,6 +84435,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -84206,6 +84517,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -84258,6 +84599,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -84310,6 +84681,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -84362,6 +84763,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -84414,6 +84845,36 @@ class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { @@ -120989,6 +121450,7 @@ class TV_AccountLoginCluster : public TestCommandBridge { __auto_type * params = [[MTRAccountLoginClusterLoginParams alloc] init]; params.tempAccountIdentifier = @"asdf"; params.setupPIN = @"tempPin123"; + params.node = mNodeId.HasValue() ? [NSNumber numberWithUnsignedLongLong:mNodeId.Value()] : [NSNumber numberWithUnsignedLongLong:305414945ULL]; [cluster loginWithParams:params completion: ^(NSError * _Nullable err) { if (err != nil) { @@ -121012,18 +121474,20 @@ class TV_AccountLoginCluster : public TestCommandBridge { __auto_type * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device endpointID:@(3) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster logoutWithCompletion: - ^(NSError * _Nullable err) { - if (err != nil) { - NSLog(@"Logout Command: Error: %@", err); - } else { - NSLog(@"Logout Command: Success"); - } + __auto_type * params = [[MTRAccountLoginClusterLogoutParams alloc] init]; + params.node = mNodeId.HasValue() ? [NSNumber numberWithUnsignedLongLong:mNodeId.Value()] : [NSNumber numberWithUnsignedLongLong:305414945ULL]; + [cluster logoutWithParams:params completion: + ^(NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Logout Command: Error: %@", err); + } else { + NSLog(@"Logout Command: Success"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -122133,28 +122597,29 @@ class TV_MediaPlaybackCluster : public TestCommandBridge { __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(3) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster rewindWithCompletion: - ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - if (err != nil) { - NSLog(@"Media Playback Rewind Command: Error: %@", err); - } else { - NSLog(@"Media Playback Rewind Command: Success"); - } + __auto_type * params = [[MTRMediaPlaybackClusterRewindParams alloc] init]; + [cluster rewindWithParams:params completion: + ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Media Playback Rewind Command: Error: %@", err); + } else { + NSLog(@"Media Playback Rewind Command: Success"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("Data", actualValue, @"data response")); - } + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("Data", actualValue, @"data response")); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -122166,28 +122631,29 @@ class TV_MediaPlaybackCluster : public TestCommandBridge { __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(3) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster fastForwardWithCompletion: - ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - if (err != nil) { - NSLog(@"Media Playback Fast Forward Command: Error: %@", err); - } else { - NSLog(@"Media Playback Fast Forward Command: Success"); - } + __auto_type * params = [[MTRMediaPlaybackClusterFastForwardParams alloc] init]; + [cluster fastForwardWithParams:params completion: + ^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Media Playback Fast Forward Command: Error: %@", err); + } else { + NSLog(@"Media Playback Fast Forward Command: Success"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } - { - id actualValue = values.data; - VerifyOrReturn(CheckValueAsString("Data", actualValue, @"data response")); - } + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("Data", actualValue, @"data response")); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -124924,6 +125390,38 @@ class TV_ContentLauncherCluster : public TestCommandBridge { params.autoPlay = [NSNumber numberWithBool:true]; params.data = @"exampleData"; + params.playbackPreferences = [[MTRContentLauncherClusterPlaybackPreferencesStruct alloc] init]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).playbackPosition = + [NSNumber numberWithUnsignedLongLong:0ULL]; + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).characteristics = temp_4; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).textTrack).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRContentLauncherClusterTrackPreferenceStruct alloc] init]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).languageCode = @"exampleLanguageCode"; + { + NSMutableArray * temp_6 = [[NSMutableArray alloc] init]; + temp_6[0] = + [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).characteristics = temp_6; + } + ((MTRContentLauncherClusterTrackPreferenceStruct *) temp_3[0]).audioOutputIndex = + [NSNumber numberWithUnsignedChar:0U]; + + ((MTRContentLauncherClusterPlaybackPreferencesStruct *) params.playbackPreferences).audioTracks = temp_3; + } + + params.useCurrentContext = + [NSNumber numberWithBool:true]; [cluster launchContentWithParams:params completion: ^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { if (err != nil) { From b5c5671717fe1ec56b705cd882ce4e152ed8a231 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 30 Nov 2023 21:02:42 +0000 Subject: [PATCH 3/3] Restyled by autopep8 --- build/chip/java/kotlinc_runner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/chip/java/kotlinc_runner.py b/build/chip/java/kotlinc_runner.py index 083df07e382a2e..da8078127aeaae 100755 --- a/build/chip/java/kotlinc_runner.py +++ b/build/chip/java/kotlinc_runner.py @@ -127,7 +127,8 @@ def main(): if classpath: kotlin_args += ["-classpath", classpath] - kotlin_args += ["-J-Xms256m", "-J-Xmx4096m", "-J-XX:MaxPermSize=350m", "-J-XX:ReservedCodeCacheSize=225m", "-J-XX:+UseCompressedOops"] + kotlin_args += ["-J-Xms256m", "-J-Xmx4096m", "-J-XX:MaxPermSize=350m", + "-J-XX:ReservedCodeCacheSize=225m", "-J-XX:+UseCompressedOops"] retcode = subprocess.check_call(kotlin_args + args.rest) if retcode != EXIT_SUCCESS: