diff --git a/src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml index e07c294a45d598..056c09fcc61dfb 100644 --- a/src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml @@ -20,8 +20,8 @@ Source: src/app_clusters/WebRTC_Requestor.adoc Parameters: in-progress Git: 0.9-fall2024-228-g54b1ae035 --> - - + + Cameras WebRTC Transport Requestor @@ -46,10 +46,10 @@ Git: 0.9-fall2024-228-g54b1ae035 - - This command provides an ICE candidate to the stream requestor in a WebRTC session. + + This command provides an ICE candidates to the stream requestor in a WebRTC session. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 2cf8f2799bb6e7..1e6ef4540718c8 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -10260,9 +10260,9 @@ provisional cluster WebRTCTransportRequestor = 1364 { char_string sdp = 1; } - request struct ICECandidateRequest { + request struct ICECandidatesRequest { int16u webRTCSessionID = 0; - char_string ICECandidate = 1; + char_string ICECandidates[] = 1; } request struct EndRequest { @@ -10274,8 +10274,8 @@ provisional cluster WebRTCTransportRequestor = 1364 { command Offer(OfferRequest): DefaultSuccess = 1; /** This command provides the stream requestor with the WebRTC session details (i.e. Session ID and SDP answer). It is the next command in the Offer/Answer flow to the ProvideOffer command. */ command Answer(AnswerRequest): DefaultSuccess = 2; - /** This command provides an ICE candidate to the stream requestor in a WebRTC session. */ - command ICECandidate(ICECandidateRequest): DefaultSuccess = 3; + /** This command provides an ICE candidates to the stream requestor in a WebRTC session. */ + command ICECandidates(ICECandidatesRequest): DefaultSuccess = 3; /** This command notifies the stream requestor that the provider has ended the WebRTC session. */ command End(EndRequest): DefaultSuccess = 4; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index b38d2b97c23bc5..2b79ba4e5b2e48 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -63316,11 +63316,11 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public void ICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate) { - ICECandidate(callback, webRTCSessionID, ICECandidate, 0); + public void ICECandidates(DefaultClusterCallback callback, Integer webRTCSessionID, ArrayList ICECandidates) { + ICECandidates(callback, webRTCSessionID, ICECandidates, 0); } - public void ICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate, int timedInvokeTimeoutMs) { + public void ICECandidates(DefaultClusterCallback callback, Integer webRTCSessionID, ArrayList ICECandidates, int timedInvokeTimeoutMs) { final long commandId = 3L; ArrayList elements = new ArrayList<>(); @@ -63328,9 +63328,9 @@ public void ICECandidate(DefaultClusterCallback callback, Integer webRTCSessionI BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); - final long ICECandidateFieldID = 1L; - BaseTLVType ICECandidatetlvValue = new StringType(ICECandidate); - elements.add(new StructElement(ICECandidateFieldID, ICECandidatetlvValue)); + final long ICECandidatesFieldID = 1L; + BaseTLVType ICECandidatestlvValue = ArrayType.generateArrayType(ICECandidates, (elementICECandidates) -> new StringType(elementICECandidates)); + elements.add(new StructElement(ICECandidatesFieldID, ICECandidatestlvValue)); StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index c8f8714a76dbaa..7b447ab45c3467 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -18015,7 +18015,7 @@ public static Event value(long id) throws NoSuchFieldError { public enum Command { Offer(1L), Answer(2L), - ICECandidate(3L), + ICECandidates(3L), End(4L),; private final long id; Command(long id) { @@ -18068,17 +18068,17 @@ public static AnswerCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ICECandidateCommandField {WebRTCSessionID(0),ICECandidate(1),; + }public enum ICECandidatesCommandField {WebRTCSessionID(0),ICECandidates(1),; private final int id; - ICECandidateCommandField(int id) { + ICECandidatesCommandField(int id) { this.id = id; } public int getID() { return id; } - public static ICECandidateCommandField value(int id) throws NoSuchFieldError { - for (ICECandidateCommandField field : ICECandidateCommandField.values()) { + public static ICECandidatesCommandField value(int id) throws NoSuchFieldError { + for (ICECandidatesCommandField field : ICECandidatesCommandField.values()) { if (field.getID() == id) { return field; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 60e446a4b0ca58..01152f94a27e12 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -31132,27 +31132,27 @@ public Map> getCommandMap() { ); webRTCTransportRequestorClusterInteractionInfoMap.put("answer", webRTCTransportRequestoranswerInteractionInfo); - Map webRTCTransportRequestorICECandidateCommandParams = new LinkedHashMap(); + Map webRTCTransportRequestorICECandidatesCommandParams = new LinkedHashMap(); - CommandParameterInfo webRTCTransportRequestorICECandidatewebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); - webRTCTransportRequestorICECandidateCommandParams.put("webRTCSessionID",webRTCTransportRequestorICECandidatewebRTCSessionIDCommandParameterInfo); + CommandParameterInfo webRTCTransportRequestorICECandidateswebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); + webRTCTransportRequestorICECandidatesCommandParams.put("webRTCSessionID",webRTCTransportRequestorICECandidateswebRTCSessionIDCommandParameterInfo); - CommandParameterInfo webRTCTransportRequestorICECandidateICECandidateCommandParameterInfo = new CommandParameterInfo("ICECandidate", String.class, String.class); - webRTCTransportRequestorICECandidateCommandParams.put("ICECandidate",webRTCTransportRequestorICECandidateICECandidateCommandParameterInfo); - InteractionInfo webRTCTransportRequestorICECandidateInteractionInfo = new InteractionInfo( + CommandParameterInfo webRTCTransportRequestorICECandidatesICECandidatesCommandParameterInfo = new CommandParameterInfo("ICECandidates", ArrayList.class, ArrayList.class); + webRTCTransportRequestorICECandidatesCommandParams.put("ICECandidates",webRTCTransportRequestorICECandidatesICECandidatesCommandParameterInfo); + InteractionInfo webRTCTransportRequestorICECandidatesInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WebRTCTransportRequestorCluster) cluster) - .ICECandidate((DefaultClusterCallback) callback + .ICECandidates((DefaultClusterCallback) callback , (Integer) commandArguments.get("webRTCSessionID") - , (String) - commandArguments.get("ICECandidate") + , (ArrayList) + commandArguments.get("ICECandidates") ); }, () -> new DelegatedDefaultClusterCallback(), - webRTCTransportRequestorICECandidateCommandParams + webRTCTransportRequestorICECandidatesCommandParams ); - webRTCTransportRequestorClusterInteractionInfoMap.put("ICECandidate", webRTCTransportRequestorICECandidateInteractionInfo); + webRTCTransportRequestorClusterInteractionInfoMap.put("ICECandidates", webRTCTransportRequestorICECandidatesInteractionInfo); Map webRTCTransportRequestorendCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt index 2d5f7d8ed57797..2d5262274167fc 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt @@ -164,9 +164,9 @@ class WebRTCTransportRequestorCluster( logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun ICECandidate( + suspend fun ICECandidates( webRTCSessionID: UShort, - ICECandidate: String, + ICECandidates: List, timedInvokeTimeout: Duration? = null, ) { val commandId: UInt = 3u @@ -177,8 +177,12 @@ class WebRTCTransportRequestorCluster( val TAG_WEB_RTC_SESSION_ID_REQ: Int = 0 tlvWriter.put(ContextSpecificTag(TAG_WEB_RTC_SESSION_ID_REQ), webRTCSessionID) - val TAG_ICE_CANDIDATE_REQ: Int = 1 - tlvWriter.put(ContextSpecificTag(TAG_ICE_CANDIDATE_REQ), ICECandidate) + val TAG_ICE_CANDIDATES_REQ: Int = 1 + tlvWriter.startArray(ContextSpecificTag(TAG_ICE_CANDIDATES_REQ)) + for (item in ICECandidates.iterator()) { + tlvWriter.put(AnonymousTag, item) + } + tlvWriter.endArray() tlvWriter.endStructure() val request: InvokeRequest = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 4670cb876acce4..8bda4542b106ec 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -13176,10 +13176,10 @@ class ChipClusters: }, 0x00000003: { "commandId": 0x00000003, - "commandName": "ICECandidate", + "commandName": "ICECandidates", "args": { "webRTCSessionID": "int", - "ICECandidate": "str", + "ICECandidates": "str", }, }, 0x00000004: { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 7d78b3d0d1725c..47a513abcc9f09 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -47692,7 +47692,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: sdp: str = "" @dataclass - class ICECandidate(ClusterCommand): + class ICECandidates(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x00000554 command_id: typing.ClassVar[int] = 0x00000003 is_client: typing.ClassVar[bool] = True @@ -47703,11 +47703,11 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="ICECandidate", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="ICECandidates", Tag=1, Type=typing.List[str]), ]) webRTCSessionID: uint = 0 - ICECandidate: str = "" + ICECandidates: typing.List[str] = field(default_factory=lambda: []) @dataclass class End(ClusterCommand): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index c870fe59474060..7c2359bf07ae6c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14874,11 +14874,11 @@ MTR_PROVISIONALLY_AVAILABLE */ - (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** - * Command ICECandidate + * Command ICECandidates * - * This command provides an ICE candidate to the stream requestor in a WebRTC session. + * This command provides an ICE candidates to the stream requestor in a WebRTC session. */ -- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)ICECandidatesWithParams:(MTRWebRTCTransportRequestorClusterICECandidatesParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** * Command End * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index d963fd1c84f259..3d2dc1449d73f0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -101666,10 +101666,10 @@ - (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)param queue:self.callbackQueue completion:responseHandler]; } -- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params completion:(MTRStatusCompletion)completion +- (void)ICECandidatesWithParams:(MTRWebRTCTransportRequestorClusterICECandidatesParams *)params completion:(MTRStatusCompletion)completion { if (params == nil) { - params = [[MTRWebRTCTransportRequestorClusterICECandidateParams + params = [[MTRWebRTCTransportRequestorClusterICECandidatesParams alloc] init]; } @@ -101679,7 +101679,7 @@ - (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidatePa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportRequestor::Commands::ICECandidate::Type; + using RequestType = WebRTCTransportRequestor::Commands::ICECandidates::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 30f2ece1281569..4606c46cf3915f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -6996,7 +6996,7 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { // Cluster WebRTCTransportRequestor commands MTRCommandIDTypeClusterWebRTCTransportRequestorCommandOfferID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, MTRCommandIDTypeClusterWebRTCTransportRequestorCommandAnswerID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, - MTRCommandIDTypeClusterWebRTCTransportRequestorCommandICECandidateID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterWebRTCTransportRequestorCommandICECandidatesID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, MTRCommandIDTypeClusterWebRTCTransportRequestorCommandEndID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, // Cluster PushAVStreamTransport commands diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 8038ac3e4ec81b..6f1498c91e32e6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -11124,8 +11124,8 @@ result = @"Answer"; break; - case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandICECandidateID: - result = @"ICECandidate"; + case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandICECandidatesID: + result = @"ICECandidates"; break; case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandEndID: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 3772d3319d91ff..dabafeb2d21895 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6936,7 +6936,7 @@ MTR_PROVISIONALLY_AVAILABLE - (void)offerWithParams:(MTRWebRTCTransportRequestorClusterOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)ICECandidatesWithParams:(MTRWebRTCTransportRequestorClusterICECandidatesParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)endWithParams:(MTRWebRTCTransportRequestorClusterEndParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeCurrentSessionsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 5eafb7c45e42ab..a4c7fe64bda10a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -20286,10 +20286,10 @@ - (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)param completion:responseHandler]; } -- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +- (void)ICECandidatesWithParams:(MTRWebRTCTransportRequestorClusterICECandidatesParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { if (params == nil) { - params = [[MTRWebRTCTransportRequestorClusterICECandidateParams + params = [[MTRWebRTCTransportRequestorClusterICECandidatesParams alloc] init]; } @@ -20299,7 +20299,7 @@ - (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidatePa auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportRequestor::Commands::ICECandidate::Type; + using RequestType = WebRTCTransportRequestor::Commands::ICECandidates::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index d4c1559afeefd3..4a562b3ba21ecb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -12016,11 +12016,11 @@ MTR_PROVISIONALLY_AVAILABLE @end MTR_PROVISIONALLY_AVAILABLE -@interface MTRWebRTCTransportRequestorClusterICECandidateParams : NSObject +@interface MTRWebRTCTransportRequestorClusterICECandidatesParams : NSObject @property (nonatomic, copy) NSNumber * _Nonnull webRTCSessionID MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSString * _Nonnull iceCandidate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull iceCandidates MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 6b7e9e6ac8f299..b1714a5181ca27 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -35203,14 +35203,14 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRWebRTCTransportRequestorClusterICECandidateParams +@implementation MTRWebRTCTransportRequestorClusterICECandidatesParams - (instancetype)init { if (self = [super init]) { _webRTCSessionID = @(0); - _iceCandidate = @""; + _iceCandidates = [NSArray array]; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -35219,10 +35219,10 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRWebRTCTransportRequestorClusterICECandidateParams alloc] init]; + auto other = [[MTRWebRTCTransportRequestorClusterICECandidatesParams alloc] init]; other.webRTCSessionID = self.webRTCSessionID; - other.iceCandidate = self.iceCandidate; + other.iceCandidates = self.iceCandidates; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -35231,23 +35231,45 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; iceCandidate:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _iceCandidate]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; iceCandidates:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _iceCandidates]; return descriptionString; } @end -@implementation MTRWebRTCTransportRequestorClusterICECandidateParams (InternalMethods) +@implementation MTRWebRTCTransportRequestorClusterICECandidatesParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Type encodableStruct; + chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidates::Type encodableStruct; ListFreer listFreer; { encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; } { - encodableStruct.ICECandidate = AsCharSpan(self.iceCandidate); + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (self.iceCandidates.count != 0) { + auto * listHolder_0 = new ListHolder(self.iceCandidates.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < self.iceCandidates.count; ++i_0) { + auto element_0 = MTR_SAFE_CAST(self.iceCandidates[i_0], NSString); + if (!element_0) { + // Wrong kind of value. + MTR_LOG_ERROR("%@ incorrectly present in list of %@", self.iceCandidates[i_0], NSStringFromClass(NSString.class)); + return CHIP_ERROR_INVALID_ARGUMENT; + } + listHolder_0->mList[i_0] = AsCharSpan(element_0); + } + encodableStruct.ICECandidates = ListType_0(listHolder_0->mList, self.iceCandidates.count); + } else { + encodableStruct.ICECandidates = ListType_0(); + } + } } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 2fa1bbe3106747..3b3faa8202ad9c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -2260,7 +2260,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface MTRWebRTCTransportRequestorClusterICECandidateParams (InternalMethods) +@interface MTRWebRTCTransportRequestorClusterICECandidatesParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 0195a63f42581f..4f0cc3bd1e7367 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -7069,11 +7069,11 @@ bool emberAfWebRTCTransportRequestorClusterAnswerCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::DecodableType & commandData); /** - * @brief WebRTC Transport Requestor Cluster ICECandidate Command callback (from client) + * @brief WebRTC Transport Requestor Cluster ICECandidates Command callback (from client) */ -bool emberAfWebRTCTransportRequestorClusterICECandidateCallback( +bool emberAfWebRTCTransportRequestorClusterICECandidatesCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::DecodableType & commandData); + const chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidates::DecodableType & commandData); /** * @brief WebRTC Transport Requestor Cluster End Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 0a5464f6f751cc..631f82139ed16a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -31494,12 +31494,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } } // namespace Answer. -namespace ICECandidate { +namespace ICECandidates { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; encoder.Encode(to_underlying(Fields::kWebRTCSessionID), webRTCSessionID); - encoder.Encode(to_underlying(Fields::kICECandidate), ICECandidate); + encoder.Encode(to_underlying(Fields::kICECandidates), ICECandidates); return encoder.Finalize(); } @@ -31521,9 +31521,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, webRTCSessionID); } - else if (__context_tag == to_underlying(Fields::kICECandidate)) + else if (__context_tag == to_underlying(Fields::kICECandidates)) { - err = DataModel::Decode(reader, ICECandidate); + err = DataModel::Decode(reader, ICECandidates); } else { @@ -31532,7 +31532,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace ICECandidate. +} // namespace ICECandidates. namespace End { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index e7fe47d90da7f7..f5313d04cf45be 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -43898,10 +43898,10 @@ struct Type; struct DecodableType; } // namespace Answer -namespace ICECandidate { +namespace ICECandidates { struct Type; struct DecodableType; -} // namespace ICECandidate +} // namespace ICECandidates namespace End { struct Type; @@ -43987,22 +43987,22 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace Answer -namespace ICECandidate { +namespace ICECandidates { enum class Fields : uint8_t { kWebRTCSessionID = 0, - kICECandidate = 1, + kICECandidates = 1, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ICECandidate::Id; } + static constexpr CommandId GetCommandId() { return Commands::ICECandidates::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } uint16_t webRTCSessionID = static_cast(0); - chip::CharSpan ICECandidate; + DataModel::List ICECandidates; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -44014,14 +44014,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ICECandidate::Id; } + static constexpr CommandId GetCommandId() { return Commands::ICECandidates::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } uint16_t webRTCSessionID = static_cast(0); - chip::CharSpan ICECandidate; + DataModel::DecodableList ICECandidates; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ICECandidate +}; // namespace ICECandidates namespace End { enum class Fields : uint8_t { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 3b5fff22a02ea6..de6d243ab1785a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1996,9 +1996,9 @@ namespace Answer { static constexpr CommandId Id = 0x00000002; } // namespace Answer -namespace ICECandidate { +namespace ICECandidates { static constexpr CommandId Id = 0x00000003; -} // namespace ICECandidate +} // namespace ICECandidates namespace End { static constexpr CommandId Id = 0x00000004; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index f9142395d372b5..83e14851863579 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -14937,7 +14937,7 @@ class WebRTCTransportProviderEndSession : public ClusterCommand | Commands: | | | * Offer | 0x01 | | * Answer | 0x02 | -| * ICECandidate | 0x03 | +| * ICECandidates | 0x03 | | * End | 0x04 | |------------------------------------------------------------------------------| | Attributes: | | @@ -15034,23 +15034,23 @@ class WebRTCTransportRequestorAnswer : public ClusterCommand }; /* - * Command ICECandidate + * Command ICECandidates */ -class WebRTCTransportRequestorICECandidate : public ClusterCommand +class WebRTCTransportRequestorICECandidates : public ClusterCommand { public: - WebRTCTransportRequestorICECandidate(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("icecandidate", credsIssuerConfig) + WebRTCTransportRequestorICECandidates(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("icecandidates", credsIssuerConfig), mComplex_ICECandidates(&mRequest.ICECandidates) { AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); - AddArgument("ICECandidate", &mRequest.ICECandidate); + AddArgument("ICECandidates", &mComplex_ICECandidates); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidates::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -15060,7 +15060,7 @@ class WebRTCTransportRequestorICECandidate : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidates::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -15069,7 +15069,8 @@ class WebRTCTransportRequestorICECandidate : public ClusterCommand } private: - chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Type mRequest; + chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidates::Type mRequest; + TypedComplexArgument> mComplex_ICECandidates; }; /* @@ -28431,11 +28432,11 @@ void registerClusterWebRTCTransportRequestor(Commands & commands, CredentialIssu // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index 6ac95e1ca2966e..d5162cb77c3557 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -5872,8 +5872,8 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Offer"; case chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Id: return "Answer"; - case chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id: - return "ICECandidate"; + case chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidates::Id: + return "ICECandidates"; case chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Id: return "End"; default: diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 734f12895e71f4..27dee001243df8 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -157769,7 +157769,7 @@ class SubscribeAttributeWebRTCTransportProviderClusterRevision : public Subscrib | Commands: | | | * Offer | 0x01 | | * Answer | 0x02 | -| * ICECandidate | 0x03 | +| * ICECandidates | 0x03 | | * End | 0x04 | |------------------------------------------------------------------------------| | Attributes: | | @@ -157957,18 +157957,19 @@ class WebRTCTransportRequestorAnswer : public ClusterCommand { #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* - * Command ICECandidate + * Command ICECandidates */ -class WebRTCTransportRequestorICECandidate : public ClusterCommand { +class WebRTCTransportRequestorICECandidates : public ClusterCommand { public: - WebRTCTransportRequestorICECandidate() - : ClusterCommand("icecandidate") + WebRTCTransportRequestorICECandidates() + : ClusterCommand("icecandidates") + , mComplex_ICECandidates(&mRequest.ICECandidates) { #if MTR_ENABLE_PROVISIONAL AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("ICECandidate", &mRequest.ICECandidate); + AddArgument("ICECandidates", &mComplex_ICECandidates); #endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -157976,24 +157977,32 @@ class WebRTCTransportRequestorICECandidate : public ClusterCommand { CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidates::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWebRTCTransportRequestorClusterICECandidateParams alloc] init]; + __auto_type * params = [[MTRWebRTCTransportRequestorClusterICECandidatesParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - params.iceCandidate = [[NSString alloc] initWithBytes:mRequest.ICECandidate.data() length:mRequest.ICECandidate.size() encoding:NSUTF8StringEncoding]; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.ICECandidates) { + NSString * newElement_0; + newElement_0 = [[NSString alloc] initWithBytes:entry_0.data() length:entry_0.size() encoding:NSUTF8StringEncoding]; + [array_0 addObject:newElement_0]; + } + params.iceCandidates = array_0; + } #endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster ICECandidateWithParams:params completion: + [cluster ICECandidatesWithParams:params completion: ^(NSError * _Nullable error) { responsesNeeded--; if (error != nil) { @@ -158010,7 +158019,8 @@ class WebRTCTransportRequestorICECandidate : public ClusterCommand { } private: - chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Type mRequest; + chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidates::Type mRequest; + TypedComplexArgument> mComplex_ICECandidates; }; #endif // MTR_ENABLE_PROVISIONAL @@ -183907,7 +183917,7 @@ void registerClusterWebRTCTransportRequestor(Commands & commands) make_unique(), // #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - make_unique(), // + make_unique(), // #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), //