From 766248dfb65978faca9dc4a36c9e0da398a66648 Mon Sep 17 00:00:00 2001 From: Philip Gregor Date: Fri, 15 Mar 2024 11:51:58 -0700 Subject: [PATCH] ZAP-generated Matter TV Casting Cluster Commands --- examples/tv-casting-app/APIs.md | 2 +- .../project.pbxproj | 42 +- .../MatterTvCastingBridge/MCCommandObjects.h | 60 - .../MatterTvCastingBridge/MCCommandObjects.mm | 132 - .../MCCommand_Internal.h | 1 + .../MatterTvCastingBridge.h | 2 +- .../templates/MCAttributeObjects-src.zapt | 1 - .../templates/MCAttributeObjects.zapt | 2 +- .../templates/MCClusterObjects-src.zapt | 2 +- .../templates/MCClusterObjects.zapt | 6 +- .../templates/MCCommandObjects-src.zapt | 88 +- .../templates/MCCommandObjects.zapt | 30 +- .../templates/MCCommandPayloads-src.zapt | 149 ++ .../templates/MCCommandPayloads.zapt | 51 + .../templates/config-data.yaml | 4 - .../partials/command_response_type.zapt | 19 + .../templates/partials/encode_value.zapt | 64 + .../partials/init_struct_member.zapt | 19 + .../partials/renamed_struct_field_impl.zapt | 9 + .../templates/partials/struct_field_decl.zapt | 3 + .../templates/templates.json | 48 +- .../zap-generated/MCAttributeObjects.h | 2 +- .../zap-generated/MCAttributeObjects.mm | 100 - .../zap-generated/MCClusterObjects.h | 177 +- .../zap-generated/MCClusterObjects.mm | 210 ++ .../zap-generated/MCCommandObjects.h | 156 ++ .../zap-generated/MCCommandObjects.mm | 1964 ++++++++++++++ .../zap-generated/MCCommandPayloads.h | 239 ++ .../zap-generated/MCCommandPayloads.mm | 2280 +++++++++++++++++ .../MCCommandPayloads_Internal.h | 33 + .../zap-generated/MCInteractionModelStructs.h | 108 + ...tsObjc.mm => MCInteractionModelStructs.mm} | 290 ++- .../zap-generated/MCStructsObjc.h | 58 - ...entLauncherLaunchURLExampleViewModel.swift | 2 +- 34 files changed, 5940 insertions(+), 413 deletions(-) delete mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.h delete mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/command_response_type.zapt create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/init_struct_member.zapt create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/renamed_struct_field_impl.zapt create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/struct_field_decl.zapt create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads_Internal.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.h rename examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/{MCStructsObjc.mm => MCInteractionModelStructs.mm} (50%) delete mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.h diff --git a/examples/tv-casting-app/APIs.md b/examples/tv-casting-app/APIs.md index f254df1d7e2d14..a610cd5e5f66b5 100644 --- a/examples/tv-casting-app/APIs.md +++ b/examples/tv-casting-app/APIs.md @@ -915,7 +915,7 @@ if(launchURLCommand == nil) } // create the LaunchURL request -let request: MCContentLauncherClusterLaunchURLRequest = MCContentLauncherClusterLaunchURLRequest() +let request: MCContentLauncherClusterLaunchURLParams = MCContentLauncherClusterLaunchURLParams() request.contentURL = contentUrl request.displayString = displayString diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj index f55ca2b5242b20..c9113281279627 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj @@ -7,14 +7,18 @@ objects = { /* Begin PBXBuildFile section */ - 39589F162B91556B00BE040C /* MCStructsObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 39589F152B91556B00BE040C /* MCStructsObjc.h */; }; - 39589F182B91557700BE040C /* MCStructsObjc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39589F172B91557700BE040C /* MCStructsObjc.mm */; }; + 39589F162B91556B00BE040C /* MCInteractionModelStructs.h in Headers */ = {isa = PBXBuildFile; fileRef = 39589F152B91556B00BE040C /* MCInteractionModelStructs.h */; }; + 39589F182B91557700BE040C /* MCInteractionModelStructs.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39589F172B91557700BE040C /* MCInteractionModelStructs.mm */; }; 39BF57C52B8CFF790081653C /* MCAttributeObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BF57C42B8CFF790081653C /* MCAttributeObjects.h */; }; 39BF57C72B8CFFB90081653C /* MCAttributeObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39BF57C62B8CFFB90081653C /* MCAttributeObjects.mm */; }; 39BF57C92B8D66540081653C /* NSStringSpanConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BF57C82B8D66540081653C /* NSStringSpanConversion.h */; }; 39BF57CB2B8E54F80081653C /* NSDataSpanConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BF57CA2B8E54F80081653C /* NSDataSpanConversion.h */; }; 39BF57CD2B8FC0EF0081653C /* MCClusterObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BF57CC2B8FC0EF0081653C /* MCClusterObjects.h */; }; 39BF57CF2B8FC1030081653C /* MCClusterObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39BF57CE2B8FC1030081653C /* MCClusterObjects.mm */; }; + 39D4D2502B97942D00BF3CFE /* MCCommandObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 39D4D24F2B97942D00BF3CFE /* MCCommandObjects.h */; }; + 39D4D2522B97943D00BF3CFE /* MCCommandObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39D4D2512B97943D00BF3CFE /* MCCommandObjects.mm */; }; + 39DB29E92B9A3B1D0071334A /* MCCommandPayloads.h in Headers */ = {isa = PBXBuildFile; fileRef = 39DB29E82B9A3B1D0071334A /* MCCommandPayloads.h */; }; + 39DB29EB2B9A3B2D0071334A /* MCCommandPayloads.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39DB29EA2B9A3B2D0071334A /* MCCommandPayloads.mm */; }; 3C0474062B3F7E5F0012AE95 /* MCEndpointFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C0474052B3F7E5F0012AE95 /* MCEndpointFilter.h */; }; 3C04740C2B4604CF0012AE95 /* MCCryptoUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C04740B2B4604CF0012AE95 /* MCCryptoUtils.h */; }; 3C04740E2B4605B40012AE95 /* MCCryptoUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C04740D2B4605B40012AE95 /* MCCryptoUtils.mm */; }; @@ -42,8 +46,6 @@ 3C4F52282B51DB3000BB8A10 /* MCCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C4F52272B51DB3000BB8A10 /* MCCommand.h */; }; 3C4F522A2B51DFAE00BB8A10 /* MCCommand_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C4F52292B51DFAE00BB8A10 /* MCCommand_Internal.h */; }; 3C4F522C2B51E02800BB8A10 /* MCCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4F522B2B51E02800BB8A10 /* MCCommand.mm */; }; - 3C621CA12B5F6CF8005CDBA3 /* MCCommandObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CA02B5F6CF8005CDBA3 /* MCCommandObjects.h */; }; - 3C621CA32B5F6D08005CDBA3 /* MCCommandObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C621CA22B5F6D08005CDBA3 /* MCCommandObjects.mm */; }; 3C621CA52B605A6A005CDBA3 /* MCAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CA42B605A6A005CDBA3 /* MCAttribute.h */; }; 3C621CA72B605AA1005CDBA3 /* MCObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CA62B605AA1005CDBA3 /* MCObserver.h */; }; 3C621CA92B605C52005CDBA3 /* MCAttribute_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CA82B605C52005CDBA3 /* MCAttribute_Internal.h */; }; @@ -84,14 +86,19 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 39589F152B91556B00BE040C /* MCStructsObjc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCStructsObjc.h; sourceTree = ""; }; - 39589F172B91557700BE040C /* MCStructsObjc.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCStructsObjc.mm; sourceTree = ""; }; + 39589F152B91556B00BE040C /* MCInteractionModelStructs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCInteractionModelStructs.h; sourceTree = ""; }; + 39589F172B91557700BE040C /* MCInteractionModelStructs.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCInteractionModelStructs.mm; sourceTree = ""; }; + 399049A62B9FC4ED000C91F0 /* MCCommandPayloads_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommandPayloads_Internal.h; sourceTree = ""; }; 39BF57C42B8CFF790081653C /* MCAttributeObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCAttributeObjects.h; sourceTree = ""; }; 39BF57C62B8CFFB90081653C /* MCAttributeObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCAttributeObjects.mm; sourceTree = ""; }; 39BF57C82B8D66540081653C /* NSStringSpanConversion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSStringSpanConversion.h; sourceTree = ""; }; 39BF57CA2B8E54F80081653C /* NSDataSpanConversion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSDataSpanConversion.h; sourceTree = ""; }; 39BF57CC2B8FC0EF0081653C /* MCClusterObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCClusterObjects.h; sourceTree = ""; }; 39BF57CE2B8FC1030081653C /* MCClusterObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCClusterObjects.mm; sourceTree = ""; }; + 39D4D24F2B97942D00BF3CFE /* MCCommandObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommandObjects.h; sourceTree = ""; }; + 39D4D2512B97943D00BF3CFE /* MCCommandObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCommandObjects.mm; sourceTree = ""; }; + 39DB29E82B9A3B1D0071334A /* MCCommandPayloads.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommandPayloads.h; sourceTree = ""; }; + 39DB29EA2B9A3B2D0071334A /* MCCommandPayloads.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCommandPayloads.mm; sourceTree = ""; }; 3C0474052B3F7E5F0012AE95 /* MCEndpointFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCEndpointFilter.h; sourceTree = ""; }; 3C04740B2B4604CF0012AE95 /* MCCryptoUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCryptoUtils.h; sourceTree = ""; }; 3C04740D2B4605B40012AE95 /* MCCryptoUtils.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCryptoUtils.mm; sourceTree = ""; }; @@ -124,8 +131,6 @@ 3C4F52272B51DB3000BB8A10 /* MCCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommand.h; sourceTree = ""; }; 3C4F52292B51DFAE00BB8A10 /* MCCommand_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommand_Internal.h; sourceTree = ""; }; 3C4F522B2B51E02800BB8A10 /* MCCommand.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCommand.mm; sourceTree = ""; }; - 3C621CA02B5F6CF8005CDBA3 /* MCCommandObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommandObjects.h; sourceTree = ""; }; - 3C621CA22B5F6D08005CDBA3 /* MCCommandObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCommandObjects.mm; sourceTree = ""; }; 3C621CA42B605A6A005CDBA3 /* MCAttribute.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCAttribute.h; sourceTree = ""; }; 3C621CA62B605AA1005CDBA3 /* MCObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCObserver.h; sourceTree = ""; }; 3C621CA82B605C52005CDBA3 /* MCAttribute_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCAttribute_Internal.h; sourceTree = ""; }; @@ -192,8 +197,13 @@ 39BF57C62B8CFFB90081653C /* MCAttributeObjects.mm */, 39BF57CC2B8FC0EF0081653C /* MCClusterObjects.h */, 39BF57CE2B8FC1030081653C /* MCClusterObjects.mm */, - 39589F152B91556B00BE040C /* MCStructsObjc.h */, - 39589F172B91557700BE040C /* MCStructsObjc.mm */, + 39589F152B91556B00BE040C /* MCInteractionModelStructs.h */, + 39589F172B91557700BE040C /* MCInteractionModelStructs.mm */, + 39D4D24F2B97942D00BF3CFE /* MCCommandObjects.h */, + 39D4D2512B97943D00BF3CFE /* MCCommandObjects.mm */, + 39DB29E82B9A3B1D0071334A /* MCCommandPayloads.h */, + 39DB29EA2B9A3B2D0071334A /* MCCommandPayloads.mm */, + 399049A62B9FC4ED000C91F0 /* MCCommandPayloads_Internal.h */, ); path = "zap-generated"; sourceTree = ""; @@ -265,8 +275,6 @@ 3C621CA42B605A6A005CDBA3 /* MCAttribute.h */, 3C621CA82B605C52005CDBA3 /* MCAttribute_Internal.h */, 3C621CAA2B605C6E005CDBA3 /* MCAttribute.mm */, - 3C621CA02B5F6CF8005CDBA3 /* MCCommandObjects.h */, - 3C621CA22B5F6D08005CDBA3 /* MCCommandObjects.mm */, 3C4F521F2B507C4A00BB8A10 /* MCEndpointClusterType.h */, 3C4F52132B4F31DC00BB8A10 /* MCDeviceTypeStruct.h */, 3C4F52152B4F31FA00BB8A10 /* MCDeviceTypeStruct.m */, @@ -339,11 +347,13 @@ 3CF71C0E2A992DA2003A5CE5 /* MCDataSource.h in Headers */, 3C4F52142B4F31DC00BB8A10 /* MCDeviceTypeStruct.h in Headers */, 39BF57CD2B8FC0EF0081653C /* MCClusterObjects.h in Headers */, + 39D4D2502B97942D00BF3CFE /* MCCommandObjects.h in Headers */, 3C26AC8C2926FE0C00BA6881 /* DeviceAttestationCredentialsProviderImpl.hpp in Headers */, 3C621CA52B605A6A005CDBA3 /* MCAttribute.h in Headers */, 3CD73F1C2A9E8396009D82D1 /* MCCommissionableDataProvider.h in Headers */, 3C4F521E2B4F4B3B00BB8A10 /* MCEndpoint_Internal.h in Headers */, 39BF57C92B8D66540081653C /* NSStringSpanConversion.h in Headers */, + 39DB29E92B9A3B1D0071334A /* MCCommandPayloads.h in Headers */, 3C4F52262B50899700BB8A10 /* MCCluster_Internal.h in Headers */, 3CF71C0A2A992D0D003A5CE5 /* MCCastingApp.h in Headers */, 3C4F521C2B4F4B1B00BB8A10 /* MCCastingPlayer_Internal.h in Headers */, @@ -357,7 +367,7 @@ 3CD73F202A9EA060009D82D1 /* MCDeviceAttestationCredentials.h in Headers */, 3CCB8740286A593700771BAD /* CastingServerBridge.h in Headers */, 3CE5ECCE2A673B30007CF331 /* CommissioningCallbackHandlers.h in Headers */, - 39589F162B91556B00BE040C /* MCStructsObjc.h in Headers */, + 39589F162B91556B00BE040C /* MCInteractionModelStructs.h in Headers */, 3CCB8742286A593700771BAD /* ConversionUtils.hpp in Headers */, 3C621CA72B605AA1005CDBA3 /* MCObserver.h in Headers */, 3C9437922B3B478E0096E5F4 /* MCErrorUtils.h in Headers */, @@ -365,7 +375,6 @@ 3CCB8741286A593700771BAD /* DiscoveredNodeData.h in Headers */, 3C0474062B3F7E5F0012AE95 /* MCEndpointFilter.h in Headers */, 3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */, - 3C621CA12B5F6CF8005CDBA3 /* MCCommandObjects.h in Headers */, 3C4F52202B507C4A00BB8A10 /* MCEndpointClusterType.h in Headers */, 3C6920462AA1093300D0F613 /* MCDeviceAttestationCredentialsProvider.h in Headers */, 39BF57C52B8CFF790081653C /* MCAttributeObjects.h in Headers */, @@ -475,13 +484,13 @@ 3CE5ECD02A673E2C007CF331 /* CommissioningCallbackHandlers.m in Sources */, 39BF57CF2B8FC1030081653C /* MCClusterObjects.mm in Sources */, 3CD73F192A9E68A7009D82D1 /* MCRotatingDeviceIdUniqueIdProvider.mm in Sources */, - 39589F182B91557700BE040C /* MCStructsObjc.mm in Sources */, + 39589F182B91557700BE040C /* MCInteractionModelStructs.mm in Sources */, + 39DB29EB2B9A3B2D0071334A /* MCCommandPayloads.mm in Sources */, 3CF8532728E37F1000F07B9F /* MatterError.mm in Sources */, 3C4F522C2B51E02800BB8A10 /* MCCommand.mm in Sources */, 3C4E53B628E5595A00F293E8 /* ContentLauncherTypes.mm in Sources */, 3C81C75028F7A7D3001CB9D1 /* VideoPlayer.m in Sources */, 3CCB8744286A593700771BAD /* ConversionUtils.mm in Sources */, - 3C621CA32B5F6D08005CDBA3 /* MCCommandObjects.mm in Sources */, 3CF71C0C2A992D25003A5CE5 /* MCCastingApp.mm in Sources */, 3C621CAB2B605C6E005CDBA3 /* MCAttribute.mm in Sources */, 3C4F52122B4E18ED00BB8A10 /* MCEndpoint.mm in Sources */, @@ -498,6 +507,7 @@ 3C26AC9329282B8100BA6881 /* DeviceAttestationCredentialsHolder.m in Sources */, 3C26AC902927008900BA6881 /* DeviceAttestationCredentialsProviderImpl.mm in Sources */, 3CCB873F286A593700771BAD /* DiscoveredNodeData.mm in Sources */, + 39D4D2522B97943D00BF3CFE /* MCCommandObjects.mm in Sources */, 3C4F52162B4F31FA00BB8A10 /* MCDeviceTypeStruct.m in Sources */, 3C2696FB2B4A5FC50026E771 /* MCEndpointFilter.m in Sources */, 3C81C74C28F7A777001CB9D1 /* ContentApp.mm in Sources */, diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.h deleted file mode 100644 index c600d151febf1f..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * - * Copyright (c) 2020-2024 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MCCommand.h" -#import - -#ifndef MCCommandObjects_h -#define MCCommandObjects_h - -@interface MCContentLauncherClusterDimensionStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull width; -@property (nonatomic, copy) NSNumber * _Nonnull height; -@property (nonatomic, copy) NSNumber * _Nonnull metric; -@end - -@interface MCContentLauncherClusterStyleInformationStruct : NSObject -@property (nonatomic, copy) NSString * _Nullable imageURL; -@property (nonatomic, copy) NSString * _Nullable imageUrl; -@property (nonatomic, copy) NSString * _Nullable color; -@property (nonatomic, copy) MCContentLauncherClusterDimensionStruct * _Nullable size; -@end - -@interface MCContentLauncherClusterBrandingInformationStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull providerName; -@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable background; -@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable logo; -@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable progressBar; -@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable splash; -@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable waterMark; -@end - -@interface MCContentLauncherClusterLaunchURLRequest : NSObject -@property (nonatomic, copy) NSString * _Nonnull contentURL; -@property (nonatomic, copy) NSString * _Nullable displayString; -@property (nonatomic, copy) MCContentLauncherClusterBrandingInformationStruct * _Nullable brandingInformation; -@end - -@interface MCContentLauncherClusterLauncherResponse : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull status; -@property (nonatomic, copy) NSString * _Nullable data; -@end - -@interface MCContentLauncherClusterLaunchURLCommand : MCCommand -@end - -#endif /* MCCommandObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.mm deleted file mode 100644 index 8c37d0911668fb..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommandObjects.mm +++ /dev/null @@ -1,132 +0,0 @@ -/** - * - * Copyright (c) 2024 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "MCCommandObjects.h" - -#import "MCCastingApp.h" -#import "MCCommand_Internal.h" -#import "MCErrorUtils.h" - -#include "core/Command.h" -#include - -#import - -@implementation MCContentLauncherClusterLaunchURLRequest - -- (instancetype)init -{ - if (self = [super init]) { - _contentURL = @""; - _displayString = nil; - _brandingInformation = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MCContentLauncherClusterLaunchURLRequest alloc] init]; - other.contentURL = self.contentURL; - other.displayString = self.displayString; - other.brandingInformation = self.brandingInformation; - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: contentURL:%@; displayString:%@; brandingInformation:%@; >", NSStringFromClass([self class]), _contentURL, _displayString, _brandingInformation]; - return descriptionString; -} -@end - -@implementation MCContentLauncherClusterLauncherResponse - -- (instancetype)init -{ - if (self = [super init]) { - _status = @(0); - _data = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MCContentLauncherClusterLauncherResponse alloc] init]; - - other.status = self.status; - other.data = self.data; - return other; -} - -- (instancetype)initWithDecodableStruct:(const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType &)decodableStruct -{ - if (self = [super init]) { - _status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; - _data = [[NSString alloc] initWithBytes:decodableStruct.data.Value().data() length:decodableStruct.data.Value().size() encoding:NSUTF8StringEncoding]; - } - return self; -} - -@end - -@implementation MCContentLauncherClusterLaunchURLCommand - -- (void)invoke:(id)request - context:(void * _Nullable)context - completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion - timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs -{ - MCCommandTemplate * mcCommand = new MCCommandTemplate( - self.cppCommand, - [self](id objCRequest) { - return [self getCppRequestFromObjC:objCRequest]; - }, - [self](std::any cppResponse) { - return [self getObjCResponseFromCpp:cppResponse]; - }); - mcCommand->invoke( - request, context, [mcCommand, completion](void * context, NSError * err, id response) { - completion(context, err, response); - delete mcCommand; - }, timedInvokeTimeoutMs); -} - -- (std::any)getCppRequestFromObjC:(MCContentLauncherClusterLaunchURLRequest *)objcRequest -{ - VerifyOrReturnValue(objcRequest != nil, nullptr); - - std::shared_ptr cppRequest = std::make_shared(); - cppRequest->contentURL = chip::CharSpan([objcRequest.contentURL UTF8String], [objcRequest.contentURL lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); - if (objcRequest.displayString != nil) { - cppRequest->displayString = chip::Optional(chip::CharSpan([objcRequest.displayString UTF8String], [objcRequest.displayString lengthOfBytesUsingEncoding:NSUTF8StringEncoding])); - } - cppRequest->brandingInformation = chip::MakeOptional(chip::app::Clusters::ContentLauncher::Structs::BrandingInformationStruct::Type()); // TODO: map brandingInformation - return std::any(cppRequest); -} - -- (id)getObjCResponseFromCpp:(std::any)cppResponse -{ - MCContentLauncherClusterLauncherResponse * objCResponse = nil; - if (cppResponse.type() == typeid(std::shared_ptr)) { - std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); - objCResponse = responseSharedPtr != nil ? [[MCContentLauncherClusterLauncherResponse alloc] initWithDecodableStruct:*responseSharedPtr] : nil; - } - return objCResponse; -} -@end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommand_Internal.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommand_Internal.h index 384004467fef30..6665c8c52ea8c9 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommand_Internal.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCommand_Internal.h @@ -75,6 +75,7 @@ class MCCommandTemplate { *cppRequest, context, [clientQueue, completion, this](void * context, const typename Type::ResponseType & response) { ChipLogProgress(AppServer, " converting 'response' from Cpp to ObjC"); + // Get cpp response here. id objCResponse = mGetObjCResponseFromCppFn(std::any(std::make_shared(response))); dispatch_async(clientQueue, ^{ completion(context, nil, objCResponse); diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h index 19db166102a973..851b94606d628a 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h @@ -32,7 +32,6 @@ FOUNDATION_EXPORT const unsigned char MatterTvCastingBridgeVersionString[]; #import "MCCastingPlayerDiscovery.h" #import "MCCluster.h" #import "MCCommand.h" -#import "MCCommandObjects.h" #import "MCCommissionableData.h" #import "MCCryptoUtils.h" #import "MCDataSource.h" @@ -42,3 +41,4 @@ FOUNDATION_EXPORT const unsigned char MatterTvCastingBridgeVersionString[]; #import "MCObserver.h" #import "zap-generated/MCAttributeObjects.h" #import "zap-generated/MCClusterObjects.h" +#import "zap-generated/MCCommandObjects.h" diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt index 90b0f400523ae9..c6feac39dc1fcc 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects-src.zapt @@ -57,7 +57,6 @@ if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::{{asUpperCamelCase ../name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo::DecodableType _cppValue = *sharedPtr; - //auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; {{asObjectiveCType type parent.name structTypePrefix="MC"}} value; {{>decode_value target="value" source="_cppValue" cluster=parent.name errorCode="*aError = err; return nil;" depth=0}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt index 37390b3e4cb004..b743625bed8f9b 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCAttributeObjects.zapt @@ -1,6 +1,6 @@ {{> header excludeZapComment=false}} -#import "MCStructsObjc.h" +#import "MCInteractionModelStructs.h" #import "../MCAttribute.h" #import diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt index 0b9207e4e72244..5d74b4b74bda66 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects-src.zapt @@ -23,8 +23,8 @@ // {{asUpperCamelCase name}} cluster commands: {{#zcl_commands}} +{{#if (is_str_equal source 'client')}} {{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} -{{#if (isInConfigList name "MatterCastingImplementedCommands")}} - (id){{asMethodName name}}Command { diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt index a4ecab1d389625..2fe9cf78fea8bb 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCClusterObjects.zapt @@ -1,8 +1,8 @@ {{> header excludeZapComment=false}} -#import "MCAttributeObjects.h" #import "../MCCluster.h" -#import "../MCCommandObjects.h" +#import "MCAttributeObjects.h" +#import "MCCommandObjects.h" #import #ifndef MCClusterObjects_h @@ -19,8 +19,8 @@ // {{asUpperCamelCase name}} cluster commands: {{#zcl_commands}} +{{#if (is_str_equal source 'client')}} {{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} -{{#if (isInConfigList name "MatterCastingImplementedCommands")}} /** * @brief Returns non-nil pointer to MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command if supported, nil otherwise. diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt index 21eab792b8c2f2..60d63d5fb6fe12 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects-src.zapt @@ -1,3 +1,89 @@ {{> header excludeZapComment=false}} -// TODO: To be implemented in the following PR. +#import "MCCommandObjects.h" +#import "MCCommandPayloads.h" +#import "MCCommandPayloads_internal.h" + +#import "../MCCastingApp.h" +#import "../MCCommand_Internal.h" +#import "../MCErrorUtils.h" + +#include "core/Command.h" +#include + +#import + +@implementation MCNullObjectType +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + return CHIP_NO_ERROR; +} +@end + +{{#zcl_clusters}} +{{#if (isSupported (asUpperCamelCase name))}} +{{#if (isInConfigList name "MatterCastingClusters")}} + +// {{asUpperCamelCase name}} cluster: + +{{#zcl_commands}} +{{#if (is_str_equal source 'client')}} +{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} +@implementation MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Params *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto& cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast& e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + {{>command_response_type command=.}} * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[{{>command_response_type command=.}} alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +{{/if}} +{{/if}} +{{/zcl_commands}} +{{/if}} +{{/if}} +{{/zcl_clusters}} \ No newline at end of file diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt index 21eab792b8c2f2..30c746c345c0e4 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandObjects.zapt @@ -1,3 +1,31 @@ {{> header excludeZapComment=false}} -// TODO: To be implemented in the following PR. +#import "../MCCommand.h" +#import "MCCommandPayloads.h" +#import + +#ifndef MCCommandObjects_h +#define MCCommandObjects_h + +@interface MCNullObjectType : NSObject +@end + +{{#zcl_clusters}} +{{#if (isSupported (asUpperCamelCase name))}} +{{#if (isInConfigList name "MatterCastingClusters")}} + +// {{asUpperCamelCase name}} cluster: + +{{#zcl_commands}} +{{#if (is_str_equal source 'client')}} +{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} +@interface MC{{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase name}}Command : MCCommand command_response_type command=.}} *> +@end + +{{/if}} +{{/if}} +{{/zcl_commands}} +{{/if}} +{{/if}} +{{/zcl_clusters}} +#endif /* MCCommandObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt new file mode 100644 index 00000000000000..51b6428d5ba67d --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads-src.zapt @@ -0,0 +1,149 @@ +{{> header excludeZapComment=false}} + +#import "MCCommandPayloads_Internal.h" + +#import "../MCAttribute_Internal.h" +#import "../MCCastingApp.h" +#import "../MCErrorUtils.h" +#import "../NSDataSpanConversion.h" +#import "../NSStringSpanConversion.h" + +#include +#include +#include +#include +#include + +NS_ASSUME_NONNULL_BEGIN + +@implementation MCAbstractPayload +- (std::any)getCppRequestFromObjCRequest +{ + return nil; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + return CHIP_NO_ERROR; +} + +- (nonnull id)copyWithZone:(nullable NSZone *)zone +{ + auto other = [[MCAbstractPayload alloc] init]; + + return other; +} +@end + +{{#zcl_clusters}} +{{#if (isInConfigList name "MatterCastingClusters")}} + +// {{asUpperCamelCase name}} cluster: +{{#zcl_commands}} + +{{#*inline "completeImpl"}} +{{#if (isSupported cluster command=command isForCommandPayload=true)}} +@implementation MC{{cluster}}Cluster{{command}}Params +- (instancetype)init +{ + if (self = [super init]) { +{{#zcl_command_arguments}} + + {{>init_struct_member label=label type=type cluster=parent.parent.name}} +{{/zcl_command_arguments}} +{{#if (or (isStrEqual source "client") + (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}} +{{/if}} +{{#if (isStrEqual source "client")}} +{{/if}} + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MC{{cluster}}Cluster{{command}}Params alloc] init]; + + {{#zcl_command_arguments}} + other.{{asStructPropertyName label}} = self.{{asStructPropertyName label}}; + {{/zcl_command_arguments}} + + return other; +} + +- (NSString *)description +{ + NSString *descriptionString = [NSString stringWithFormat:@"<%@: {{#zcl_command_arguments}}{{asStructPropertyName label}}:%@; {{/zcl_command_arguments}}>", NSStringFromClass([self class]) {{#zcl_command_arguments}},{{#if isArray}}_{{asStructPropertyName label}}{{else if (isOctetString type)}}[_{{asStructPropertyName label}} base64EncodedStringWithOptions:0]{{else}}_{{asStructPropertyName label}}{{/if}}{{/zcl_command_arguments}}]; + return descriptionString; +} +{{#zcl_command_arguments}} +{{#if (and includeRenamedProperties + (hasOldName ../cluster command=../command commandField=(asStructPropertyName label)))}} + +{{> renamed_struct_field_impl cluster=parent.parent.name type=type newName=label oldName=(oldName ../cluster command=../command commandField=(asStructPropertyName label))}} +{{/if}} +{{/zcl_command_arguments}} + +{{#if (isStrEqual source "client")}} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Type cppStruct; + ListFreer listFreer; + {{#zcl_command_arguments}} + { + {{>encode_value target=(concat "cppStruct." (asLowerCamelCase label)) source=(concat "self." (asStructPropertyName label)) cluster=parent.parent.name errorCode="return CHIP_ERROR_INVALID_ARGUMENT;" depth=0}} + } + {{/zcl_command_arguments}} + + return std::any(cppStruct); +} +{{else}} + +- (std::any)getCppRequestFromObjCRequest { + // Default implementation + return CHIP_NO_ERROR; +} +{{/if}} +{{#if (isStrEqual source "server")}} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType &)cppDecodableStruct +{ + {{#zcl_command_arguments}} + { + {{>decode_value target=(concat "self." (asStructPropertyName label)) source=(concat "cppDecodableStruct." (asLowerCamelCase label)) cluster=parent.parent.name errorCode="return err;" depth=0}} + } + {{/zcl_command_arguments}} + return CHIP_NO_ERROR; +} +{{else}} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +{{/if}} +@end +{{/if}} +{{/inline}} + +{{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForCommandPayload=true)}} +{{> completeImpl cluster=(asUpperCamelCase parent.name preserveAcronyms=true) + command=(asUpperCamelCase name preserveAcronyms=true) + includeRenamedProperties=false}} + +{{#if (or (not (isStrEqual (asUpperCamelCase parent.name preserveAcronyms=true) (compatClusterNameRemapping parent.name))) + (not (isStrEqual (asUpperCamelCase name preserveAcronyms=true) (compatCommandNameRemapping parent.name name))))}} +{{/if}} + +{{else}} +{{> completeImpl cluster=(compatClusterNameRemapping parent.name) + command=(compatCommandNameRemapping parent.name name) + includeRenamedProperties=true}} +{{/if}} +{{/zcl_commands}} +{{/if}} +{{/zcl_clusters}} + +NS_ASSUME_NONNULL_END diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt new file mode 100644 index 00000000000000..6497f0819fda39 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/MCCommandPayloads.zapt @@ -0,0 +1,51 @@ +{{> header excludeZapComment=false}} + +#import "MCInteractionModelStructs.h" + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MCAbstractPayload : NSObject +@end + +{{#zcl_clusters}} +{{#if (isInConfigList name "MatterCastingClusters")}} + +// {{asUpperCamelCase name}} cluster: +{{#zcl_commands}} +{{#*inline "completeDecl"}} +{{#if (isSupported cluster command=command isForCommandPayload=true)}} + +@interface MC{{cluster}}Cluster{{command}}Params : {{base}} +{{#zcl_command_arguments}} +{{#if (isSupported ../cluster command=../command commandField=(asStructPropertyName label))}} +{{> struct_field_decl cluster=parent.parent.name type=type label=label}}; +{{/if}} +{{#*inline "oldNameFieldDecl"}} +{{#if (isSupported ../cluster command=../command commandField=commandField)}} +{{> struct_field_decl cluster=parent.parent.name type=type label=commandField}}; +{{/if}} +{{/inline}} +{{#if (and includeRenamedProperties + (hasOldName ../cluster command=../command commandField=(asStructPropertyName label)))}} +{{> oldNameFieldDecl commandField=(oldName ../cluster command=../command commandField=(asStructPropertyName label))}} +{{/if}} +{{/zcl_command_arguments}} +@end +{{/if}} +{{/inline}} +{{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}} +{{> completeDecl cluster=(asUpperCamelCase parent.name preserveAcronyms=true) + command=(asUpperCamelCase name preserveAcronyms=true) + includeRenamedProperties=false + deprecationMessage="This command has been removed" + base="MCAbstractPayload" + includeInitWithResponseValue=true}} +{{/if}} +{{/zcl_commands}} +{{/if}} +{{/zcl_clusters}} + +NS_ASSUME_NONNULL_END diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/config-data.yaml b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/config-data.yaml index b45974c3596d0a..3db5f649040ae3 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/config-data.yaml +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/config-data.yaml @@ -30,7 +30,3 @@ MatterCastingClusters: - On/Off - Target Navigator - Wake on LAN - -# The commands currently implemented for Matter Casting in MCCommandObjects.h/mm. We will ZAP generate this file in the next PR. -MatterCastingImplementedCommands: - - LaunchURL diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/command_response_type.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/command_response_type.zapt new file mode 100644 index 00000000000000..88d1719bb5aff6 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/command_response_type.zapt @@ -0,0 +1,19 @@ +{{#if command.hasSpecificResponse}} +{{#*inline "clusterName"}} +{{~#if compatRemapNames~}} +{{compatClusterNameRemapping command.parent.name}} +{{~else~}} +{{asUpperCamelCase command.parent.name preserveAcronyms=true}} +{{~/if~}} +{{/inline}} +{{#*inline "responseName"}} +{{~#if compatRemapNames~}} +{{compatCommandNameRemapping command.parent.name command.responseName}} +{{~else~}} +{{asUpperCamelCase command.responseName preserveAcronyms=true}} +{{~/if~}} +{{/inline}} +MC{{> clusterName}}Cluster{{> responseName}}Params +{{else}} +MCNullObjectType +{{/if}} \ No newline at end of file diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt new file mode 100644 index 00000000000000..660db334188686 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/encode_value.zapt @@ -0,0 +1,64 @@ +{{#if isOptional}} + if ({{source}} != nil) { + auto & definedValue_{{depth}} = {{target}}.Emplace(); + {{>encode_value target=(concat "definedValue_" depth) source=source cluster=cluster errorCode=errorCode depth=(incrementDepth depth) isOptional=false}} + } +{{else if isNullable}} + if ({{source}} == nil) { + {{target}}.SetNull(); + } else { + auto & nonNullValue_{{depth}} = {{target}}.SetNonNull(); + {{>encode_value target=(concat "nonNullValue_" depth) source=source cluster=cluster errorCode=errorCode depth=(incrementDepth depth) isNullable=false}} + } +{{else if isArray}} + {{! TODO: This is not great, with its fallible allocation and + whatnot. Maybe we should just switch to encoding our ObjC types + directly to TLV... We need the listFreer thing because we want + our allocation to live long enough, and if it's scoped to where + we are right now it may not (e.g. for a nullable list we're + inside an "else" block here). }} + { + using ListType_{{depth}} = std::remove_reference_t; + using ListMemberType_{{depth}} = ListMemberTypeGetter::Type; + if ({{source}}.count != 0) { + auto * listHolder_{{depth}} = new ListHolder({{source}}.count); + if (listHolder_{{depth}} == nullptr || listHolder_{{depth}}->mList == nullptr) { + {{errorCode}} + } + listFreer.add(listHolder_{{depth}}); + for (size_t i_{{depth}} = 0; i_{{depth}} < {{source}}.count; ++i_{{depth}}) { + if ( ! [{{source}}[i_{{depth}}] isKindOfClass: [{{asObjectiveCClass type cluster forceNotList=true structTypePrefix="MC"}} class]] ) { + // Wrong kind of value. + {{errorCode}} + } + auto element_{{depth}} = ({{asObjectiveCClass type cluster forceNotList=true structTypePrefix="MC"}} *){{source}}[i_{{depth}}]; + {{>encode_value target=(concat "listHolder_" depth "->mList[i_" depth "]") source=(concat "element_" depth) cluster=cluster errorCode=errorCode depth=(incrementDepth depth) isArray=false}} + } + {{target}} = ListType_{{depth}}(listHolder_{{depth}}->mList, {{source}}.count); + } else { + {{target}} = ListType_{{depth}}(); + } + } +{{else if (isOctetString type)}} + {{target}} = AsByteSpan({{source}}); +{{else if (isCharString type)}} + {{target}} = AsCharSpan({{source}}); +{{else}} + {{#if_is_struct type}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + {{#if (isSupported (asUpperCamelCase ../cluster preserveAcronyms=true) struct=(asUpperCamelCase ../type preserveAcronyms=true) structField=(asStructPropertyName label))}} + {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "." (asStructPropertyName label)) cluster=../cluster errorCode=../errorCode depth=(incrementDepth ../depth)}} + {{/if}} + {{/zcl_struct_items_by_struct_and_cluster_name}} + {{else}} + {{#if_is_strongly_typed_chip_enum type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); + {{else}} + {{#if_is_strongly_typed_bitmap type}} + {{target}} = static_cast>({{source}}.{{asObjectiveCNumberType source type true}}Value); + {{else}} + {{target}} = {{source}}.{{asObjectiveCNumberType source type true}}Value; + {{/if_is_strongly_typed_bitmap}} + {{/if_is_strongly_typed_chip_enum}} + {{/if_is_struct}} +{{/if}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/init_struct_member.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/init_struct_member.zapt new file mode 100644 index 00000000000000..001cac7231e12a --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/init_struct_member.zapt @@ -0,0 +1,19 @@ +{{#*inline "memberName"}}_{{asStructPropertyName label}}{{/inline}} +{{#if isOptional}} +{{>memberName}} = nil; +{{else if isNullable}} +{{>memberName}} = nil; +{{else if isArray}} + {{>memberName}} = [NSArray array]; +{{else if (isOctetString type)}} + {{>memberName}} = [NSData data]; +{{else if (isCharString type)}} + {{>memberName}} = @""; +{{else}} + {{! Our memberName inline partial won't work inside the async if_is_struct }} + {{#if_is_struct type}} + _{{asStructPropertyName label}} = [{{asObjectiveCClass type cluster structTypePrefix="MC"}} new]; + {{else}} + _{{asStructPropertyName label}} = @(0); + {{/if_is_struct}} +{{/if}} \ No newline at end of file diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/renamed_struct_field_impl.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/renamed_struct_field_impl.zapt new file mode 100644 index 00000000000000..0b2650a91fb672 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/renamed_struct_field_impl.zapt @@ -0,0 +1,9 @@ +- (void)set{{asUpperCamelCase oldName}}:({{asObjectiveCType type cluster structTypePrefix="MC"}}){{asStructPropertyName oldName}} +{ + self.{{asStructPropertyName newName}} = {{asStructPropertyName oldName}}; +} + +- ({{asObjectiveCType type cluster structTypePrefix="MC"}}){{asGetterName oldName}} +{ + return self.{{asStructPropertyName newName}}; +} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/struct_field_decl.zapt b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/struct_field_decl.zapt new file mode 100644 index 00000000000000..19fa66c2623844 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/partials/struct_field_decl.zapt @@ -0,0 +1,3 @@ +{{! Override the getter name because some of our properties start with things + like "new" or "init" }} +@property (nonatomic, copy{{#unless (isStrEqual (asGetterName label) (asStructPropertyName label))}}, getter={{asGetterName label}}{{/unless}}) {{asObjectiveCType type cluster structTypePrefix="MC"}} {{asStructPropertyName label}} {{! Caller provides availability~}} diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json index 881ac388a1be83..c9a56ea0ee7173 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/templates/templates.json @@ -20,31 +20,71 @@ "name": "header", "path": "../../../../../../src/app/zap-templates/partials/header.zapt" }, + { + "name": "command_response_type", + "path": "partials/command_response_type.zapt" + }, { "name": "decode_value", "path": "partials/decode_value.zapt" + }, + { + "name": "encode_value", + "path": "partials/encode_value.zapt" + }, + { + "name": "init_struct_member", + "path": "partials/init_struct_member.zapt" + }, + { + "name": "renamed_struct_field_impl", + "path": "partials/renamed_struct_field_impl.zapt" + }, + { + "name": "struct_field_decl", + "path": "partials/struct_field_decl.zapt" } ], "templates": [ { "path": "MCAttributeObjects.zapt", - "name": "Objc ZCL asynchronous API Internal Header", + "name": "Objc MC attribute objects header", "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h" }, { "path": "MCAttributeObjects-src.zapt", - "name": "Objc ZCL asynchronous API Internal Header", + "name": "Objc MC attribute objects", "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.mm" }, { "path": "MCClusterObjects.zapt", - "name": "Objc ZCL asynchronous API Internal Header", + "name": "Objc MC cluster objects header", "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h" }, { "path": "MCClusterObjects-src.zapt", - "name": "Objc ZCL asynchronous API Internal Header", + "name": "Objc MC cluster objects", "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.mm" + }, + { + "path": "MCCommandObjects.zapt", + "name": "Objc MC command objects header", + "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h" + }, + { + "path": "MCCommandObjects-src.zapt", + "name": "Objc MC command objects", + "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm" + }, + { + "path": "MCCommandPayloads.zapt", + "name": "Objc reflections of MC command payloads header", + "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h" + }, + { + "path": "MCCommandPayloads-src.zapt", + "name": "Objc reflections of MC command payloads", + "output": "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm" } ] } diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h index 81184fe023ffcb..d11580a6e82bc3 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h @@ -17,7 +17,7 @@ // THIS FILE IS GENERATED BY ZAP -#import "MCStructsObjc.h" +#import "MCInteractionModelStructs.h" #import "../MCAttribute.h" #import diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.mm index e5191ee0bbaba7..fc563f52649d95 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.mm @@ -68,7 +68,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::OnOff::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithBool:_cppValue]; @@ -115,7 +114,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithBool:_cppValue]; @@ -162,7 +160,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -209,7 +206,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -256,7 +252,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -307,7 +302,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -369,7 +363,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -431,7 +424,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -493,7 +485,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -555,7 +546,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -602,7 +592,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::OnOff::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -651,7 +640,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -702,7 +690,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::RemainingTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -749,7 +736,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:_cppValue]; @@ -796,7 +782,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:_cppValue]; @@ -843,7 +828,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -890,7 +874,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::MinFrequency::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -937,7 +920,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::MaxFrequency::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -984,7 +966,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:_cppValue.Raw()]; @@ -1031,7 +1012,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -1078,7 +1058,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -1129,7 +1108,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -1180,7 +1158,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -1231,7 +1208,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -1282,7 +1258,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -1333,7 +1308,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1395,7 +1369,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1457,7 +1430,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1519,7 +1491,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1581,7 +1552,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -1628,7 +1598,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::LevelControl::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -1677,7 +1646,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::MACAddress::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSString * _Nonnull value; value = AsString(_cppValue); @@ -1729,7 +1697,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::LinkLocalAddress::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSData * _Nonnull value; value = AsData(_cppValue); @@ -1776,7 +1743,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1838,7 +1804,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1900,7 +1865,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -1962,7 +1926,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2024,7 +1987,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -2071,7 +2033,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::WakeOnLan::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -2120,7 +2081,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2189,7 +2149,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:_cppValue]; @@ -2236,7 +2195,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2298,7 +2256,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2360,7 +2317,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2422,7 +2378,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -2484,7 +2439,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -2531,7 +2485,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::TargetNavigator::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -2580,7 +2533,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:chip::to_underlying(_cppValue)]; @@ -2627,7 +2579,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -2678,7 +2629,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -2729,7 +2679,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; MCMediaPlaybackClusterPlaybackPositionStruct * _Nullable value; if (_cppValue.IsNull()) { @@ -2786,7 +2735,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithFloat:_cppValue]; @@ -2833,7 +2781,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -2884,7 +2831,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nullable value; if (_cppValue.IsNull()) { @@ -2935,7 +2881,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; MCMediaPlaybackClusterTrackStruct * _Nullable value; if (_cppValue.IsNull()) { @@ -3017,7 +2962,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nullable value; if (_cppValue.IsNull()) { @@ -3114,7 +3058,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; MCMediaPlaybackClusterTrackStruct * _Nullable value; if (_cppValue.IsNull()) { @@ -3196,7 +3139,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nullable value; if (_cppValue.IsNull()) { @@ -3293,7 +3235,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3355,7 +3296,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3417,7 +3357,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3479,7 +3418,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3541,7 +3479,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -3588,7 +3525,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::MediaPlayback::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -3637,7 +3573,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3699,7 +3634,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3761,7 +3695,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3823,7 +3756,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -3885,7 +3817,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -3932,7 +3863,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::KeypadInput::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -3981,7 +3911,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::AcceptHeader::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4048,7 +3977,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue.Raw()]; @@ -4095,7 +4023,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4157,7 +4084,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4219,7 +4145,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4281,7 +4206,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4343,7 +4267,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -4390,7 +4313,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ContentLauncher::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -4439,7 +4361,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::CatalogList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4501,7 +4422,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::CurrentApp::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; MCApplicationLauncherClusterApplicationEPStruct * _Nullable value; if (_cppValue.IsNull()) { @@ -4565,7 +4485,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4627,7 +4546,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4689,7 +4607,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4751,7 +4668,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -4813,7 +4729,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -4860,7 +4775,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationLauncher::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -4909,7 +4823,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSString * _Nonnull value; value = AsString(_cppValue); @@ -4961,7 +4874,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:chip::to_underlying(_cppValue)]; @@ -5008,7 +4920,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSString * _Nonnull value; value = AsString(_cppValue); @@ -5060,7 +4971,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; @@ -5107,7 +5017,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::Application::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; MCApplicationBasicClusterApplicationStruct * _Nonnull value; value = [MCApplicationBasicClusterApplicationStruct new]; @@ -5161,7 +5070,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::Status::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:chip::to_underlying(_cppValue)]; @@ -5208,7 +5116,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSString * _Nonnull value; value = AsString(_cppValue); @@ -5260,7 +5167,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -5322,7 +5228,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::GeneratedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -5384,7 +5289,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::AcceptedCommandList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -5446,7 +5350,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::EventList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -5508,7 +5411,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::AttributeList::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSArray * _Nonnull value; { // Scope for our temporary variables @@ -5570,7 +5472,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::FeatureMap::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedInt:_cppValue]; @@ -5617,7 +5518,6 @@ - (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR *)aE if (cppValue.type() == typeid(std::shared_ptr)) { std::shared_ptr sharedPtr = std::any_cast>(cppValue); chip::app::Clusters::ApplicationBasic::Attributes::ClusterRevision::TypeInfo::DecodableType _cppValue = *sharedPtr; - // auto & valueSharedPtr = *sharedPtr; *aError = CHIP_NO_ERROR; NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedShort:_cppValue]; diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h index 683de5283682cd..12a3d8d3bf59af 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h @@ -18,8 +18,8 @@ // THIS FILE IS GENERATED BY ZAP #import "../MCCluster.h" -#import "../MCCommandObjects.h" #import "MCAttributeObjects.h" +#import "MCCommandObjects.h" #import #ifndef MCClusterObjects_h @@ -31,6 +31,36 @@ // OnOff cluster commands: +/** + * @brief Returns non-nil pointer to MCOnOffClusterOffCommand if supported, nil otherwise. + */ +- (MCOnOffClusterOffCommand * _Nullable)offCommand; + +/** + * @brief Returns non-nil pointer to MCOnOffClusterOnCommand if supported, nil otherwise. + */ +- (MCOnOffClusterOnCommand * _Nullable)onCommand; + +/** + * @brief Returns non-nil pointer to MCOnOffClusterToggleCommand if supported, nil otherwise. + */ +- (MCOnOffClusterToggleCommand * _Nullable)toggleCommand; + +/** + * @brief Returns non-nil pointer to MCOnOffClusterOffWithEffectCommand if supported, nil otherwise. + */ +- (MCOnOffClusterOffWithEffectCommand * _Nullable)offWithEffectCommand; + +/** + * @brief Returns non-nil pointer to MCOnOffClusterOnWithRecallGlobalSceneCommand if supported, nil otherwise. + */ +- (MCOnOffClusterOnWithRecallGlobalSceneCommand * _Nullable)onWithRecallGlobalSceneCommand; + +/** + * @brief Returns non-nil pointer to MCOnOffClusterOnWithTimedOffCommand if supported, nil otherwise. + */ +- (MCOnOffClusterOnWithTimedOffCommand * _Nullable)onWithTimedOffCommand; + // OnOff cluster attributes: /** @@ -95,6 +125,51 @@ // LevelControl cluster commands: +/** + * @brief Returns non-nil pointer to MCLevelControlClusterMoveToLevelCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterMoveToLevelCommand * _Nullable)moveToLevelCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterMoveCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterMoveCommand * _Nullable)moveCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterStepCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterStepCommand * _Nullable)stepCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterStopCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterStopCommand * _Nullable)stopCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterMoveToLevelWithOnOffCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterMoveToLevelWithOnOffCommand * _Nullable)moveToLevelWithOnOffCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterMoveWithOnOffCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterMoveWithOnOffCommand * _Nullable)moveWithOnOffCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterStepWithOnOffCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterStepWithOnOffCommand * _Nullable)stepWithOnOffCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterStopWithOnOffCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterStopWithOnOffCommand * _Nullable)stopWithOnOffCommand; + +/** + * @brief Returns non-nil pointer to MCLevelControlClusterMoveToClosestFrequencyCommand if supported, nil otherwise. + */ +- (MCLevelControlClusterMoveToClosestFrequencyCommand * _Nullable)moveToClosestFrequencyCommand; + // LevelControl cluster attributes: /** @@ -253,6 +328,11 @@ // TargetNavigator cluster commands: +/** + * @brief Returns non-nil pointer to MCTargetNavigatorClusterNavigateTargetCommand if supported, nil otherwise. + */ +- (MCTargetNavigatorClusterNavigateTargetCommand * _Nullable)navigateTargetCommand; + // TargetNavigator cluster attributes: /** @@ -302,6 +382,76 @@ // MediaPlayback cluster commands: +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterPlayCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterPlayCommand * _Nullable)playCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterPauseCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterPauseCommand * _Nullable)pauseCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterStopCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterStopCommand * _Nullable)stopCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterStartOverCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterStartOverCommand * _Nullable)startOverCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterPreviousCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterPreviousCommand * _Nullable)previousCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterNextCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterNextCommand * _Nullable)nextCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterRewindCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterRewindCommand * _Nullable)rewindCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterFastForwardCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterFastForwardCommand * _Nullable)fastForwardCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterSkipForwardCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterSkipForwardCommand * _Nullable)skipForwardCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterSkipBackwardCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterSkipBackwardCommand * _Nullable)skipBackwardCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterSeekCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterSeekCommand * _Nullable)seekCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterActivateAudioTrackCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterActivateAudioTrackCommand * _Nullable)activateAudioTrackCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterActivateTextTrackCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterActivateTextTrackCommand * _Nullable)activateTextTrackCommand; + +/** + * @brief Returns non-nil pointer to MCMediaPlaybackClusterDeactivateTextTrackCommand if supported, nil otherwise. + */ +- (MCMediaPlaybackClusterDeactivateTextTrackCommand * _Nullable)deactivateTextTrackCommand; + // MediaPlayback cluster attributes: /** @@ -396,6 +546,11 @@ // KeypadInput cluster commands: +/** + * @brief Returns non-nil pointer to MCKeypadInputClusterSendKeyCommand if supported, nil otherwise. + */ +- (MCKeypadInputClusterSendKeyCommand * _Nullable)sendKeyCommand; + // KeypadInput cluster attributes: /** @@ -435,6 +590,11 @@ // ContentLauncher cluster commands: +/** + * @brief Returns non-nil pointer to MCContentLauncherClusterLaunchContentCommand if supported, nil otherwise. + */ +- (MCContentLauncherClusterLaunchContentCommand * _Nullable)launchContentCommand; + /** * @brief Returns non-nil pointer to MCContentLauncherClusterLaunchURLCommand if supported, nil otherwise. */ @@ -489,6 +649,21 @@ // ApplicationLauncher cluster commands: +/** + * @brief Returns non-nil pointer to MCApplicationLauncherClusterLaunchAppCommand if supported, nil otherwise. + */ +- (MCApplicationLauncherClusterLaunchAppCommand * _Nullable)launchAppCommand; + +/** + * @brief Returns non-nil pointer to MCApplicationLauncherClusterStopAppCommand if supported, nil otherwise. + */ +- (MCApplicationLauncherClusterStopAppCommand * _Nullable)stopAppCommand; + +/** + * @brief Returns non-nil pointer to MCApplicationLauncherClusterHideAppCommand if supported, nil otherwise. + */ +- (MCApplicationLauncherClusterHideAppCommand * _Nullable)hideAppCommand; + // ApplicationLauncher cluster attributes: /** diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.mm index c7fb3697d67885..8c51871a2c985b 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.mm @@ -35,6 +35,42 @@ @implementation MCOnOffCluster // OnOff cluster commands: +- (id)offCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::Off::Id); + return cppCommand != nil ? [[MCOnOffClusterOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)onCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::On::Id); + return cppCommand != nil ? [[MCOnOffClusterOnCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)toggleCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::Toggle::Id); + return cppCommand != nil ? [[MCOnOffClusterToggleCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)offWithEffectCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::OffWithEffect::Id); + return cppCommand != nil ? [[MCOnOffClusterOffWithEffectCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)onWithRecallGlobalSceneCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Id); + return cppCommand != nil ? [[MCOnOffClusterOnWithRecallGlobalSceneCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)onWithTimedOffCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Id); + return cppCommand != nil ? [[MCOnOffClusterOnWithTimedOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // OnOff cluster attributes: - (id)onOffAttribute @@ -110,6 +146,60 @@ @implementation MCLevelControlCluster // LevelControl cluster commands: +- (id)moveToLevelCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::MoveToLevel::Id); + return cppCommand != nil ? [[MCLevelControlClusterMoveToLevelCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)moveCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::Move::Id); + return cppCommand != nil ? [[MCLevelControlClusterMoveCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stepCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::Step::Id); + return cppCommand != nil ? [[MCLevelControlClusterStepCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stopCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::Stop::Id); + return cppCommand != nil ? [[MCLevelControlClusterStopCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)moveToLevelWithOnOffCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Id); + return cppCommand != nil ? [[MCLevelControlClusterMoveToLevelWithOnOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)moveWithOnOffCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Id); + return cppCommand != nil ? [[MCLevelControlClusterMoveWithOnOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stepWithOnOffCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Id); + return cppCommand != nil ? [[MCLevelControlClusterStepWithOnOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stopWithOnOffCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Id); + return cppCommand != nil ? [[MCLevelControlClusterStopWithOnOffCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)moveToClosestFrequencyCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Id); + return cppCommand != nil ? [[MCLevelControlClusterMoveToClosestFrequencyCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // LevelControl cluster attributes: - (id)currentLevelAttribute @@ -296,6 +386,12 @@ @implementation MCTargetNavigatorCluster // TargetNavigator cluster commands: +- (id)navigateTargetCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Id); + return cppCommand != nil ? [[MCTargetNavigatorClusterNavigateTargetCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // TargetNavigator cluster attributes: - (id)targetListAttribute @@ -353,6 +449,90 @@ @implementation MCMediaPlaybackCluster // MediaPlayback cluster commands: +- (id)playCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Play::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterPlayCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)pauseCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Pause::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterPauseCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stopCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Stop::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterStopCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)startOverCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::StartOver::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterStartOverCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)previousCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Previous::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterPreviousCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)nextCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Next::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterNextCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)rewindCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Rewind::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterRewindCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)fastForwardCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::FastForward::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterFastForwardCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)skipForwardCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::SkipForward::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterSkipForwardCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)skipBackwardCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterSkipBackwardCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)seekCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::Seek::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterSeekCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)activateAudioTrackCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterActivateAudioTrackCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)activateTextTrackCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterActivateTextTrackCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)deactivateTextTrackCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Id); + return cppCommand != nil ? [[MCMediaPlaybackClusterDeactivateTextTrackCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // MediaPlayback cluster attributes: - (id)currentStateAttribute @@ -464,6 +644,12 @@ @implementation MCKeypadInputCluster // KeypadInput cluster commands: +- (id)sendKeyCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::KeypadInput::Commands::SendKey::Id); + return cppCommand != nil ? [[MCKeypadInputClusterSendKeyCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // KeypadInput cluster attributes: - (id)generatedCommandListAttribute @@ -509,6 +695,12 @@ @implementation MCContentLauncherCluster // ContentLauncher cluster commands: +- (id)launchContentCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Id); + return cppCommand != nil ? [[MCContentLauncherClusterLaunchContentCommand alloc] initWithCppCommand:cppCommand] : nil; +} + - (id)launchURLCommand { void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Id); @@ -572,6 +764,24 @@ @implementation MCApplicationLauncherCluster // ApplicationLauncher cluster commands: +- (id)launchAppCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Id); + return cppCommand != nil ? [[MCApplicationLauncherClusterLaunchAppCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)stopAppCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Id); + return cppCommand != nil ? [[MCApplicationLauncherClusterStopAppCommand alloc] initWithCppCommand:cppCommand] : nil; +} + +- (id)hideAppCommand +{ + void * cppCommand = self.cppCluster->GetCommand(chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Id); + return cppCommand != nil ? [[MCApplicationLauncherClusterHideAppCommand alloc] initWithCppCommand:cppCommand] : nil; +} + // ApplicationLauncher cluster attributes: - (id)catalogListAttribute diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h new file mode 100644 index 00000000000000..4ca2694a3a6ba6 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h @@ -0,0 +1,156 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +#import "../MCCommand.h" +#import "MCCommandPayloads.h" +#import + +#ifndef MCCommandObjects_h +#define MCCommandObjects_h + +@interface MCNullObjectType : NSObject +@end + +// OnOff cluster: + +@interface MCOnOffClusterOffCommand : MCCommand +@end + +@interface MCOnOffClusterOnCommand : MCCommand +@end + +@interface MCOnOffClusterToggleCommand : MCCommand +@end + +@interface MCOnOffClusterOffWithEffectCommand : MCCommand +@end + +@interface MCOnOffClusterOnWithRecallGlobalSceneCommand : MCCommand +@end + +@interface MCOnOffClusterOnWithTimedOffCommand : MCCommand +@end + +// LevelControl cluster: + +@interface MCLevelControlClusterMoveToLevelCommand : MCCommand +@end + +@interface MCLevelControlClusterMoveCommand : MCCommand +@end + +@interface MCLevelControlClusterStepCommand : MCCommand +@end + +@interface MCLevelControlClusterStopCommand : MCCommand +@end + +@interface MCLevelControlClusterMoveToLevelWithOnOffCommand : MCCommand +@end + +@interface MCLevelControlClusterMoveWithOnOffCommand : MCCommand +@end + +@interface MCLevelControlClusterStepWithOnOffCommand : MCCommand +@end + +@interface MCLevelControlClusterStopWithOnOffCommand : MCCommand +@end + +@interface MCLevelControlClusterMoveToClosestFrequencyCommand : MCCommand +@end + +// WakeOnLan cluster: + +// TargetNavigator cluster: + +@interface MCTargetNavigatorClusterNavigateTargetCommand : MCCommand +@end + +// MediaPlayback cluster: + +@interface MCMediaPlaybackClusterPlayCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterPauseCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterStopCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterStartOverCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterPreviousCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterNextCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterRewindCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterFastForwardCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterSkipForwardCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterSkipBackwardCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterSeekCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterActivateAudioTrackCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterActivateTextTrackCommand : MCCommand +@end + +@interface MCMediaPlaybackClusterDeactivateTextTrackCommand : MCCommand +@end + +// KeypadInput cluster: + +@interface MCKeypadInputClusterSendKeyCommand : MCCommand +@end + +// ContentLauncher cluster: + +@interface MCContentLauncherClusterLaunchContentCommand : MCCommand +@end + +@interface MCContentLauncherClusterLaunchURLCommand : MCCommand +@end + +// ApplicationLauncher cluster: + +@interface MCApplicationLauncherClusterLaunchAppCommand : MCCommand +@end + +@interface MCApplicationLauncherClusterStopAppCommand : MCCommand +@end + +@interface MCApplicationLauncherClusterHideAppCommand : MCCommand +@end + +// ApplicationBasic cluster: + +#endif /* MCCommandObjects_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm new file mode 100644 index 00000000000000..7e70238fcb5c16 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.mm @@ -0,0 +1,1964 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +#import "MCCommandObjects.h" +#import "MCCommandPayloads.h" +#import "MCCommandPayloads_internal.h" + +#import "../MCCastingApp.h" +#import "../MCCommand_Internal.h" +#import "../MCErrorUtils.h" + +#include "core/Command.h" +#include + +#import + +@implementation MCNullObjectType +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + return CHIP_NO_ERROR; +} +@end + +// OnOff cluster: + +@implementation MCOnOffClusterOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCOnOffClusterOnCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterOnParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOnCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCOnOffClusterToggleCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterToggleParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterToggleCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCOnOffClusterOffWithEffectCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterOffWithEffectParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOffWithEffectCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCOnOffClusterOnWithRecallGlobalSceneCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterOnWithRecallGlobalSceneParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOnWithRecallGlobalSceneCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCOnOffClusterOnWithTimedOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCOnOffClusterOnWithTimedOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCOnOffClusterOnWithTimedOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// LevelControl cluster: + +@implementation MCLevelControlClusterMoveToLevelCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterMoveToLevelParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveToLevelCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterMoveCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterMoveParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterStepCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterStepParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStepCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterStopCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterStopParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStopCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterMoveToLevelWithOnOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterMoveToLevelWithOnOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveToLevelWithOnOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterMoveWithOnOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterMoveWithOnOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveWithOnOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterStepWithOnOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterStepWithOnOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStepWithOnOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterStopWithOnOffCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterStopWithOnOffParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterStopWithOnOffCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCLevelControlClusterMoveToClosestFrequencyCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCLevelControlClusterMoveToClosestFrequencyParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCLevelControlClusterMoveToClosestFrequencyCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// WakeOnLan cluster: + +// TargetNavigator cluster: + +@implementation MCTargetNavigatorClusterNavigateTargetCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCTargetNavigatorClusterNavigateTargetParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCTargetNavigatorClusterNavigateTargetResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCTargetNavigatorClusterNavigateTargetResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCTargetNavigatorClusterNavigateTargetCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// MediaPlayback cluster: + +@implementation MCMediaPlaybackClusterPlayCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterPlayParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterPlayCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterPauseCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterPauseParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterPauseCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterStopCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterStopParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterStopCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterStartOverCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterStartOverParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterStartOverCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterPreviousCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterPreviousParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterPreviousCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterNextCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterNextParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterNextCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterRewindCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterRewindParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterRewindCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterFastForwardCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterFastForwardParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterFastForwardCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterSkipForwardCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterSkipForwardParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterSkipForwardCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterSkipBackwardCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterSkipBackwardParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterSkipBackwardCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterSeekCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterSeekParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCMediaPlaybackClusterPlaybackResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCMediaPlaybackClusterPlaybackResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterSeekCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterActivateAudioTrackCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterActivateAudioTrackParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterActivateAudioTrackCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterActivateTextTrackCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterActivateTextTrackParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterActivateTextTrackCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCMediaPlaybackClusterDeactivateTextTrackCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCMediaPlaybackClusterDeactivateTextTrackParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCNullObjectType * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCNullObjectType + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCMediaPlaybackClusterDeactivateTextTrackCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// KeypadInput cluster: + +@implementation MCKeypadInputClusterSendKeyCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCKeypadInputClusterSendKeyParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCKeypadInputClusterSendKeyResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCKeypadInputClusterSendKeyResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCKeypadInputClusterSendKeyCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// ContentLauncher cluster: + +@implementation MCContentLauncherClusterLaunchContentCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCContentLauncherClusterLaunchContentParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCContentLauncherClusterLauncherResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCContentLauncherClusterLauncherResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCContentLauncherClusterLaunchContentCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCContentLauncherClusterLaunchURLCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCContentLauncherClusterLaunchURLParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCContentLauncherClusterLauncherResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCContentLauncherClusterLauncherResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCContentLauncherClusterLaunchURLCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// ApplicationLauncher cluster: + +@implementation MCApplicationLauncherClusterLaunchAppCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCApplicationLauncherClusterLaunchAppParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCApplicationLauncherClusterLauncherResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCApplicationLauncherClusterLauncherResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCApplicationLauncherClusterLaunchAppCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCApplicationLauncherClusterStopAppCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCApplicationLauncherClusterStopAppParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCApplicationLauncherClusterLauncherResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCApplicationLauncherClusterLauncherResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCApplicationLauncherClusterStopAppCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +@implementation MCApplicationLauncherClusterHideAppCommand +- (void)invoke:(id)request + context:(void * _Nullable)context + completion:(void (^_Nonnull __strong)(void *, NSError *, id))completion + timedInvokeTimeoutMs:(NSNumber * _Nullable)timedInvokeTimeoutMs +{ + MCCommandTemplate * mcCommand = new MCCommandTemplate( + self.cppCommand, + [self](id objCRequest) { + return [self getCppRequestFromObjC:objCRequest]; + }, + [self](std::any cppResponse) { + return [self getObjCResponseFromCpp:cppResponse]; + }); + mcCommand->invoke( + request, context, [mcCommand, completion](void * context, NSError * err, id response) { + completion(context, err, response); + delete mcCommand; + }, timedInvokeTimeoutMs); +} + +- (std::any)getCppRequestFromObjC:(MCApplicationLauncherClusterHideAppParams *)objcRequest +{ + VerifyOrReturnValue(objcRequest != nil, nullptr); + std::any anyCppRequest = [objcRequest getCppRequestFromObjCRequest]; + if (anyCppRequest.has_value()) { + try { + // Extract the object from std::any and convert it to a std::shared_ptr + auto & cppRequest = std::any_cast(anyCppRequest); + return std::any(std::make_shared(cppRequest)); + } catch (const std::bad_any_cast & e) { + return nullptr; + } + } + return nullptr; +} + +- (id)getObjCResponseFromCpp:(std::any)cppResponse +{ + MCApplicationLauncherClusterLauncherResponseParams * objCResponse = nil; + CHIP_ERROR err = CHIP_NO_ERROR; + if (cppResponse.type() == typeid(std::shared_ptr)) { + std::shared_ptr responseSharedPtr = std::any_cast>(cppResponse); + objCResponse = [[MCApplicationLauncherClusterLauncherResponseParams + alloc] init]; + // Set the ObjC response fields using the given cpp Response + err = [objCResponse setObjCResponseFromCppResponse:*responseSharedPtr]; + VerifyOrReturnValue(err == CHIP_NO_ERROR, nil, ChipLogError(AppServer, "MCApplicationLauncherClusterHideAppCommand getObjCResponseFromCpp() failed")); + } + return objCResponse; +} +@end + +// ApplicationBasic cluster: diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h new file mode 100644 index 00000000000000..25b18625d8f6cd --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h @@ -0,0 +1,239 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +#import "MCInteractionModelStructs.h" + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MCAbstractPayload : NSObject +@end + +// OnOff cluster: + +@interface MCOnOffClusterOffParams : MCAbstractPayload +@end + +@interface MCOnOffClusterOnParams : MCAbstractPayload +@end + +@interface MCOnOffClusterToggleParams : MCAbstractPayload +@end + +@interface MCOnOffClusterOffWithEffectParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull effectIdentifier; +@property (nonatomic, copy) NSNumber * _Nonnull effectVariant; +@end + +@interface MCOnOffClusterOnWithRecallGlobalSceneParams : MCAbstractPayload +@end + +@interface MCOnOffClusterOnWithTimedOffParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull onOffControl; +@property (nonatomic, copy) NSNumber * _Nonnull onTime; +@property (nonatomic, copy) NSNumber * _Nonnull offWaitTime; +@end + +// LevelControl cluster: + +@interface MCLevelControlClusterMoveToLevelParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull level; +@property (nonatomic, copy) NSNumber * _Nullable transitionTime; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterMoveParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull moveMode; +@property (nonatomic, copy) NSNumber * _Nullable rate; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterStepParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull stepMode; +@property (nonatomic, copy) NSNumber * _Nonnull stepSize; +@property (nonatomic, copy) NSNumber * _Nullable transitionTime; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterStopParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterMoveToLevelWithOnOffParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull level; +@property (nonatomic, copy) NSNumber * _Nullable transitionTime; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterMoveWithOnOffParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull moveMode; +@property (nonatomic, copy) NSNumber * _Nullable rate; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterStepWithOnOffParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull stepMode; +@property (nonatomic, copy) NSNumber * _Nonnull stepSize; +@property (nonatomic, copy) NSNumber * _Nullable transitionTime; +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterStopWithOnOffParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull optionsMask; +@property (nonatomic, copy) NSNumber * _Nonnull optionsOverride; +@end + +@interface MCLevelControlClusterMoveToClosestFrequencyParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull frequency; +@end + +// WakeOnLan cluster: + +// TargetNavigator cluster: + +@interface MCTargetNavigatorClusterNavigateTargetParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull target; +@property (nonatomic, copy) NSString * _Nullable data; +@end + +@interface MCTargetNavigatorClusterNavigateTargetResponseParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull status; +@property (nonatomic, copy) NSString * _Nullable data; +@end + +// MediaPlayback cluster: + +@interface MCMediaPlaybackClusterPlayParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterPauseParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterStopParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterStartOverParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterPreviousParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterNextParams : MCAbstractPayload +@end + +@interface MCMediaPlaybackClusterRewindParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nullable audioAdvanceUnmuted; +@end + +@interface MCMediaPlaybackClusterFastForwardParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nullable audioAdvanceUnmuted; +@end + +@interface MCMediaPlaybackClusterSkipForwardParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull deltaPositionMilliseconds; +@end + +@interface MCMediaPlaybackClusterSkipBackwardParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull deltaPositionMilliseconds; +@end + +@interface MCMediaPlaybackClusterPlaybackResponseParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull status; +@property (nonatomic, copy) NSString * _Nullable data; +@end + +@interface MCMediaPlaybackClusterSeekParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull position; +@end + +@interface MCMediaPlaybackClusterActivateAudioTrackParams : MCAbstractPayload +@property (nonatomic, copy) NSString * _Nonnull trackID; +@property (nonatomic, copy) NSNumber * _Nonnull audioOutputIndex; +@end + +@interface MCMediaPlaybackClusterActivateTextTrackParams : MCAbstractPayload +@property (nonatomic, copy) NSString * _Nonnull trackID; +@end + +@interface MCMediaPlaybackClusterDeactivateTextTrackParams : MCAbstractPayload +@end + +// KeypadInput cluster: + +@interface MCKeypadInputClusterSendKeyParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull keyCode; +@end + +@interface MCKeypadInputClusterSendKeyResponseParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull status; +@end + +// ContentLauncher cluster: + +@interface MCContentLauncherClusterLaunchContentParams : MCAbstractPayload +@property (nonatomic, copy) MCContentLauncherClusterContentSearchStruct * _Nonnull search; +@property (nonatomic, copy) NSNumber * _Nonnull autoPlay; +@property (nonatomic, copy) NSString * _Nullable data; +@property (nonatomic, copy) MCContentLauncherClusterPlaybackPreferencesStruct * _Nullable playbackPreferences; +@property (nonatomic, copy) NSNumber * _Nullable useCurrentContext; +@end + +@interface MCContentLauncherClusterLaunchURLParams : MCAbstractPayload +@property (nonatomic, copy) NSString * _Nonnull contentURL; +@property (nonatomic, copy) NSString * _Nullable displayString; +@property (nonatomic, copy) MCContentLauncherClusterBrandingInformationStruct * _Nullable brandingInformation; +@end + +@interface MCContentLauncherClusterLauncherResponseParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull status; +@property (nonatomic, copy) NSString * _Nullable data; +@end + +// ApplicationLauncher cluster: + +@interface MCApplicationLauncherClusterLaunchAppParams : MCAbstractPayload +@property (nonatomic, copy) MCApplicationLauncherClusterApplicationStruct * _Nullable application; +@property (nonatomic, copy) NSData * _Nullable data; +@end + +@interface MCApplicationLauncherClusterStopAppParams : MCAbstractPayload +@property (nonatomic, copy) MCApplicationLauncherClusterApplicationStruct * _Nullable application; +@end + +@interface MCApplicationLauncherClusterHideAppParams : MCAbstractPayload +@property (nonatomic, copy) MCApplicationLauncherClusterApplicationStruct * _Nullable application; +@end + +@interface MCApplicationLauncherClusterLauncherResponseParams : MCAbstractPayload +@property (nonatomic, copy) NSNumber * _Nonnull status; +@property (nonatomic, copy) NSData * _Nullable data; +@end + +// ApplicationBasic cluster: + +NS_ASSUME_NONNULL_END diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm new file mode 100644 index 00000000000000..a5029e2b3b2a1c --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.mm @@ -0,0 +1,2280 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +#import "MCCommandPayloads_Internal.h" + +#import "../MCAttribute_Internal.h" +#import "../MCCastingApp.h" +#import "../MCErrorUtils.h" +#import "../NSDataSpanConversion.h" +#import "../NSStringSpanConversion.h" + +#include +#include +#include +#include +#include + +NS_ASSUME_NONNULL_BEGIN + +@implementation MCAbstractPayload +- (std::any)getCppRequestFromObjCRequest +{ + return nil; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + return CHIP_NO_ERROR; +} + +- (nonnull id)copyWithZone:(nullable NSZone *)zone +{ + auto other = [[MCAbstractPayload alloc] init]; + + return other; +} +@end + +// OnOff cluster: + +@implementation MCOnOffClusterOffParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterOffParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::Off::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCOnOffClusterOnParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterOnParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::On::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCOnOffClusterToggleParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterToggleParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::Toggle::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCOnOffClusterOffWithEffectParams +- (instancetype)init +{ + if (self = [super init]) { + + _effectIdentifier = @(0); + + _effectVariant = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterOffWithEffectParams alloc] init]; + + other.effectIdentifier = self.effectIdentifier; + other.effectVariant = self.effectVariant; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: effectIdentifier:%@; effectVariant:%@; >", NSStringFromClass([self class]), _effectIdentifier, _effectVariant]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::OffWithEffect::Type cppStruct; + ListFreer listFreer; + { + cppStruct.effectIdentifier = static_cast>(self.effectIdentifier.unsignedCharValue); + } + { + cppStruct.effectVariant = self.effectVariant.unsignedCharValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCOnOffClusterOnWithRecallGlobalSceneParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterOnWithRecallGlobalSceneParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCOnOffClusterOnWithTimedOffParams +- (instancetype)init +{ + if (self = [super init]) { + + _onOffControl = @(0); + + _onTime = @(0); + + _offWaitTime = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCOnOffClusterOnWithTimedOffParams alloc] init]; + + other.onOffControl = self.onOffControl; + other.onTime = self.onTime; + other.offWaitTime = self.offWaitTime; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: onOffControl:%@; onTime:%@; offWaitTime:%@; >", NSStringFromClass([self class]), _onOffControl, _onTime, _offWaitTime]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type cppStruct; + ListFreer listFreer; + { + cppStruct.onOffControl = static_cast>(self.onOffControl.unsignedCharValue); + } + { + cppStruct.onTime = self.onTime.unsignedShortValue; + } + { + cppStruct.offWaitTime = self.offWaitTime.unsignedShortValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +// LevelControl cluster: + +@implementation MCLevelControlClusterMoveToLevelParams +- (instancetype)init +{ + if (self = [super init]) { + + _level = @(0); + + _transitionTime = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterMoveToLevelParams alloc] init]; + + other.level = self.level; + other.transitionTime = self.transitionTime; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: level:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _level, _transitionTime, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type cppStruct; + ListFreer listFreer; + { + cppStruct.level = self.level.unsignedCharValue; + } + { + if (self.transitionTime == nil) { + cppStruct.transitionTime.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull(); + nonNullValue_0 = self.transitionTime.unsignedShortValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterMoveParams +- (instancetype)init +{ + if (self = [super init]) { + + _moveMode = @(0); + + _rate = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterMoveParams alloc] init]; + + other.moveMode = self.moveMode; + other.rate = self.rate; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: moveMode:%@; rate:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _moveMode, _rate, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::Move::Type cppStruct; + ListFreer listFreer; + { + cppStruct.moveMode = static_cast>(self.moveMode.unsignedCharValue); + } + { + if (self.rate == nil) { + cppStruct.rate.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.rate.SetNonNull(); + nonNullValue_0 = self.rate.unsignedCharValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterStepParams +- (instancetype)init +{ + if (self = [super init]) { + + _stepMode = @(0); + + _stepSize = @(0); + + _transitionTime = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterStepParams alloc] init]; + + other.stepMode = self.stepMode; + other.stepSize = self.stepSize; + other.transitionTime = self.transitionTime; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: stepMode:%@; stepSize:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _stepMode, _stepSize, _transitionTime, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::Step::Type cppStruct; + ListFreer listFreer; + { + cppStruct.stepMode = static_cast>(self.stepMode.unsignedCharValue); + } + { + cppStruct.stepSize = self.stepSize.unsignedCharValue; + } + { + if (self.transitionTime == nil) { + cppStruct.transitionTime.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull(); + nonNullValue_0 = self.transitionTime.unsignedShortValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterStopParams +- (instancetype)init +{ + if (self = [super init]) { + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterStopParams alloc] init]; + + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::Stop::Type cppStruct; + ListFreer listFreer; + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterMoveToLevelWithOnOffParams +- (instancetype)init +{ + if (self = [super init]) { + + _level = @(0); + + _transitionTime = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; + + other.level = self.level; + other.transitionTime = self.transitionTime; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: level:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _level, _transitionTime, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type cppStruct; + ListFreer listFreer; + { + cppStruct.level = self.level.unsignedCharValue; + } + { + if (self.transitionTime == nil) { + cppStruct.transitionTime.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull(); + nonNullValue_0 = self.transitionTime.unsignedShortValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterMoveWithOnOffParams +- (instancetype)init +{ + if (self = [super init]) { + + _moveMode = @(0); + + _rate = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterMoveWithOnOffParams alloc] init]; + + other.moveMode = self.moveMode; + other.rate = self.rate; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: moveMode:%@; rate:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _moveMode, _rate, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type cppStruct; + ListFreer listFreer; + { + cppStruct.moveMode = static_cast>(self.moveMode.unsignedCharValue); + } + { + if (self.rate == nil) { + cppStruct.rate.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.rate.SetNonNull(); + nonNullValue_0 = self.rate.unsignedCharValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterStepWithOnOffParams +- (instancetype)init +{ + if (self = [super init]) { + + _stepMode = @(0); + + _stepSize = @(0); + + _transitionTime = nil; + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterStepWithOnOffParams alloc] init]; + + other.stepMode = self.stepMode; + other.stepSize = self.stepSize; + other.transitionTime = self.transitionTime; + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: stepMode:%@; stepSize:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _stepMode, _stepSize, _transitionTime, _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type cppStruct; + ListFreer listFreer; + { + cppStruct.stepMode = static_cast>(self.stepMode.unsignedCharValue); + } + { + cppStruct.stepSize = self.stepSize.unsignedCharValue; + } + { + if (self.transitionTime == nil) { + cppStruct.transitionTime.SetNull(); + } else { + auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull(); + nonNullValue_0 = self.transitionTime.unsignedShortValue; + } + } + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterStopWithOnOffParams +- (instancetype)init +{ + if (self = [super init]) { + + _optionsMask = @(0); + + _optionsOverride = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterStopWithOnOffParams alloc] init]; + + other.optionsMask = self.optionsMask; + other.optionsOverride = self.optionsOverride; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _optionsMask, _optionsOverride]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type cppStruct; + ListFreer listFreer; + { + cppStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); + } + { + cppStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCLevelControlClusterMoveToClosestFrequencyParams +- (instancetype)init +{ + if (self = [super init]) { + + _frequency = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCLevelControlClusterMoveToClosestFrequencyParams alloc] init]; + + other.frequency = self.frequency; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: frequency:%@; >", NSStringFromClass([self class]), _frequency]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Type cppStruct; + ListFreer listFreer; + { + cppStruct.frequency = self.frequency.unsignedShortValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +// WakeOnLan cluster: + +// TargetNavigator cluster: + +@implementation MCTargetNavigatorClusterNavigateTargetParams +- (instancetype)init +{ + if (self = [super init]) { + + _target = @(0); + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCTargetNavigatorClusterNavigateTargetParams alloc] init]; + + other.target = self.target; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: target:%@; data:%@; >", NSStringFromClass([self class]), _target, _data]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type cppStruct; + ListFreer listFreer; + { + cppStruct.target = self.target.unsignedCharValue; + } + { + if (self.data != nil) { + auto & definedValue_0 = cppStruct.data.Emplace(); + definedValue_0 = AsCharSpan(self.data); + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCTargetNavigatorClusterNavigateTargetResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCTargetNavigatorClusterNavigateTargetResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + // Default implementation + return CHIP_NO_ERROR; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &)cppDecodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; + } + { + if (cppDecodableStruct.data.HasValue()) { + self.data = AsString(cppDecodableStruct.data.Value()); + if (self.data == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} +@end + +// MediaPlayback cluster: + +@implementation MCMediaPlaybackClusterPlayParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterPlayParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Play::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterPauseParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterPauseParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Pause::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterStopParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterStopParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Stop::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterStartOverParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterStartOverParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::StartOver::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterPreviousParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterPreviousParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Previous::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterNextParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterNextParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Next::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterRewindParams +- (instancetype)init +{ + if (self = [super init]) { + + _audioAdvanceUnmuted = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterRewindParams alloc] init]; + + other.audioAdvanceUnmuted = self.audioAdvanceUnmuted; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioAdvanceUnmuted:%@; >", NSStringFromClass([self class]), _audioAdvanceUnmuted]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Rewind::Type cppStruct; + ListFreer listFreer; + { + if (self.audioAdvanceUnmuted != nil) { + auto & definedValue_0 = cppStruct.audioAdvanceUnmuted.Emplace(); + definedValue_0 = self.audioAdvanceUnmuted.boolValue; + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterFastForwardParams +- (instancetype)init +{ + if (self = [super init]) { + + _audioAdvanceUnmuted = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterFastForwardParams alloc] init]; + + other.audioAdvanceUnmuted = self.audioAdvanceUnmuted; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioAdvanceUnmuted:%@; >", NSStringFromClass([self class]), _audioAdvanceUnmuted]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::FastForward::Type cppStruct; + ListFreer listFreer; + { + if (self.audioAdvanceUnmuted != nil) { + auto & definedValue_0 = cppStruct.audioAdvanceUnmuted.Emplace(); + definedValue_0 = self.audioAdvanceUnmuted.boolValue; + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterSkipForwardParams +- (instancetype)init +{ + if (self = [super init]) { + + _deltaPositionMilliseconds = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterSkipForwardParams alloc] init]; + + other.deltaPositionMilliseconds = self.deltaPositionMilliseconds; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: deltaPositionMilliseconds:%@; >", NSStringFromClass([self class]), _deltaPositionMilliseconds]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::SkipForward::Type cppStruct; + ListFreer listFreer; + { + cppStruct.deltaPositionMilliseconds = self.deltaPositionMilliseconds.unsignedLongLongValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterSkipBackwardParams +- (instancetype)init +{ + if (self = [super init]) { + + _deltaPositionMilliseconds = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterSkipBackwardParams alloc] init]; + + other.deltaPositionMilliseconds = self.deltaPositionMilliseconds; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: deltaPositionMilliseconds:%@; >", NSStringFromClass([self class]), _deltaPositionMilliseconds]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Type cppStruct; + ListFreer listFreer; + { + cppStruct.deltaPositionMilliseconds = self.deltaPositionMilliseconds.unsignedLongLongValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterPlaybackResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + // Default implementation + return CHIP_NO_ERROR; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType &)cppDecodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; + } + { + if (cppDecodableStruct.data.HasValue()) { + self.data = AsString(cppDecodableStruct.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 MCMediaPlaybackClusterSeekParams +- (instancetype)init +{ + if (self = [super init]) { + + _position = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterSeekParams alloc] init]; + + other.position = self.position; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: position:%@; >", NSStringFromClass([self class]), _position]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::Seek::Type cppStruct; + ListFreer listFreer; + { + cppStruct.position = self.position.unsignedLongLongValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterActivateAudioTrackParams +- (instancetype)init +{ + if (self = [super init]) { + + _trackID = @""; + + _audioOutputIndex = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterActivateAudioTrackParams alloc] init]; + + other.trackID = self.trackID; + other.audioOutputIndex = self.audioOutputIndex; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: trackID:%@; audioOutputIndex:%@; >", NSStringFromClass([self class]), _trackID, _audioOutputIndex]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Type cppStruct; + ListFreer listFreer; + { + cppStruct.trackID = AsCharSpan(self.trackID); + } + { + cppStruct.audioOutputIndex = self.audioOutputIndex.unsignedCharValue; + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterActivateTextTrackParams +- (instancetype)init +{ + if (self = [super init]) { + + _trackID = @""; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterActivateTextTrackParams alloc] init]; + + other.trackID = self.trackID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: trackID:%@; >", NSStringFromClass([self class]), _trackID]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Type cppStruct; + ListFreer listFreer; + { + cppStruct.trackID = AsCharSpan(self.trackID); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCMediaPlaybackClusterDeactivateTextTrackParams +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCMediaPlaybackClusterDeactivateTextTrackParams alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Type cppStruct; + ListFreer listFreer; + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +// KeypadInput cluster: + +@implementation MCKeypadInputClusterSendKeyParams +- (instancetype)init +{ + if (self = [super init]) { + + _keyCode = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCKeypadInputClusterSendKeyParams alloc] init]; + + other.keyCode = self.keyCode; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: keyCode:%@; >", NSStringFromClass([self class]), _keyCode]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::KeypadInput::Commands::SendKey::Type cppStruct; + ListFreer listFreer; + { + cppStruct.keyCode = static_cast>(self.keyCode.unsignedCharValue); + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCKeypadInputClusterSendKeyResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCKeypadInputClusterSendKeyResponseParams alloc] init]; + + other.status = self.status; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; >", NSStringFromClass([self class]), _status]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + // Default implementation + return CHIP_NO_ERROR; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType &)cppDecodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; + } + return CHIP_NO_ERROR; +} +@end + +// ContentLauncher cluster: + +@implementation MCContentLauncherClusterLaunchContentParams +- (instancetype)init +{ + if (self = [super init]) { + + _search = [MCContentLauncherClusterContentSearchStruct new]; + + _autoPlay = @(0); + + _data = nil; + + _playbackPreferences = nil; + + _useCurrentContext = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCContentLauncherClusterLaunchContentParams alloc] init]; + + other.search = self.search; + other.autoPlay = self.autoPlay; + other.data = self.data; + other.playbackPreferences = self.playbackPreferences; + other.useCurrentContext = self.useCurrentContext; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: search:%@; autoPlay:%@; data:%@; playbackPreferences:%@; useCurrentContext:%@; >", NSStringFromClass([self class]), _search, _autoPlay, _data, _playbackPreferences, _useCurrentContext]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type cppStruct; + 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:[MCContentLauncherClusterParameterStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MCContentLauncherClusterParameterStruct *) 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:[MCContentLauncherClusterAdditionalInfoStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_4 = (MCContentLauncherClusterAdditionalInfoStruct *) 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(); + } + } + } + } + cppStruct.search.parameterList = ListType_1(listHolder_1->mList, self.search.parameterList.count); + } else { + cppStruct.search.parameterList = ListType_1(); + } + } + } + { + cppStruct.autoPlay = self.autoPlay.boolValue; + } + { + if (self.data != nil) { + auto & definedValue_0 = cppStruct.data.Emplace(); + definedValue_0 = AsCharSpan(self.data); + } + } + { + if (self.playbackPreferences != nil) { + auto & definedValue_0 = cppStruct.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:[MCContentLauncherClusterTrackPreferenceStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (MCContentLauncherClusterTrackPreferenceStruct *) 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 = cppStruct.useCurrentContext.Emplace(); + definedValue_0 = self.useCurrentContext.boolValue; + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCContentLauncherClusterLaunchURLParams +- (instancetype)init +{ + if (self = [super init]) { + + _contentURL = @""; + + _displayString = nil; + + _brandingInformation = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCContentLauncherClusterLaunchURLParams alloc] init]; + + other.contentURL = self.contentURL; + other.displayString = self.displayString; + other.brandingInformation = self.brandingInformation; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: contentURL:%@; displayString:%@; brandingInformation:%@; >", NSStringFromClass([self class]), _contentURL, _displayString, _brandingInformation]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type cppStruct; + ListFreer listFreer; + { + cppStruct.contentURL = AsCharSpan(self.contentURL); + } + { + if (self.displayString != nil) { + auto & definedValue_0 = cppStruct.displayString.Emplace(); + definedValue_0 = AsCharSpan(self.displayString); + } + } + { + if (self.brandingInformation != nil) { + auto & definedValue_0 = cppStruct.brandingInformation.Emplace(); + definedValue_0.providerName = AsCharSpan(self.brandingInformation.providerName); + if (self.brandingInformation.background != nil) { + auto & definedValue_2 = definedValue_0.background.Emplace(); + if (self.brandingInformation.background.imageURL != nil) { + auto & definedValue_4 = definedValue_2.imageURL.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.background.imageURL); + } + if (self.brandingInformation.background.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.background.color); + } + if (self.brandingInformation.background.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = self.brandingInformation.background.size.width.doubleValue; + definedValue_4.height = self.brandingInformation.background.size.height.doubleValue; + definedValue_4.metric = static_cast>(self.brandingInformation.background.size.metric.unsignedCharValue); + } + } + if (self.brandingInformation.logo != nil) { + auto & definedValue_2 = definedValue_0.logo.Emplace(); + if (self.brandingInformation.logo.imageURL != nil) { + auto & definedValue_4 = definedValue_2.imageURL.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.logo.imageURL); + } + if (self.brandingInformation.logo.color != nil) { + auto & definedValue_4 = definedValue_2.color.Emplace(); + definedValue_4 = AsCharSpan(self.brandingInformation.logo.color); + } + if (self.brandingInformation.logo.size != nil) { + auto & definedValue_4 = definedValue_2.size.Emplace(); + definedValue_4.width = self.brandingInformation.logo.size.width.doubleValue; + definedValue_4.height = self.brandingInformation.logo.size.height.doubleValue; + 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.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); + } + } + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCContentLauncherClusterLauncherResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCContentLauncherClusterLauncherResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + // Default implementation + return CHIP_NO_ERROR; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType &)cppDecodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; + } + { + if (cppDecodableStruct.data.HasValue()) { + self.data = AsString(cppDecodableStruct.data.Value()); + if (self.data == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} +@end + +// ApplicationLauncher cluster: + +@implementation MCApplicationLauncherClusterLaunchAppParams +- (instancetype)init +{ + if (self = [super init]) { + + _application = nil; + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCApplicationLauncherClusterLaunchAppParams alloc] init]; + + other.application = self.application; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; data:%@; >", NSStringFromClass([self class]), _application, [_data base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type cppStruct; + ListFreer listFreer; + { + if (self.application != nil) { + auto & definedValue_0 = cppStruct.application.Emplace(); + definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = AsCharSpan(self.application.applicationID); + } + } + { + if (self.data != nil) { + auto & definedValue_0 = cppStruct.data.Emplace(); + definedValue_0 = AsByteSpan(self.data); + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCApplicationLauncherClusterStopAppParams +- (instancetype)init +{ + if (self = [super init]) { + + _application = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCApplicationLauncherClusterStopAppParams alloc] init]; + + other.application = self.application; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; >", NSStringFromClass([self class]), _application]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type cppStruct; + ListFreer listFreer; + { + if (self.application != nil) { + auto & definedValue_0 = cppStruct.application.Emplace(); + definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = AsCharSpan(self.application.applicationID); + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCApplicationLauncherClusterHideAppParams +- (instancetype)init +{ + if (self = [super init]) { + + _application = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCApplicationLauncherClusterHideAppParams alloc] init]; + + other.application = self.application; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; >", NSStringFromClass([self class]), _application]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type cppStruct; + ListFreer listFreer; + { + if (self.application != nil) { + auto & definedValue_0 = cppStruct.application.Emplace(); + definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue; + definedValue_0.applicationID = AsCharSpan(self.application.applicationID); + } + } + + return std::any(cppStruct); +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct +{ + // Default implementation + return CHIP_NO_ERROR; +} +@end + +@implementation MCApplicationLauncherClusterLauncherResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _status = @(0); + + _data = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MCApplicationLauncherClusterLauncherResponseParams alloc] init]; + + other.status = self.status; + other.data = self.data; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, [_data base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +- (std::any)getCppRequestFromObjCRequest +{ + // Default implementation + return CHIP_NO_ERROR; +} + +- (CHIP_ERROR)setObjCResponseFromCppResponse:(const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType &)cppDecodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)]; + } + { + if (cppDecodableStruct.data.HasValue()) { + self.data = AsData(cppDecodableStruct.data.Value()); + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} +@end + +// ApplicationBasic cluster: + +NS_ASSUME_NONNULL_END diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads_Internal.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads_Internal.h new file mode 100644 index 00000000000000..c880c24207b1b4 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads_Internal.h @@ -0,0 +1,33 @@ +/** + * + * Copyright (c) 2020-2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MCCommandPayloads.h" + +#import "../MCErrorUtils.h" + +#import +#include + +#ifndef MCCommandPayloads_Internal_h +#define MCCommandPayloads_Internal_h + +@interface MCAbstractPayload () +- (std::any)getCppRequestFromObjCRequest; +- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct; +@end + +#endif /* MCCommandPayloads_Internal_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.h new file mode 100644 index 00000000000000..f64e47027bde12 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.h @@ -0,0 +1,108 @@ +/** + * + * Copyright (c) 2020-2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#ifndef MCStructsObjc_h +#define MCStructsObjc_h + +@interface MCMediaPlaybackClusterPlaybackPositionStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull updatedAt; +@property (nonatomic, copy) NSNumber * _Nullable position; +@end + +@interface MCMediaPlaybackClusterTrackAttributesStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull languageCode; +@property (nonatomic, copy) NSString * _Nullable displayName; +@end + +@interface MCMediaPlaybackClusterTrackStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull id; +@property (nonatomic, copy) MCMediaPlaybackClusterTrackAttributesStruct * _Nullable trackAttributes; +@end + +@interface MCApplicationBasicClusterApplicationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorID; +@property (nonatomic, copy) NSString * _Nonnull applicationID; +@end + +@interface MCTargetNavigatorClusterTargetInfoStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull identifier; +@property (nonatomic, copy) NSString * _Nonnull name; +@end + +@interface MCApplicationLauncherClusterApplicationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorID; +@property (nonatomic, copy) NSString * _Nonnull applicationID; +@end + +@interface MCApplicationLauncherClusterApplicationEPStruct : NSObject +@property (nonatomic, copy) MCApplicationLauncherClusterApplicationStruct * _Nonnull application; +@property (nonatomic, copy) NSNumber * _Nullable endpoint; +@end + +@interface MCContentLauncherClusterContentSearchStruct : NSObject +@property (nonatomic, copy) NSArray * _Nonnull parameterList; +@end + +// MTR_PROVISIONALLY_AVAILABLE +@interface MCContentLauncherClusterTrackPreferenceStruct : 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 MCContentLauncherClusterPlaybackPreferencesStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull playbackPosition; // MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MCContentLauncherClusterTrackPreferenceStruct * _Nonnull textTrack; // MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable audioTracks; // MTR_PROVISIONALLY_AVAILABLE; +@end + +@interface MCContentLauncherClusterDimensionStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull width; +@property (nonatomic, copy) NSNumber * _Nonnull height; +@property (nonatomic, copy) NSNumber * _Nonnull metric; +@end + +@interface MCContentLauncherClusterStyleInformationStruct : NSObject +@property (nonatomic, copy) NSString * _Nullable imageURL; +@property (nonatomic, copy) NSString * _Nullable color; +@property (nonatomic, copy) MCContentLauncherClusterDimensionStruct * _Nullable size; +@end + +@interface MCContentLauncherClusterBrandingInformationStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull providerName; +@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable background; +@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable logo; +@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable progressBar; +@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable splash; +@property (nonatomic, copy) MCContentLauncherClusterStyleInformationStruct * _Nullable waterMark; +@end + +@interface MCContentLauncherClusterParameterStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull type; +@property (nonatomic, copy) NSString * _Nonnull value; +@property (nonatomic, copy) NSArray * _Nullable externalIDList; +@end + +@interface MCContentLauncherClusterAdditionalInfoStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull name; +@property (nonatomic, copy) NSString * _Nonnull value; +@end + +#endif /* MCStructsObjc_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.mm similarity index 50% rename from examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.mm rename to examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.mm index 64ced385e18a05..b847389f232eab 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCInteractionModelStructs.mm @@ -15,7 +15,7 @@ * limitations under the License. */ -#import "MCStructsObjc.h" +#import "MCInteractionModelStructs.h" #import @@ -46,12 +46,6 @@ - (NSString *)description NSString * descriptionString = [NSString stringWithFormat:@"<%@: updatedAt:%@; position:%@; >", NSStringFromClass([self class]), _updatedAt, _position]; return descriptionString; } - -@end - -@implementation MCMediaPlaybackClusterPlaybackPosition : MCMediaPlaybackClusterPlaybackPositionStruct -@dynamic updatedAt; -@dynamic position; @end @implementation MCMediaPlaybackClusterTrackAttributesStruct @@ -81,7 +75,6 @@ - (NSString *)description NSString * descriptionString = [NSString stringWithFormat:@"<%@: languageCode:%@; displayName:%@; >", NSStringFromClass([self class]), _languageCode, _displayName]; return descriptionString; } - @end @implementation MCMediaPlaybackClusterTrackStruct @@ -111,7 +104,6 @@ - (NSString *)description NSString * descriptionString = [NSString stringWithFormat:@"<%@: id:%@; trackAttributes:%@; >", NSStringFromClass([self class]), _id, _trackAttributes]; return descriptionString; } - @end @implementation MCApplicationBasicClusterApplicationStruct @@ -161,10 +153,6 @@ - (NSString * _Nonnull)applicationId { return self.applicationID; } - -@end - -@implementation MCApplicationBasicClusterApplicationBasicApplication : MCApplicationBasicClusterApplicationStruct @end @implementation MCTargetNavigatorClusterTargetInfoStruct @@ -194,12 +182,6 @@ - (NSString *)description NSString * descriptionString = [NSString stringWithFormat:@"<%@: identifier:%@; name:%@; >", NSStringFromClass([self class]), _identifier, _name]; return descriptionString; } - -@end - -@implementation MCTargetNavigatorClusterTargetInfo : MCTargetNavigatorClusterTargetInfoStruct -@dynamic identifier; -@dynamic name; @end @implementation MCApplicationLauncherClusterApplicationStruct @@ -249,10 +231,6 @@ - (NSString * _Nonnull)applicationId { return self.applicationID; } - -@end - -@implementation MCApplicationLauncherClusterApplication : MCApplicationLauncherClusterApplicationStruct @end @implementation MCApplicationLauncherClusterApplicationEPStruct @@ -282,10 +260,270 @@ - (NSString *)description NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; endpoint:%@; >", NSStringFromClass([self class]), _application, _endpoint]; return descriptionString; } +@end + +@implementation MCContentLauncherClusterContentSearchStruct +- (instancetype)init +{ + if (self = [super init]) { + + _parameterList = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterContentSearchStruct alloc] init]; + + other.parameterList = self.parameterList; + + return other; +} +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: parameterList:%@; >", NSStringFromClass([self class]), _parameterList]; + return descriptionString; +} @end -@implementation MCApplicationLauncherClusterApplicationEP : MCApplicationLauncherClusterApplicationEPStruct -@dynamic application; -@dynamic endpoint; +@implementation MCContentLauncherClusterTrackPreferenceStruct +- (instancetype)init +{ + if (self = [super init]) { + + _languageCode = @""; + + _characteristics = nil; + + _audioOutputIndex = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterTrackPreferenceStruct 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 MCContentLauncherClusterPlaybackPreferencesStruct +- (instancetype)init +{ + if (self = [super init]) { + + _playbackPosition = @(0); + + _textTrack = [MCContentLauncherClusterTrackPreferenceStruct new]; + + _audioTracks = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterPlaybackPreferencesStruct 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 MCContentLauncherClusterDimensionStruct +- (instancetype)init +{ + if (self = [super init]) { + + _width = @(0); + + _height = @(0); + + _metric = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterDimensionStruct alloc] init]; + + other.width = self.width; + other.height = self.height; + other.metric = self.metric; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: width:%@; height:%@; metric:%@; >", NSStringFromClass([self class]), _width, _height, _metric]; + return descriptionString; +} +@end + +@implementation MCContentLauncherClusterStyleInformationStruct +- (instancetype)init +{ + if (self = [super init]) { + + _imageURL = nil; + + _color = nil; + + _size = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterStyleInformationStruct alloc] init]; + + other.imageURL = self.imageURL; + other.color = self.color; + other.size = self.size; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: imageURL:%@; color:%@; size:%@; >", NSStringFromClass([self class]), _imageURL, _color, _size]; + return descriptionString; +} + +- (void)setImageUrl:(NSString * _Nullable)imageUrl +{ + self.imageURL = imageUrl; +} + +- (NSString * _Nullable)imageUrl +{ + return self.imageURL; +} +@end + +@implementation MCContentLauncherClusterBrandingInformationStruct +- (instancetype)init +{ + if (self = [super init]) { + + _providerName = @""; + + _background = nil; + + _logo = nil; + + _progressBar = nil; + + _splash = nil; + + _waterMark = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterBrandingInformationStruct alloc] init]; + + other.providerName = self.providerName; + other.background = self.background; + other.logo = self.logo; + other.progressBar = self.progressBar; + other.splash = self.splash; + other.waterMark = self.waterMark; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: providerName:%@; background:%@; logo:%@; progressBar:%@; splash:%@; waterMark:%@; >", NSStringFromClass([self class]), _providerName, _background, _logo, _progressBar, _splash, _waterMark]; + return descriptionString; +} +@end + +@implementation MCContentLauncherClusterParameterStruct +- (instancetype)init +{ + if (self = [super init]) { + + _type = @(0); + + _value = @""; + + _externalIDList = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterParameterStruct alloc] init]; + + other.type = self.type; + other.value = self.value; + other.externalIDList = self.externalIDList; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: type:%@; value:%@; externalIDList:%@; >", NSStringFromClass([self class]), _type, _value, _externalIDList]; + return descriptionString; +} +@end + +@implementation MCContentLauncherClusterAdditionalInfoStruct +- (instancetype)init +{ + if (self = [super init]) { + + _name = @""; + + _value = @""; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MCContentLauncherClusterAdditionalInfoStruct 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 diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.h deleted file mode 100644 index fa039162149609..00000000000000 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCStructsObjc.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * Copyright (c) 2020-2024 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#ifndef MCStructsObjc_h -#define MCStructsObjc_h - -@interface MCMediaPlaybackClusterPlaybackPositionStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull updatedAt; -@property (nonatomic, copy) NSNumber * _Nullable position; -@end - -@interface MCMediaPlaybackClusterTrackAttributesStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull languageCode; -@property (nonatomic, copy) NSString * _Nullable displayName; -@end - -@interface MCMediaPlaybackClusterTrackStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull id; -@property (nonatomic, copy) MCMediaPlaybackClusterTrackAttributesStruct * _Nullable trackAttributes; -@end - -@interface MCApplicationBasicClusterApplicationStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorID; -@property (nonatomic, copy) NSString * _Nonnull applicationID; -@end - -@interface MCTargetNavigatorClusterTargetInfoStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull identifier; -@property (nonatomic, copy) NSString * _Nonnull name; -@end - -@interface MCApplicationLauncherClusterApplicationStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorID; -@property (nonatomic, copy) NSString * _Nonnull applicationID; -@end - -@interface MCApplicationLauncherClusterApplicationEPStruct : NSObject -@property (nonatomic, copy) MCApplicationLauncherClusterApplicationStruct * _Nonnull application; -@property (nonatomic, copy) NSNumber * _Nullable endpoint; -@end - -#endif /* MCStructsObjc_h */ diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift index b74a91a77b7286..302ec886b4e115 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MCContentLauncherLaunchURLExampleViewModel.swift @@ -60,7 +60,7 @@ class MCContentLauncherLaunchURLExampleViewModel: ObservableObject { } // create the LaunchURL request - let request: MCContentLauncherClusterLaunchURLRequest = MCContentLauncherClusterLaunchURLRequest() + let request: MCContentLauncherClusterLaunchURLParams = MCContentLauncherClusterLaunchURLParams() request.contentURL = contentUrl request.displayString = displayString