From d987286e93851b49f7cab7c40faeac6a4fa0ddc5 Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Mon, 13 Dec 2021 22:57:47 +0100 Subject: [PATCH] Zap generate files --- .../java/zap-generated/CHIPReadCallbacks.cpp | 10 +- .../java/zap-generated/CHIPReadCallbacks.h | 2 +- .../devicecontroller/ClusterInfoMapping.java | 3 +- .../python/chip/clusters/CHIPClusters.py | 2 +- .../python/chip/clusters/Objects.py | 8 +- .../CHIPAttributeTLVValueDecoder.mm | 4 +- .../CHIP/zap-generated/CHIPCallbackBridge.mm | 6 +- .../CHIPCallbackBridge_internal.h | 2 +- .../zap-generated/CHIPTestClustersObjc.mm | 6 +- .../zap-generated/cluster-objects.h | 13 +- .../app-common/zap-generated/enums.h | 4 + .../zap-generated/cluster/Commands.h | 4 +- .../zap-generated/reporting/Commands.h | 16 +- .../chip-tool/zap-generated/test/Commands.h | 211 ++++++++++++++++++ .../zap-generated/CHIPClientCallbacks.cpp | 2 +- .../zap-generated/CHIPClientCallbacks.h | 2 +- 16 files changed, 258 insertions(+), 37 deletions(-) diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 8733a8e115e0d4..6fb44944914fc2 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -2807,7 +2807,7 @@ CHIPContentLauncherAcceptsHeaderListAttributeCallback::~CHIPContentLauncherAccep } void CHIPContentLauncherAcceptsHeaderListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -2844,13 +2844,13 @@ void CHIPContentLauncherAcceptsHeaderListAttributeCallback::CallbackFn( { auto & entry = iter.GetValue(); bool entryNull = false; - chip::ByteSpan entryValue = entry; + chip::CharSpan entryValue = entry; - jbyteArray entryObject = nullptr; + jstring entryObject = nullptr; + chip::UtfString entryStr(env, entryValue); if (!entryNull) { - entryObject = env->NewByteArray(entryValue.size()); - env->SetByteArrayRegion(entryObject, 0, entryValue.size(), reinterpret_cast(entryValue.data())); + entryObject = jstring(entryStr.jniValue()); } env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index d3b093d5678081..aac74731195d15 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -842,7 +842,7 @@ class CHIPContentLauncherAcceptsHeaderListAttributeCallback } } - static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 97631cba81c63a..18cf25c4d77cd2 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -902,8 +902,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { @Override public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo("valueList", "List"); + // Add String field here after ByteSpan is properly emitted in C++ layer responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 32704cb08376d5..7ca8cc0c416e7b 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -1364,7 +1364,7 @@ class ChipClusters: 0x00000000: { "attributeName": "AcceptsHeaderList", "attributeId": 0x00000000, - "type": "bytes", + "type": "str", "reportable": True, }, 0x00000001: { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index f7e3840c003005..df4b6c37af14f2 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -28653,14 +28653,14 @@ class ContentLauncher(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="acceptsHeaderList", Tag=0x00000000, Type=typing.List[bytes]), + ClusterObjectFieldDescriptor(Label="acceptsHeaderList", Tag=0x00000000, Type=typing.List[str]), ClusterObjectFieldDescriptor(Label="supportedStreamingProtocols", Tag=0x00000001, Type=uint), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - acceptsHeaderList: 'typing.List[bytes]' = None + acceptsHeaderList: 'typing.List[str]' = None supportedStreamingProtocols: 'uint' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None @@ -28861,9 +28861,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[bytes]) + return ClusterObjectFieldDescriptor(Type=typing.List[str]) - value: 'typing.List[bytes]' = field(default_factory=lambda: []) + value: 'typing.List[str]' = field(default_factory=lambda: []) @dataclass class SupportedStreamingProtocols(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index dccc4f2ca4a31f..c46e66fb76900f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -1948,8 +1948,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSData * newElement_0; - newElement_0 = [NSData dataWithBytes:entry_0.data() length:entry_0.size()]; + NSString * newElement_0; + newElement_0 = [[NSString alloc] initWithBytes:entry_0.data() length:entry_0.size() encoding:NSUTF8StringEncoding]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index e0987fbf4dda94..31ccde3fd02099 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -1611,15 +1611,15 @@ } void CHIPContentLauncherAcceptsHeaderListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) + void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSData * newElement_0; - newElement_0 = [NSData dataWithBytes:entry_0.data() length:entry_0.size()]; + NSString * newElement_0; + newElement_0 = [[NSString alloc] initWithBytes:entry_0.data() length:entry_0.size() encoding:NSUTF8StringEncoding]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index 863a8e9cc61fad..55562a5d2cc39a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -1830,7 +1830,7 @@ class CHIPContentLauncherAcceptsHeaderListListAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; class CHIPContentLauncherAcceptsHeaderListListAttributeCallbackSubscriptionBridge diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index 7bd9df0fdb301d..f7217d6ef9c431 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -2543,12 +2543,12 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSData class]]) { + if (![value[i_0] isKindOfClass:[NSString class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (NSData *) value[i_0]; - listHolder_0->mList[i_0] = [self asByteSpan:element_0]; + auto element_0 = (NSString *) value[i_0]; + listHolder_0->mList[i_0] = [self asCharSpan:element_0]; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { 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 791bb31edfde45..711c29949df88d 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 @@ -29769,6 +29769,13 @@ enum class ContentLaunchStatus : uint8_t using ContentLaunchStatus = EmberAfContentLaunchStatus; #endif +// Bitmap for SupportedStreamingProtocol +enum class SupportedStreamingProtocol : uint32_t +{ + kDash = 0x1, + kHls = 0x2, +}; + namespace Structs { namespace ContentLaunchDimension { enum class Fields @@ -30070,9 +30077,9 @@ namespace Attributes { namespace AcceptsHeaderList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = DataModel::List; + using DecodableType = DataModel::DecodableList; + using DecodableArgType = const DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AcceptsHeaderList::Id; } diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index 41423ccfbc687c..fe675519453d5e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -1214,6 +1214,10 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_START_TIME_TIME_ENCODING_OFFSET (6) #define EMBER_AF_START_TIME_HOURS (65280) #define EMBER_AF_START_TIME_HOURS_OFFSET (8) +#define EMBER_AF_SUPPORTED_STREAMING_PROTOCOL_DASH (1) +#define EMBER_AF_SUPPORTED_STREAMING_PROTOCOL_DASH_OFFSET (0) +#define EMBER_AF_SUPPORTED_STREAMING_PROTOCOL_HLS (2) +#define EMBER_AF_SUPPORTED_STREAMING_PROTOCOL_HLS_OFFSET (1) #define EMBER_AF_SWITCH_FEATURE_LATCHING_SWITCH (1) #define EMBER_AF_SWITCH_FEATURE_LATCHING_SWITCH_OFFSET (0) #define EMBER_AF_SWITCH_FEATURE_MOMENTARY_SWITCH (2) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index f5214a39dea4fc..1b23d8df6e42e2 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -13549,7 +13549,7 @@ class ReadContentLauncherAcceptsHeaderList : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) + static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) { OnGeneralAttributeResponse(context, "ContentLauncher.AcceptsHeaderList response", value); } @@ -13586,7 +13586,7 @@ class ReportContentLauncherAcceptsHeaderList : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) + static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) { LogValue("ContentLauncher.AcceptsHeaderList report", 0, value); } diff --git a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h index 5077ca0a7c98e5..cfa19ce6e2bae2 100644 --- a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h @@ -3092,17 +3092,17 @@ class Listen : public ReportingCommand new chip::Callback::Callback( ReadThermostatClusterRevision::OnAttributeResponse, this); chip::Callback::Callback * - onReportThermostatUserInterfaceConfigurationTemperatureDisplayModeCallback = new chip::Callback::Callback( + onReportThermostatUserInterfaceConfigurationTemperatureDisplayModeCallback = new chip::Callback::Callback< + decltype(&ReadThermostatUserInterfaceConfigurationTemperatureDisplayMode::OnAttributeResponse)>( ReadThermostatUserInterfaceConfigurationTemperatureDisplayMode::OnAttributeResponse, this); chip::Callback::Callback * onReportThermostatUserInterfaceConfigurationKeypadLockoutCallback = new chip::Callback::Callback( ReadThermostatUserInterfaceConfigurationKeypadLockout::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCallback = new chip::Callback::Callback( + chip::Callback::Callback< + decltype(&ReadThermostatUserInterfaceConfigurationScheduleProgrammingVisibility::OnAttributeResponse)> * + onReportThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCallback = new chip::Callback::Callback< + decltype(&ReadThermostatUserInterfaceConfigurationScheduleProgrammingVisibility::OnAttributeResponse)>( ReadThermostatUserInterfaceConfigurationScheduleProgrammingVisibility::OnAttributeResponse, this); chip::Callback::Callback * onReportThermostatUserInterfaceConfigurationClusterRevisionCallback = @@ -3181,8 +3181,8 @@ class Listen : public ReportingCommand new chip::Callback::Callback( ReadThreadNetworkDiagnosticsPartitionIdChangeCount::OnAttributeResponse, this); chip::Callback::Callback * - onReportThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCallback = new chip::Callback::Callback( + onReportThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCallback = new chip::Callback::Callback< + decltype(&ReadThreadNetworkDiagnosticsBetterPartitionAttachAttemptCount::OnAttributeResponse)>( ReadThreadNetworkDiagnosticsBetterPartitionAttachAttemptCount::OnAttributeResponse, this); chip::Callback::Callback * onReportThreadNetworkDiagnosticsParentChangeCountCallback = diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 497a812f64e5f5..907524826d7b1a 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -130,6 +130,7 @@ class TestList : public Command printf("TV_MediaPlaybackCluster\n"); printf("TV_TvChannelCluster\n"); printf("TV_LowPowerCluster\n"); + printf("TV_ContentLauncherCluster\n"); printf("TV_MediaInputCluster\n"); printf("TestCluster\n"); printf("TestClusterComplexTypes\n"); @@ -33967,6 +33968,215 @@ class TV_LowPowerCluster : public TestCommand void OnSuccessResponse_1() { NextTest(); } }; +class TV_ContentLauncherCluster : public TestCommand +{ +public: + TV_ContentLauncherCluster() : TestCommand("TV_ContentLauncherCluster"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TV_ContentLauncherCluster\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TV_ContentLauncherCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute accepts header list\n"); + err = TestReadAttributeAcceptsHeaderList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute supported streaming protocols\n"); + err = TestReadAttributeSupportedStreamingProtocols_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Launch Content Command\n"); + err = TestLaunchContentCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Launch URL Command\n"); + err = TestLaunchUrlCommand_4(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, const chip::app::DataModel::DecodableList & acceptsHeaderList) + { + (static_cast(context))->OnSuccessResponse_1(acceptsHeaderList); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint32_t supportedStreamingProtocols) + { + (static_cast(context))->OnSuccessResponse_2(supportedStreamingProtocols); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestReadAttributeAcceptsHeaderList_1() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::ContentLauncherClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(const chip::app::DataModel::DecodableList & acceptsHeaderList) + { + auto iter = acceptsHeaderList.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptsHeaderList", iter, 0)); + VerifyOrReturn(CheckValueAsString("acceptsHeaderList[0]", iter.GetValue(), chip::CharSpan("example", 7))); + VerifyOrReturn(CheckNextListItemDecodes("acceptsHeaderList", iter, 1)); + VerifyOrReturn(CheckValueAsString("acceptsHeaderList[1]", iter.GetValue(), chip::CharSpan("example", 7))); + VerifyOrReturn(CheckNoMoreListItems("acceptsHeaderList", iter, 2)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeSupportedStreamingProtocols_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::ContentLauncherClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint32_t supportedStreamingProtocols) + { + VerifyOrReturn(CheckValue("supportedStreamingProtocols", supportedStreamingProtocols, 0UL)); + + NextTest(); + } + + CHIP_ERROR TestLaunchContentCommand_3() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type; + + RequestType request; + request.autoPlay = true; + request.data = chip::Span("exampleDatagarbage: not in length on purpose", 11); + + request.search = chip::app::DataModel::List(); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_3(data.contentLaunchStatus, data.data); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_3(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(chip::app::Clusters::ContentLauncher::ContentLaunchStatus contentLaunchStatus, chip::CharSpan data) + { + VerifyOrReturn(CheckValue("contentLaunchStatus", contentLaunchStatus, 0)); + + VerifyOrReturn(CheckValueAsString("data", data, chip::CharSpan("exampleData", 11))); + + NextTest(); + } + + CHIP_ERROR TestLaunchUrlCommand_4() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type; + + RequestType request; + request.contentURL = chip::Span("exampleUrlgarbage: not in length on purpose", 10); + request.displayString = chip::Span("exampleDisplayStringgarbage: not in length on purpose", 20); + + request.brandingInformation = + chip::app::DataModel::List(); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_4(data.contentLaunchStatus, data.data); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_4(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(chip::app::Clusters::ContentLauncher::ContentLaunchStatus contentLaunchStatus, chip::CharSpan data) + { + VerifyOrReturn(CheckValue("contentLaunchStatus", contentLaunchStatus, 0)); + + VerifyOrReturn(CheckValueAsString("data", data, chip::CharSpan("exampleData", 11))); + + NextTest(); + } +}; + class TV_MediaInputCluster : public TestCommand { public: @@ -51737,6 +51947,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp index 5eac6a06523f14..2dd64f8bc98a5e 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp @@ -556,7 +556,7 @@ void ColorControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvDat void ContentLauncherClusterAcceptsHeaderListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { - chip::app::DataModel::DecodableList list; + chip::app::DataModel::DecodableList list; CHIP_ERROR err = Decode(*tlvData, list); if (err != CHIP_NO_ERROR) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index f2a70a965b2f17..51defa5fe813c8 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -231,7 +231,7 @@ void ContentLauncherClusterAcceptsHeaderListListAttributeFilter(chip::TLV::TLVRe chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); typedef void (*ContentLauncherAcceptsHeaderListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); + void * context, const chip::app::DataModel::DecodableList & data); void ContentLauncherClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback);