From 490e99689ed428119d274df515fa1f9ef79e5f11 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 18 Feb 2025 22:22:59 -0800 Subject: [PATCH 1/2] Align xml defination for WebRTC provider cluster with spec --- .../chip/webrtc-provider-cluster.xml | 25 ++++---- .../data_model/controller-clusters.matter | 24 +++---- .../chip/devicecontroller/ChipClusters.java | 22 +++---- .../devicecontroller/ClusterIDMapping.java | 10 +-- .../devicecontroller/ClusterInfoMapping.java | 28 ++++----- .../WebRTCTransportProviderCluster.kt | 58 ++++++++++++----- .../python/chip/clusters/CHIPClusters.py | 4 +- .../python/chip/clusters/Objects.py | 18 +++--- .../CHIP/zap-generated/MTRBaseClusters.h | 14 ++--- .../CHIP/zap-generated/MTRBaseClusters.mm | 6 +- .../CHIP/zap-generated/MTRClusterConstants.h | 2 +- .../CHIP/zap-generated/MTRClusterNames.mm | 4 +- .../CHIP/zap-generated/MTRClusters.h | 2 +- .../CHIP/zap-generated/MTRClusters.mm | 6 +- .../zap-generated/MTRCommandPayloadsObjc.h | 8 +-- .../zap-generated/MTRCommandPayloadsObjc.mm | 62 +++++++++++++++---- .../MTRCommandPayloads_Internal.h | 2 +- .../app-common/zap-generated/callback.h | 6 +- .../app-common/zap-generated/cluster-enums.h | 8 +-- .../zap-generated/cluster-objects.cpp | 10 +-- .../zap-generated/cluster-objects.h | 36 +++++------ .../app-common/zap-generated/ids/Commands.h | 4 +- .../zap-generated/cluster/Commands.h | 31 +++++----- .../cluster/logging/EntryToText.cpp | 4 +- .../zap-generated/cluster/Commands.h | 34 ++++++---- 25 files changed, 251 insertions(+), 177 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml index e60f57b89cd87e..a111f07c47fbd2 100644 --- a/src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml @@ -21,9 +21,8 @@ Parameters: in-progress Git: 0.9-fall2024-234-gf4d359001 --> - - - + + @@ -64,11 +63,11 @@ Git: 0.9-fall2024-234-gf4d359001 - + - + Cameras WebRTC Transport Provider 0x0553 WEBRTC_TRANSPORT_PROVIDER_CLUSTER @@ -84,7 +83,7 @@ Git: 0.9-fall2024-234-gf4d359001 - + @@ -104,14 +103,14 @@ Git: 0.9-fall2024-234-gf4d359001 - + - This command contains information about the stream created as a response to the requestor's offer. + This command contains information about the session and streams created as a response to the requestor's offer. - - + + @@ -120,10 +119,10 @@ Git: 0.9-fall2024-234-gf4d359001 - - This command allows for https://www.rfc-editor.org/rfc/rfc8839#section-4.2.1.2 nominated after the initial Offer / Answer exchange to be added to a session during the gathering phase. + + This command allows for https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange to be added to a session during the gathering phase. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 671c65988c6e17..8cad3324941963 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -10104,7 +10104,7 @@ provisional cluster WebRTCTransportProvider = 1363 { kUnknownReason = 11; } - bitmap WebRTCMetadataOptions : bitmap8 { + bitmap WebRTCMetadataOptionsBitmap : bitmap8 { kDataTLV = 0x1; } @@ -10122,7 +10122,7 @@ provisional cluster WebRTCTransportProvider = 1363 { StreamUsageEnum streamUsage = 4; nullable int16u videoStreamID = 5; nullable int16u audioStreamID = 6; - WebRTCMetadataOptions metadataOptions = 7; + WebRTCMetadataOptionsBitmap metadataOptions = 7; } readonly attribute WebRTCSessionStruct currentSessions[] = 0; @@ -10139,7 +10139,7 @@ provisional cluster WebRTCTransportProvider = 1363 { optional nullable int16u audioStreamID = 2; optional ICEServerStruct ICEServers[] = 3; optional char_string ICETransportPolicy = 4; - optional WebRTCMetadataOptions metadataOptions = 5; + optional WebRTCMetadataOptionsBitmap metadataOptions = 5; } response struct SolicitOfferResponse = 2 { @@ -10157,13 +10157,13 @@ provisional cluster WebRTCTransportProvider = 1363 { optional nullable int16u audioStreamID = 4; optional ICEServerStruct ICEServers[] = 5; optional char_string ICETransportPolicy = 6; - optional WebRTCMetadataOptions metadataOptions = 7; + optional WebRTCMetadataOptionsBitmap metadataOptions = 7; } response struct ProvideOfferResponse = 4 { int16u webRTCSessionID = 0; - int16u videoStreamID = 1; - int16u audioStreamID = 2; + optional nullable int16u videoStreamID = 1; + optional nullable int16u audioStreamID = 2; } request struct ProvideAnswerRequest { @@ -10171,9 +10171,9 @@ provisional cluster WebRTCTransportProvider = 1363 { char_string sdp = 1; } - request struct ProvideICECandidateRequest { + request struct ProvideICECandidatesRequest { int16u webRTCSessionID = 0; - char_string ICECandidate = 1; + char_string ICECandidates[] = 1; } request struct EndSessionRequest { @@ -10187,8 +10187,8 @@ provisional cluster WebRTCTransportProvider = 1363 { command ProvideOffer(ProvideOfferRequest): ProvideOfferResponse = 3; /** This command SHALL be initiated from a Node in response to an Offer that was previously received from a remote peer. */ command ProvideAnswer(ProvideAnswerRequest): DefaultSuccess = 5; - /** This command allows for https://www.rfc-editor.org/rfc/rfc8839#section-4.2.1.2 nominated after the initial Offer / Answer exchange to be added to a session during the gathering phase. */ - command ProvideICECandidate(ProvideICECandidateRequest): DefaultSuccess = 6; + /** This command allows for https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange to be added to a session during the gathering phase. */ + command ProvideICECandidates(ProvideICECandidatesRequest): DefaultSuccess = 6; /** This command instructs the stream provider to end the WebRTC session. */ command EndSession(EndSessionRequest): DefaultSuccess = 7; } @@ -10219,7 +10219,7 @@ provisional cluster WebRTCTransportRequestor = 1364 { kUnknownReason = 11; } - bitmap WebRTCMetadataOptions : bitmap8 { + bitmap WebRTCMetadataOptionsBitmap : bitmap8 { kDataTLV = 0x1; } @@ -10237,7 +10237,7 @@ provisional cluster WebRTCTransportRequestor = 1364 { StreamUsageEnum streamUsage = 4; nullable int16u videoStreamID = 5; nullable int16u audioStreamID = 6; - WebRTCMetadataOptions metadataOptions = 7; + WebRTCMetadataOptionsBitmap metadataOptions = 7; } readonly attribute WebRTCSessionStruct currentSessions[] = 0; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 2b79ba4e5b2e48..0954346ca17c22 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -62931,9 +62931,9 @@ public void onResponse(StructType invokeStructValue) { final long webRTCSessionIDFieldID = 0L; Integer webRTCSessionID = null; final long videoStreamIDFieldID = 1L; - Integer videoStreamID = null; + @Nullable Optional videoStreamID = null; final long audioStreamIDFieldID = 2L; - Integer audioStreamID = null; + @Nullable Optional audioStreamID = null; for (StructElement element: invokeStructValue.value()) { if (element.contextTagNum() == webRTCSessionIDFieldID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -62943,12 +62943,12 @@ public void onResponse(StructType invokeStructValue) { } else if (element.contextTagNum() == videoStreamIDFieldID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - videoStreamID = castingValue.value(Integer.class); + videoStreamID = Optional.of(castingValue.value(Integer.class)); } } else if (element.contextTagNum() == audioStreamIDFieldID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - audioStreamID = castingValue.value(Integer.class); + audioStreamID = Optional.of(castingValue.value(Integer.class)); } } } @@ -62980,11 +62980,11 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public void provideICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate) { - provideICECandidate(callback, webRTCSessionID, ICECandidate, 0); + public void provideICECandidates(DefaultClusterCallback callback, Integer webRTCSessionID, ArrayList ICECandidates) { + provideICECandidates(callback, webRTCSessionID, ICECandidates, 0); } - public void provideICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate, int timedInvokeTimeoutMs) { + public void provideICECandidates(DefaultClusterCallback callback, Integer webRTCSessionID, ArrayList ICECandidates, int timedInvokeTimeoutMs) { final long commandId = 6L; ArrayList elements = new ArrayList<>(); @@ -62992,9 +62992,9 @@ public void provideICECandidate(DefaultClusterCallback callback, Integer webRTCS 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) { @@ -63033,7 +63033,7 @@ public interface SolicitOfferResponseCallback extends BaseClusterCallback { } public interface ProvideOfferResponseCallback extends BaseClusterCallback { - void onSuccess(Integer webRTCSessionID, Integer videoStreamID, Integer audioStreamID); + void onSuccess(Integer webRTCSessionID, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID); } public interface CurrentSessionsAttributeCallback extends BaseAttributeCallback { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 7b447ab45c3467..e8bcd3a10f3364 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -17825,7 +17825,7 @@ public enum Command { SolicitOffer(1L), ProvideOffer(3L), ProvideAnswer(5L), - ProvideICECandidate(6L), + ProvideICECandidates(6L), EndSession(7L),; private final long id; Command(long id) { @@ -17895,17 +17895,17 @@ public static ProvideAnswerCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ProvideICECandidateCommandField {WebRTCSessionID(0),ICECandidate(1),; + }public enum ProvideICECandidatesCommandField {WebRTCSessionID(0),ICECandidates(1),; private final int id; - ProvideICECandidateCommandField(int id) { + ProvideICECandidatesCommandField(int id) { this.id = id; } public int getID() { return id; } - public static ProvideICECandidateCommandField value(int id) throws NoSuchFieldError { - for (ProvideICECandidateCommandField field : ProvideICECandidateCommandField.values()) { + public static ProvideICECandidatesCommandField value(int id) throws NoSuchFieldError { + for (ProvideICECandidatesCommandField field : ProvideICECandidatesCommandField.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 01152f94a27e12..11265d63eeafa1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -20861,14 +20861,14 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer webRTCSessionID, Integer videoStreamID, Integer audioStreamID) { + public void onSuccess(Integer webRTCSessionID, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo webRTCSessionIDResponseValue = new CommandResponseInfo("webRTCSessionID", "Integer"); responseValues.put(webRTCSessionIDResponseValue, webRTCSessionID); - CommandResponseInfo videoStreamIDResponseValue = new CommandResponseInfo("videoStreamID", "Integer"); + CommandResponseInfo videoStreamIDResponseValue = new CommandResponseInfo("videoStreamID", "Optional"); responseValues.put(videoStreamIDResponseValue, videoStreamID); - CommandResponseInfo audioStreamIDResponseValue = new CommandResponseInfo("audioStreamID", "Integer"); + CommandResponseInfo audioStreamIDResponseValue = new CommandResponseInfo("audioStreamID", "Optional"); responseValues.put(audioStreamIDResponseValue, audioStreamID); callback.onSuccess(responseValues); } @@ -31032,27 +31032,27 @@ public Map> getCommandMap() { ); webRTCTransportProviderClusterInteractionInfoMap.put("provideAnswer", webRTCTransportProviderprovideAnswerInteractionInfo); - Map webRTCTransportProviderprovideICECandidateCommandParams = new LinkedHashMap(); + Map webRTCTransportProviderprovideICECandidatesCommandParams = new LinkedHashMap(); - CommandParameterInfo webRTCTransportProviderprovideICECandidatewebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); - webRTCTransportProviderprovideICECandidateCommandParams.put("webRTCSessionID",webRTCTransportProviderprovideICECandidatewebRTCSessionIDCommandParameterInfo); + CommandParameterInfo webRTCTransportProviderprovideICECandidateswebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); + webRTCTransportProviderprovideICECandidatesCommandParams.put("webRTCSessionID",webRTCTransportProviderprovideICECandidateswebRTCSessionIDCommandParameterInfo); - CommandParameterInfo webRTCTransportProviderprovideICECandidateICECandidateCommandParameterInfo = new CommandParameterInfo("ICECandidate", String.class, String.class); - webRTCTransportProviderprovideICECandidateCommandParams.put("ICECandidate",webRTCTransportProviderprovideICECandidateICECandidateCommandParameterInfo); - InteractionInfo webRTCTransportProviderprovideICECandidateInteractionInfo = new InteractionInfo( + CommandParameterInfo webRTCTransportProviderprovideICECandidatesICECandidatesCommandParameterInfo = new CommandParameterInfo("ICECandidates", ArrayList.class, ArrayList.class); + webRTCTransportProviderprovideICECandidatesCommandParams.put("ICECandidates",webRTCTransportProviderprovideICECandidatesICECandidatesCommandParameterInfo); + InteractionInfo webRTCTransportProviderprovideICECandidatesInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.WebRTCTransportProviderCluster) cluster) - .provideICECandidate((DefaultClusterCallback) callback + .provideICECandidates((DefaultClusterCallback) callback , (Integer) commandArguments.get("webRTCSessionID") - , (String) - commandArguments.get("ICECandidate") + , (ArrayList) + commandArguments.get("ICECandidates") ); }, () -> new DelegatedDefaultClusterCallback(), - webRTCTransportProviderprovideICECandidateCommandParams + webRTCTransportProviderprovideICECandidatesCommandParams ); - webRTCTransportProviderClusterInteractionInfoMap.put("provideICECandidate", webRTCTransportProviderprovideICECandidateInteractionInfo); + webRTCTransportProviderClusterInteractionInfoMap.put("provideICECandidates", webRTCTransportProviderprovideICECandidatesInteractionInfo); Map webRTCTransportProviderendSessionCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportProviderCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportProviderCluster.kt index 26a9d7cb498940..57e0d0283b56b5 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportProviderCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportProviderCluster.kt @@ -52,8 +52,8 @@ class WebRTCTransportProviderCluster( class ProvideOfferResponse( val webRTCSessionID: UShort, - val videoStreamID: UShort, - val audioStreamID: UShort, + val videoStreamID: UShort?, + val audioStreamID: UShort?, ) class CurrentSessionsAttribute( @@ -328,11 +328,41 @@ class WebRTCTransportProviderCluster( } if (tag == ContextSpecificTag(TAG_VIDEO_STREAM_ID)) { - videoStreamID_decoded = tlvReader.getUShort(tag) + videoStreamID_decoded = + if (tlvReader.isNull()) { + tlvReader.getNull(tag) + null + } else { + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(tag)) { + tlvReader.getUShort(tag) + } else { + null + } + } else { + tlvReader.getNull(tag) + null + } + } } if (tag == ContextSpecificTag(TAG_AUDIO_STREAM_ID)) { - audioStreamID_decoded = tlvReader.getUShort(tag) + audioStreamID_decoded = + if (tlvReader.isNull()) { + tlvReader.getNull(tag) + null + } else { + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(tag)) { + tlvReader.getUShort(tag) + } else { + null + } + } else { + tlvReader.getNull(tag) + null + } + } } else { tlvReader.skipElement() } @@ -342,14 +372,6 @@ class WebRTCTransportProviderCluster( throw IllegalStateException("webRTCSessionID not found in TLV") } - if (videoStreamID_decoded == null) { - throw IllegalStateException("videoStreamID not found in TLV") - } - - if (audioStreamID_decoded == null) { - throw IllegalStateException("audioStreamID not found in TLV") - } - tlvReader.exitContainer() return ProvideOfferResponse( @@ -387,9 +409,9 @@ class WebRTCTransportProviderCluster( logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun provideICECandidate( + suspend fun provideICECandidates( webRTCSessionID: UShort, - ICECandidate: String, + ICECandidates: List, timedInvokeTimeout: Duration? = null, ) { val commandId: UInt = 6u @@ -400,8 +422,12 @@ class WebRTCTransportProviderCluster( 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 8bda4542b106ec..e828e0b7474c2d 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -13098,10 +13098,10 @@ class ChipClusters: }, 0x00000006: { "commandId": 0x00000006, - "commandName": "ProvideICECandidate", + "commandName": "ProvideICECandidates", "args": { "webRTCSessionID": "int", - "ICECandidate": "str", + "ICECandidates": "str", }, }, 0x00000007: { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 47a513abcc9f09..26abb059df7a95 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -47256,7 +47256,7 @@ class WebRTCEndReasonEnum(MatterIntEnum): kUnknownEnumValue = 12 class Bitmaps: - class WebRTCMetadataOptions(IntFlag): + class WebRTCMetadataOptionsBitmap(IntFlag): kDataTLV = 0x1 class Structs: @@ -47391,13 +47391,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=1, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=2, Type=typing.Union[None, Nullable, uint]), ]) webRTCSessionID: uint = 0 - videoStreamID: uint = 0 - audioStreamID: uint = 0 + videoStreamID: typing.Union[None, Nullable, uint] = None + audioStreamID: typing.Union[None, Nullable, uint] = None @dataclass class ProvideAnswer(ClusterCommand): @@ -47418,7 +47418,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: sdp: str = "" @dataclass - class ProvideICECandidate(ClusterCommand): + class ProvideICECandidates(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x00000553 command_id: typing.ClassVar[int] = 0x00000006 is_client: typing.ClassVar[bool] = True @@ -47429,11 +47429,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 EndSession(ClusterCommand): @@ -47606,7 +47606,7 @@ class WebRTCEndReasonEnum(MatterIntEnum): kUnknownEnumValue = 12 class Bitmaps: - class WebRTCMetadataOptions(IntFlag): + class WebRTCMetadataOptionsBitmap(IntFlag): kDataTLV = 0x1 class Structs: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 0db598d9b07ed6..b4321c273eb238 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14788,11 +14788,11 @@ MTR_PROVISIONALLY_AVAILABLE */ - (void)provideAnswerWithParams:(MTRWebRTCTransportProviderClusterProvideAnswerParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** - * Command ProvideICECandidate + * Command ProvideICECandidates * - * This command allows for https://www.rfc-editor.org/rfc/rfc8839#section-4.2.1.2 nominated after the initial Offer / Answer exchange to be added to a session during the gathering phase. + * This command allows for https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange to be added to a session during the gathering phase. */ -- (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidateParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)provideICECandidatesWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidatesParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** * Command EndSession * @@ -20689,8 +20689,8 @@ typedef NS_ENUM(uint8_t, MTRWebRTCTransportProviderWebRTCEndReason) { MTRWebRTCTransportProviderWebRTCEndReasonUnknownReason MTR_PROVISIONALLY_AVAILABLE = 0x0B, } MTR_PROVISIONALLY_AVAILABLE; -typedef NS_OPTIONS(uint8_t, MTRWebRTCTransportProviderWebRTCMetadataOptions) { - MTRWebRTCTransportProviderWebRTCMetadataOptionsDataTLV MTR_PROVISIONALLY_AVAILABLE = 0x1, +typedef NS_OPTIONS(uint8_t, MTRWebRTCTransportProviderWebRTCMetadataOptionsBitmap) { + MTRWebRTCTransportProviderWebRTCMetadataOptionsBitmapDataTLV MTR_PROVISIONALLY_AVAILABLE = 0x1, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRWebRTCTransportRequestorStreamUsage) { @@ -20715,8 +20715,8 @@ typedef NS_ENUM(uint8_t, MTRWebRTCTransportRequestorWebRTCEndReason) { MTRWebRTCTransportRequestorWebRTCEndReasonUnknownReason MTR_PROVISIONALLY_AVAILABLE = 0x0B, } MTR_PROVISIONALLY_AVAILABLE; -typedef NS_OPTIONS(uint8_t, MTRWebRTCTransportRequestorWebRTCMetadataOptions) { - MTRWebRTCTransportRequestorWebRTCMetadataOptionsDataTLV MTR_PROVISIONALLY_AVAILABLE = 0x1, +typedef NS_OPTIONS(uint8_t, MTRWebRTCTransportRequestorWebRTCMetadataOptionsBitmap) { + MTRWebRTCTransportRequestorWebRTCMetadataOptionsBitmapDataTLV MTR_PROVISIONALLY_AVAILABLE = 0x1, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRPushAVStreamTransportContainerFormat) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 3d2dc1449d73f0..320bc2286eb287 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -101349,10 +101349,10 @@ - (void)provideAnswerWithParams:(MTRWebRTCTransportProviderClusterProvideAnswerP queue:self.callbackQueue completion:responseHandler]; } -- (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidateParams *)params completion:(MTRStatusCompletion)completion +- (void)provideICECandidatesWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidatesParams *)params completion:(MTRStatusCompletion)completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams + params = [[MTRWebRTCTransportProviderClusterProvideICECandidatesParams alloc] init]; } @@ -101362,7 +101362,7 @@ - (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideI auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::ProvideICECandidate::Type; + using RequestType = WebRTCTransportProvider::Commands::ProvideICECandidates::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 4f514715da7644..f538a4f96db3c6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -6990,7 +6990,7 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterWebRTCTransportProviderCommandProvideOfferID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, MTRCommandIDTypeClusterWebRTCTransportProviderCommandProvideOfferResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, MTRCommandIDTypeClusterWebRTCTransportProviderCommandProvideAnswerID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, - MTRCommandIDTypeClusterWebRTCTransportProviderCommandProvideICECandidateID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRCommandIDTypeClusterWebRTCTransportProviderCommandProvideICECandidatesID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, MTRCommandIDTypeClusterWebRTCTransportProviderCommandEndSessionID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, // Cluster WebRTCTransportRequestor commands diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 6f1498c91e32e6..a88facb4cc2cc4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -11098,8 +11098,8 @@ result = @"ProvideAnswer"; break; - case MTRCommandIDTypeClusterWebRTCTransportProviderCommandProvideICECandidateID: - result = @"ProvideICECandidate"; + case MTRCommandIDTypeClusterWebRTCTransportProviderCommandProvideICECandidatesID: + result = @"ProvideICECandidates"; break; case MTRCommandIDTypeClusterWebRTCTransportProviderCommandEndSessionID: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index dabafeb2d21895..61665512942748 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6895,7 +6895,7 @@ MTR_PROVISIONALLY_AVAILABLE - (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)provideOfferWithParams:(MTRWebRTCTransportProviderClusterProvideOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWebRTCTransportProviderClusterProvideOfferResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)provideAnswerWithParams:(MTRWebRTCTransportProviderClusterProvideAnswerParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)provideICECandidatesWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidatesParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)endSessionWithParams:(MTRWebRTCTransportProviderClusterEndSessionParams *)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 a4c7fe64bda10a..76b648d112702c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -20144,10 +20144,10 @@ - (void)provideAnswerWithParams:(MTRWebRTCTransportProviderClusterProvideAnswerP completion:responseHandler]; } -- (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +- (void)provideICECandidatesWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidatesParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams + params = [[MTRWebRTCTransportProviderClusterProvideICECandidatesParams alloc] init]; } @@ -20157,7 +20157,7 @@ - (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideI auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::ProvideICECandidate::Type; + using RequestType = WebRTCTransportProvider::Commands::ProvideICECandidates::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 4a562b3ba21ecb..475459906abb6b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -11833,9 +11833,9 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull webRTCSessionID MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable videoStreamID MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull audioStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable audioStreamID MTR_PROVISIONALLY_AVAILABLE; /** * Initialize an MTRWebRTCTransportProviderClusterProvideOfferResponseParams with a response-value dictionary @@ -11884,11 +11884,11 @@ MTR_PROVISIONALLY_AVAILABLE @end MTR_PROVISIONALLY_AVAILABLE -@interface MTRWebRTCTransportProviderClusterProvideICECandidateParams : NSObject +@interface MTRWebRTCTransportProviderClusterProvideICECandidatesParams : 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 b1714a5181ca27..0f1e62bdbef766 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -34620,9 +34620,9 @@ - (instancetype)init _webRTCSessionID = @(0); - _videoStreamID = @(0); + _videoStreamID = nil; - _audioStreamID = @(0); + _audioStreamID = nil; } return self; } @@ -34694,10 +34694,26 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::WebRTCTr self.webRTCSessionID = [NSNumber numberWithUnsignedShort:decodableStruct.webRTCSessionID]; } { - self.videoStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.videoStreamID]; + if (decodableStruct.videoStreamID.HasValue()) { + if (decodableStruct.videoStreamID.Value().IsNull()) { + self.videoStreamID = nil; + } else { + self.videoStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.videoStreamID.Value().Value()]; + } + } else { + self.videoStreamID = nil; + } } { - self.audioStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.audioStreamID]; + if (decodableStruct.audioStreamID.HasValue()) { + if (decodableStruct.audioStreamID.Value().IsNull()) { + self.audioStreamID = nil; + } else { + self.audioStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.audioStreamID.Value().Value()]; + } + } else { + self.audioStreamID = nil; + } } return CHIP_NO_ERROR; } @@ -34789,14 +34805,14 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRWebRTCTransportProviderClusterProvideICECandidateParams +@implementation MTRWebRTCTransportProviderClusterProvideICECandidatesParams - (instancetype)init { if (self = [super init]) { _webRTCSessionID = @(0); - _iceCandidate = @""; + _iceCandidates = [NSArray array]; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -34805,10 +34821,10 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams alloc] init]; + auto other = [[MTRWebRTCTransportProviderClusterProvideICECandidatesParams alloc] init]; other.webRTCSessionID = self.webRTCSessionID; - other.iceCandidate = self.iceCandidate; + other.iceCandidates = self.iceCandidates; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -34817,23 +34833,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 MTRWebRTCTransportProviderClusterProvideICECandidateParams (InternalMethods) +@implementation MTRWebRTCTransportProviderClusterProvideICECandidatesParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Type encodableStruct; + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidates::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 3b3faa8202ad9c..dc783ce5b9d3ca 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -2236,7 +2236,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface MTRWebRTCTransportProviderClusterProvideICECandidateParams (InternalMethods) +@interface MTRWebRTCTransportProviderClusterProvideICECandidatesParams (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 4f0cc3bd1e7367..ed34a390dc59af 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -7045,11 +7045,11 @@ bool emberAfWebRTCTransportProviderClusterProvideAnswerCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::DecodableType & commandData); /** - * @brief WebRTC Transport Provider Cluster ProvideICECandidate Command callback (from client) + * @brief WebRTC Transport Provider Cluster ProvideICECandidates Command callback (from client) */ -bool emberAfWebRTCTransportProviderClusterProvideICECandidateCallback( +bool emberAfWebRTCTransportProviderClusterProvideICECandidatesCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::DecodableType & commandData); + const chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidates::DecodableType & commandData); /** * @brief WebRTC Transport Provider Cluster EndSession Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index b94e402979fa0d..5fed7680990392 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -177,8 +177,8 @@ enum class WebRTCEndReasonEnum : uint8_t // Bitmaps shared across multiple clusters. -// Bitmap for WebRTCMetadataOptions -enum class WebRTCMetadataOptions : uint8_t +// Bitmap for WebRTCMetadataOptionsBitmap +enum class WebRTCMetadataOptionsBitmap : uint8_t { kDataTLV = 0x1, }; @@ -5781,7 +5781,7 @@ using StreamUsageEnum = Clusters::detail::StreamUsageEnum; using WebRTCEndReasonEnum = Clusters::detail::WebRTCEndReasonEnum; -using WebRTCMetadataOptions = Clusters::detail::WebRTCMetadataOptions; +using WebRTCMetadataOptionsBitmap = Clusters::detail::WebRTCMetadataOptionsBitmap; } // namespace WebRTCTransportProvider namespace WebRTCTransportRequestor { @@ -5790,7 +5790,7 @@ using StreamUsageEnum = Clusters::detail::StreamUsageEnum; using WebRTCEndReasonEnum = Clusters::detail::WebRTCEndReasonEnum; -using WebRTCMetadataOptions = Clusters::detail::WebRTCMetadataOptions; +using WebRTCMetadataOptionsBitmap = Clusters::detail::WebRTCMetadataOptionsBitmap; } // namespace WebRTCTransportRequestor namespace PushAvStreamTransport { 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 e42936851990a3..9b37c723d2dc51 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 @@ -31296,12 +31296,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } } // namespace ProvideAnswer. -namespace ProvideICECandidate { +namespace ProvideICECandidates { 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(); } @@ -31323,9 +31323,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 { @@ -31334,7 +31334,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace ProvideICECandidate. +} // namespace ProvideICECandidates. namespace EndSession { 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 f5313d04cf45be..2b1f128a6f0394 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 @@ -374,7 +374,7 @@ struct Type StreamUsageEnum streamUsage = static_cast(0); DataModel::Nullable videoStreamID; DataModel::Nullable audioStreamID; - chip::BitMask metadataOptions = static_cast>(0); + chip::BitMask metadataOptions = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -43515,10 +43515,10 @@ struct Type; struct DecodableType; } // namespace ProvideAnswer -namespace ProvideICECandidate { +namespace ProvideICECandidates { struct Type; struct DecodableType; -} // namespace ProvideICECandidate +} // namespace ProvideICECandidates namespace EndSession { struct Type; @@ -43551,7 +43551,7 @@ struct Type Optional> audioStreamID; Optional> ICEServers; Optional ICETransportPolicy; - Optional> metadataOptions; + Optional> metadataOptions; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -43571,7 +43571,7 @@ struct DecodableType Optional> audioStreamID; Optional> ICEServers; Optional ICETransportPolicy; - Optional> metadataOptions; + Optional> metadataOptions; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SolicitOffer @@ -43643,7 +43643,7 @@ struct Type Optional> audioStreamID; Optional> ICEServers; Optional ICETransportPolicy; - Optional> metadataOptions; + Optional> metadataOptions; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -43665,7 +43665,7 @@ struct DecodableType Optional> audioStreamID; Optional> ICEServers; Optional ICETransportPolicy; - Optional> metadataOptions; + Optional> metadataOptions; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ProvideOffer @@ -43685,8 +43685,8 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } uint16_t webRTCSessionID = static_cast(0); - uint16_t videoStreamID = static_cast(0); - uint16_t audioStreamID = static_cast(0); + Optional> videoStreamID; + Optional> audioStreamID; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -43702,8 +43702,8 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } uint16_t webRTCSessionID = static_cast(0); - uint16_t videoStreamID = static_cast(0); - uint16_t audioStreamID = static_cast(0); + Optional> videoStreamID; + Optional> audioStreamID; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ProvideOfferResponse @@ -43742,22 +43742,22 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ProvideAnswer -namespace ProvideICECandidate { +namespace ProvideICECandidates { 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::ProvideICECandidate::Id; } + static constexpr CommandId GetCommandId() { return Commands::ProvideICECandidates::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } uint16_t webRTCSessionID = static_cast(0); - chip::CharSpan ICECandidate; + DataModel::List ICECandidates; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -43769,14 +43769,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ProvideICECandidate::Id; } + static constexpr CommandId GetCommandId() { return Commands::ProvideICECandidates::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } uint16_t webRTCSessionID = static_cast(0); - chip::CharSpan ICECandidate; + DataModel::DecodableList ICECandidates; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ProvideICECandidate +}; // namespace ProvideICECandidates namespace EndSession { 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 de6d243ab1785a..611cfcf6e7f140 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 @@ -1974,9 +1974,9 @@ namespace ProvideAnswer { static constexpr CommandId Id = 0x00000005; } // namespace ProvideAnswer -namespace ProvideICECandidate { +namespace ProvideICECandidates { static constexpr CommandId Id = 0x00000006; -} // namespace ProvideICECandidate +} // namespace ProvideICECandidates namespace EndSession { static constexpr CommandId Id = 0x00000007; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 83e14851863579..87f07eef100f7d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -14706,7 +14706,7 @@ class CameraAvSettingsUserLevelManagementDPTZRelativeMove : public ClusterComman | * SolicitOffer | 0x01 | | * ProvideOffer | 0x03 | | * ProvideAnswer | 0x05 | -| * ProvideICECandidate | 0x06 | +| * ProvideICECandidates | 0x06 | | * EndSession | 0x07 | |------------------------------------------------------------------------------| | Attributes: | | @@ -14854,23 +14854,23 @@ class WebRTCTransportProviderProvideAnswer : public ClusterCommand }; /* - * Command ProvideICECandidate + * Command ProvideICECandidates */ -class WebRTCTransportProviderProvideICECandidate : public ClusterCommand +class WebRTCTransportProviderProvideICECandidates : public ClusterCommand { public: - WebRTCTransportProviderProvideICECandidate(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("provide-icecandidate", credsIssuerConfig) + WebRTCTransportProviderProvideICECandidates(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("provide-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::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidates::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -14880,7 +14880,7 @@ class WebRTCTransportProviderProvideICECandidate : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidates::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -14889,7 +14889,8 @@ class WebRTCTransportProviderProvideICECandidate : public ClusterCommand } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Type mRequest; + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidates::Type mRequest; + TypedComplexArgument> mComplex_ICECandidates; }; /* @@ -28375,12 +28376,12 @@ void registerClusterWebRTCTransportProvider(Commands & commands, CredentialIssue // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // 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 d5162cb77c3557..c33b6e45d9af7a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -5857,8 +5857,8 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "ProvideOffer"; case chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Id: return "ProvideAnswer"; - case chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Id: - return "ProvideICECandidate"; + case chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidates::Id: + return "ProvideICECandidates"; case chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Id: return "EndSession"; 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 27dee001243df8..29fb5c1899332e 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -156741,7 +156741,7 @@ class SubscribeAttributeCameraAvSettingsUserLevelManagementClusterRevision : pub | * SolicitOffer | 0x01 | | * ProvideOffer | 0x03 | | * ProvideAnswer | 0x05 | -| * ProvideICECandidate | 0x06 | +| * ProvideICECandidates | 0x06 | | * EndSession | 0x07 | |------------------------------------------------------------------------------| | Attributes: | | @@ -157134,18 +157134,19 @@ class WebRTCTransportProviderProvideAnswer : public ClusterCommand { #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* - * Command ProvideICECandidate + * Command ProvideICECandidates */ -class WebRTCTransportProviderProvideICECandidate : public ClusterCommand { +class WebRTCTransportProviderProvideICECandidates : public ClusterCommand { public: - WebRTCTransportProviderProvideICECandidate() - : ClusterCommand("provide-icecandidate") + WebRTCTransportProviderProvideICECandidates() + : ClusterCommand("provide-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(); } @@ -157153,24 +157154,32 @@ class WebRTCTransportProviderProvideICECandidate : public ClusterCommand { CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidates::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 = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams alloc] init]; + __auto_type * params = [[MTRWebRTCTransportProviderClusterProvideICECandidatesParams 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 provideICECandidateWithParams:params completion: + [cluster provideICECandidatesWithParams:params completion: ^(NSError * _Nullable error) { responsesNeeded--; if (error != nil) { @@ -157187,7 +157196,8 @@ class WebRTCTransportProviderProvideICECandidate : public ClusterCommand { } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Type mRequest; + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidates::Type mRequest; + TypedComplexArgument> mComplex_ICECandidates; }; #endif // MTR_ENABLE_PROVISIONAL @@ -183864,7 +183874,7 @@ void registerClusterWebRTCTransportProvider(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(), // From 82256b2c2412ff77234bfae72364aa5ef8c195ff Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 19 Feb 2025 18:18:56 -0800 Subject: [PATCH 2/2] Generate XML file from alchemy --- .../app-templates/gen_config.h | 4 +-- .../lighting-app/app-templates/gen_config.h | 4 +-- .../chip/webrtc-provider-cluster.xml | 15 +++++--- .../data_model/controller-clusters.matter | 2 +- .../CHIP/zap-generated/MTRBaseClusters.h | 2 +- .../zap-generated/cluster-objects.cpp | 35 +++++++++++++++++++ 6 files changed, 52 insertions(+), 10 deletions(-) diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h index 5c0a838c94fbe2..7db09ed55aedd0 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h @@ -142,7 +142,7 @@ #define MATTER_DM_ZONE_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0) -#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0) +#define MATTER_DM_WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_CHIME_CLUSTER_SERVER_ENDPOINT_COUNT (0) @@ -274,7 +274,7 @@ #define MATTER_DM_ZONE_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) -#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (0) +#define MATTER_DM_WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_CHIME_CLUSTER_CLIENT_ENDPOINT_COUNT (0) diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/gen_config.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/gen_config.h index c577a0ef3b7049..c82d5985948518 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/gen_config.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/gen_config.h @@ -142,7 +142,7 @@ #define MATTER_DM_ZONE_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0) -#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0) +#define MATTER_DM_WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_SERVER_ENDPOINT_COUNT (0) #define MATTER_DM_CHIME_CLUSTER_SERVER_ENDPOINT_COUNT (0) @@ -274,7 +274,7 @@ #define MATTER_DM_ZONE_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) -#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (0) +#define MATTER_DM_WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_CLIENT_ENDPOINT_COUNT (0) #define MATTER_DM_CHIME_CLUSTER_CLIENT_ENDPOINT_COUNT (0) diff --git a/src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml index a111f07c47fbd2..719ed4e26cb27e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml @@ -1,6 +1,6 @@ @@ -70,7 +70,7 @@ Git: 0.9-fall2024-234-gf4d359001 Cameras WebRTC Transport Provider 0x0553 - WEBRTC_TRANSPORT_PROVIDER_CLUSTER + WEB_RTC_TRANSPORT_PROVIDER_CLUSTER The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. true true @@ -78,6 +78,7 @@ Git: 0.9-fall2024-234-gf4d359001 CurrentSessions Requests that the Provider initiates a new session with the Offer / Answer flow in a way that allows for options to be passed and work with devices needing the standby flow. + @@ -88,6 +89,7 @@ Git: 0.9-fall2024-234-gf4d359001 This command SHALL be generated in response to a SolicitOffer command. + @@ -96,6 +98,7 @@ Git: 0.9-fall2024-234-gf4d359001 This command allows an SDP Offer to be set and start a new session. + @@ -108,6 +111,7 @@ Git: 0.9-fall2024-234-gf4d359001 This command contains information about the session and streams created as a response to the requestor's offer. + @@ -115,18 +119,21 @@ Git: 0.9-fall2024-234-gf4d359001 This command SHALL be initiated from a Node in response to an Offer that was previously received from a remote peer. + - This command allows for https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange to be added to a session during the gathering phase. + This command allows for string based https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange, via a JSEP https://datatracker.ietf.org/doc/html/rfc9429#section-4.1.20 event, a DOM https://www.w3.org/TR/webrtc/#dom-rtcpeerconnectioniceevent event, or other WebRTC compliant implementations, to be added to a session during the gathering phase. + This command instructs the stream provider to end the WebRTC session. + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 8cad3324941963..a4b96e6c45f8df 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -10187,7 +10187,7 @@ provisional cluster WebRTCTransportProvider = 1363 { command ProvideOffer(ProvideOfferRequest): ProvideOfferResponse = 3; /** This command SHALL be initiated from a Node in response to an Offer that was previously received from a remote peer. */ command ProvideAnswer(ProvideAnswerRequest): DefaultSuccess = 5; - /** This command allows for https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange to be added to a session during the gathering phase. */ + /** This command allows for string based https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange, via a JSEP https://datatracker.ietf.org/doc/html/rfc9429#section-4.1.20 event, a DOM https://www.w3.org/TR/webrtc/#dom-rtcpeerconnectioniceevent event, or other WebRTC compliant implementations, to be added to a session during the gathering phase. */ command ProvideICECandidates(ProvideICECandidatesRequest): DefaultSuccess = 6; /** This command instructs the stream provider to end the WebRTC session. */ command EndSession(EndSessionRequest): DefaultSuccess = 7; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index b4321c273eb238..817160d18d3cd0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14790,7 +14790,7 @@ MTR_PROVISIONALLY_AVAILABLE /** * Command ProvideICECandidates * - * This command allows for https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange to be added to a session during the gathering phase. + * This command allows for string based https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange, via a JSEP https://datatracker.ietf.org/doc/html/rfc9429#section-4.1.20 event, a DOM https://www.w3.org/TR/webrtc/#dom-rtcpeerconnectioniceevent event, or other WebRTC compliant implementations, to be added to a session during the gathering phase. */ - (void)provideICECandidatesWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidatesParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** 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 9b37c723d2dc51..fb3c6c9c645c5f 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 @@ -37246,6 +37246,41 @@ bool CommandHasLargePayload(ClusterId aCluster, CommandId aCommand) { return true; } + if ((aCluster == Clusters::WebRTCTransportProvider::Id) && + (aCommand == Clusters::WebRTCTransportProvider::Commands::SolicitOffer::Id)) + { + return true; + } + if ((aCluster == Clusters::WebRTCTransportProvider::Id) && + (aCommand == Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::Id)) + { + return true; + } + if ((aCluster == Clusters::WebRTCTransportProvider::Id) && + (aCommand == Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Id)) + { + return true; + } + if ((aCluster == Clusters::WebRTCTransportProvider::Id) && + (aCommand == Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::Id)) + { + return true; + } + if ((aCluster == Clusters::WebRTCTransportProvider::Id) && + (aCommand == Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Id)) + { + return true; + } + if ((aCluster == Clusters::WebRTCTransportProvider::Id) && + (aCommand == Clusters::WebRTCTransportProvider::Commands::ProvideICECandidates::Id)) + { + return true; + } + if ((aCluster == Clusters::WebRTCTransportProvider::Id) && + (aCommand == Clusters::WebRTCTransportProvider::Commands::EndSession::Id)) + { + return true; + } if ((aCluster == Clusters::WebRTCTransportRequestor::Id) && (aCommand == Clusters::WebRTCTransportRequestor::Commands::Offer::Id)) {