Skip to content

Commit e3b154f

Browse files
yufengwangcagmarcosb
authored andcommitted
Align XML definitions for WebRTC Requester cluster with spec (project-chip#37650)
* Align XML definations for WebRTC Requester cluster with spec * Generate the xml from Alchemy
1 parent 1b43ecf commit e3b154f

File tree

25 files changed

+160
-119
lines changed

25 files changed

+160
-119
lines changed

scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
#define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
144144
#define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
145145
#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0)
146-
#define MATTER_DM_WEBRTC_TRANSPORT_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (0)
146+
#define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (0)
147147
#define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
148148
#define MATTER_DM_CHIME_CLUSTER_SERVER_ENDPOINT_COUNT (0)
149149
#define MATTER_DM_ECOSYSTEM_INFORMATION_CLUSTER_SERVER_ENDPOINT_COUNT (0)
@@ -275,7 +275,7 @@
275275
#define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
276276
#define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
277277
#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
278-
#define MATTER_DM_WEBRTC_TRANSPORT_REQUESTOR_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
278+
#define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
279279
#define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
280280
#define MATTER_DM_CHIME_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
281281
#define MATTER_DM_ECOSYSTEM_INFORMATION_CLUSTER_CLIENT_ENDPOINT_COUNT (0)

scripts/tools/zap/tests/outputs/lighting-app/app-templates/gen_config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
#define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
144144
#define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
145145
#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0)
146-
#define MATTER_DM_WEBRTC_TRANSPORT_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (0)
146+
#define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (0)
147147
#define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
148148
#define MATTER_DM_CHIME_CLUSTER_SERVER_ENDPOINT_COUNT (0)
149149
#define MATTER_DM_ECOSYSTEM_INFORMATION_CLUSTER_SERVER_ENDPOINT_COUNT (0)
@@ -275,7 +275,7 @@
275275
#define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
276276
#define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
277277
#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
278-
#define MATTER_DM_WEBRTC_TRANSPORT_REQUESTOR_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
278+
#define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
279279
#define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
280280
#define MATTER_DM_CHIME_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
281281
#define MATTER_DM_ECOSYSTEM_INFORMATION_CLUSTER_CLIENT_ENDPOINT_COUNT (0)

src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<!--
3-
Copyright (c) 2024 Project CHIP Authors
3+
Copyright (c) 2025 Project CHIP Authors
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -18,42 +18,46 @@ limitations under the License.
1818
XML generated by Alchemy; DO NOT EDIT.
1919
Source: src/app_clusters/WebRTC_Requestor.adoc
2020
Parameters: in-progress
21-
Git: 0.9-fall2024-228-g54b1ae035
21+
Git: 0.7-summer-2025-5-g06c4d5596
2222
-->
23-
<configurator>
24-
<domain name="CHIP"/>
23+
<configurator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../zcl.xsd">
24+
<domain name="Cameras"/>
2525
<cluster apiMaturity="provisional">
2626
<domain>Cameras</domain>
2727
<name>WebRTC Transport Requestor</name>
2828
<code>0x0554</code>
29-
<define>WEBRTC_TRANSPORT_REQUESTOR_CLUSTER</define>
29+
<define>WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER</define>
3030
<description>The WebRTC transport requestor cluster provides a way for stream consumers (e.g. Matter Stream Viewer) to establish a WebRTC connection with a stream provider.</description>
3131
<client init="false" tick="false">true</client>
3232
<server init="false" tick="false">true</server>
3333
<globalAttribute code="0xFFFD" side="either" value="1"/>
3434
<attribute code="0x0000" side="server" define="CURRENT_SESSIONS" type="array" entryType="WebRTCSessionStruct" default="0">CurrentSessions</attribute>
3535
<command code="0x01" source="client" name="Offer" optional="false">
36-
<description>This command provides the stream requestor with WebRTC session details. It is sent following the receipt of a SolicitOffer command or a re-Offer initiated by the Provider.</description>
36+
<description>This command provides the stream requestor with WebRTC session details.</description>
37+
<quality largeMessage="true"/>
3738
<arg id="1" name="WebRTCSessionID" type="int16u"/>
3839
<arg id="2" name="SDP" type="char_string"/>
3940
<arg id="3" name="ICEServers" array="true" type="ICEServerStruct" optional="true"/>
4041
<arg id="4" name="ICETransportPolicy" type="char_string" optional="true"/>
4142
</command>
4243

4344
<command code="0x02" source="client" name="Answer" optional="false">
44-
<description>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.</description>
45+
<description>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.</description>
46+
<quality largeMessage="true"/>
4547
<arg id="1" name="WebRTCSessionID" type="int16u"/>
4648
<arg id="2" name="SDP" type="char_string"/>
4749
</command>
4850

49-
<command code="0x03" source="client" name="ICECandidate" optional="false">
50-
<description>This command provides an ICE candidate to the stream requestor in a WebRTC session.</description>
51+
<command code="0x03" source="client" name="ICECandidates" optional="false">
52+
<description>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.</description>
53+
<quality largeMessage="true"/>
5154
<arg id="1" name="WebRTCSessionID" type="int16u"/>
52-
<arg id="2" name="ICECandidate" type="char_string"/>
55+
<arg id="2" name="ICECandidates" array="true" type="char_string" minLength="1"/>
5356
</command>
5457

5558
<command code="0x04" source="client" name="End" optional="false">
5659
<description>This command notifies the stream requestor that the provider has ended the WebRTC session.</description>
60+
<quality largeMessage="true"/>
5761
<arg id="1" name="WebRTCSessionID" type="int16u"/>
5862
<arg id="2" name="Reason" type="WebRTCEndReasonEnum" min="0x00" max="0x0B"/>
5963
</command>

src/controller/data_model/controller-clusters.matter

+6-6
Original file line numberDiff line numberDiff line change
@@ -10260,22 +10260,22 @@ provisional cluster WebRTCTransportRequestor = 1364 {
1026010260
char_string sdp = 1;
1026110261
}
1026210262

10263-
request struct ICECandidateRequest {
10263+
request struct ICECandidatesRequest {
1026410264
int16u webRTCSessionID = 0;
10265-
char_string ICECandidate = 1;
10265+
char_string ICECandidates[] = 1;
1026610266
}
1026710267

1026810268
request struct EndRequest {
1026910269
int16u webRTCSessionID = 0;
1027010270
WebRTCEndReasonEnum reason = 1;
1027110271
}
1027210272

10273-
/** This command provides the stream requestor with WebRTC session details. It is sent following the receipt of a SolicitOffer command or a re-Offer initiated by the Provider. */
10273+
/** This command provides the stream requestor with WebRTC session details. */
1027410274
command Offer(OfferRequest): DefaultSuccess = 1;
10275-
/** 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. */
10275+
/** 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. */
1027610276
command Answer(AnswerRequest): DefaultSuccess = 2;
10277-
/** This command provides an ICE candidate to the stream requestor in a WebRTC session. */
10278-
command ICECandidate(ICECandidateRequest): DefaultSuccess = 3;
10277+
/** 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. */
10278+
command ICECandidates(ICECandidatesRequest): DefaultSuccess = 3;
1027910279
/** This command notifies the stream requestor that the provider has ended the WebRTC session. */
1028010280
command End(EndRequest): DefaultSuccess = 4;
1028110281
}

src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -63316,21 +63316,21 @@ public void onResponse(StructType invokeStructValue) {
6331663316
}}, commandId, commandArgs, timedInvokeTimeoutMs);
6331763317
}
6331863318

63319-
public void ICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate) {
63320-
ICECandidate(callback, webRTCSessionID, ICECandidate, 0);
63319+
public void ICECandidates(DefaultClusterCallback callback, Integer webRTCSessionID, ArrayList<String> ICECandidates) {
63320+
ICECandidates(callback, webRTCSessionID, ICECandidates, 0);
6332163321
}
6332263322

63323-
public void ICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate, int timedInvokeTimeoutMs) {
63323+
public void ICECandidates(DefaultClusterCallback callback, Integer webRTCSessionID, ArrayList<String> ICECandidates, int timedInvokeTimeoutMs) {
6332463324
final long commandId = 3L;
6332563325

6332663326
ArrayList<StructElement> elements = new ArrayList<>();
6332763327
final long webRTCSessionIDFieldID = 0L;
6332863328
BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID);
6332963329
elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue));
6333063330

63331-
final long ICECandidateFieldID = 1L;
63332-
BaseTLVType ICECandidatetlvValue = new StringType(ICECandidate);
63333-
elements.add(new StructElement(ICECandidateFieldID, ICECandidatetlvValue));
63331+
final long ICECandidatesFieldID = 1L;
63332+
BaseTLVType ICECandidatestlvValue = ArrayType.generateArrayType(ICECandidates, (elementICECandidates) -> new StringType(elementICECandidates));
63333+
elements.add(new StructElement(ICECandidatesFieldID, ICECandidatestlvValue));
6333463334

6333563335
StructType commandArgs = new StructType(elements);
6333663336
invoke(new InvokeCallbackImpl(callback) {

src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -18018,7 +18018,7 @@ public static Event value(long id) throws NoSuchFieldError {
1801818018
public enum Command {
1801918019
Offer(1L),
1802018020
Answer(2L),
18021-
ICECandidate(3L),
18021+
ICECandidates(3L),
1802218022
End(4L),;
1802318023
private final long id;
1802418024
Command(long id) {
@@ -18071,17 +18071,17 @@ public static AnswerCommandField value(int id) throws NoSuchFieldError {
1807118071
}
1807218072
throw new NoSuchFieldError();
1807318073
}
18074-
}public enum ICECandidateCommandField {WebRTCSessionID(0),ICECandidate(1),;
18074+
}public enum ICECandidatesCommandField {WebRTCSessionID(0),ICECandidates(1),;
1807518075
private final int id;
18076-
ICECandidateCommandField(int id) {
18076+
ICECandidatesCommandField(int id) {
1807718077
this.id = id;
1807818078
}
1807918079

1808018080
public int getID() {
1808118081
return id;
1808218082
}
18083-
public static ICECandidateCommandField value(int id) throws NoSuchFieldError {
18084-
for (ICECandidateCommandField field : ICECandidateCommandField.values()) {
18083+
public static ICECandidatesCommandField value(int id) throws NoSuchFieldError {
18084+
for (ICECandidatesCommandField field : ICECandidatesCommandField.values()) {
1808518085
if (field.getID() == id) {
1808618086
return field;
1808718087
}

src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -31266,27 +31266,27 @@ public Map<String, Map<String, InteractionInfo>> getCommandMap() {
3126631266
);
3126731267
webRTCTransportRequestorClusterInteractionInfoMap.put("answer", webRTCTransportRequestoranswerInteractionInfo);
3126831268

31269-
Map<String, CommandParameterInfo> webRTCTransportRequestorICECandidateCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
31269+
Map<String, CommandParameterInfo> webRTCTransportRequestorICECandidatesCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
3127031270

31271-
CommandParameterInfo webRTCTransportRequestorICECandidatewebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class);
31272-
webRTCTransportRequestorICECandidateCommandParams.put("webRTCSessionID",webRTCTransportRequestorICECandidatewebRTCSessionIDCommandParameterInfo);
31271+
CommandParameterInfo webRTCTransportRequestorICECandidateswebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class);
31272+
webRTCTransportRequestorICECandidatesCommandParams.put("webRTCSessionID",webRTCTransportRequestorICECandidateswebRTCSessionIDCommandParameterInfo);
3127331273

31274-
CommandParameterInfo webRTCTransportRequestorICECandidateICECandidateCommandParameterInfo = new CommandParameterInfo("ICECandidate", String.class, String.class);
31275-
webRTCTransportRequestorICECandidateCommandParams.put("ICECandidate",webRTCTransportRequestorICECandidateICECandidateCommandParameterInfo);
31276-
InteractionInfo webRTCTransportRequestorICECandidateInteractionInfo = new InteractionInfo(
31274+
CommandParameterInfo webRTCTransportRequestorICECandidatesICECandidatesCommandParameterInfo = new CommandParameterInfo("ICECandidates", ArrayList.class, ArrayList.class);
31275+
webRTCTransportRequestorICECandidatesCommandParams.put("ICECandidates",webRTCTransportRequestorICECandidatesICECandidatesCommandParameterInfo);
31276+
InteractionInfo webRTCTransportRequestorICECandidatesInteractionInfo = new InteractionInfo(
3127731277
(cluster, callback, commandArguments) -> {
3127831278
((ChipClusters.WebRTCTransportRequestorCluster) cluster)
31279-
.ICECandidate((DefaultClusterCallback) callback
31279+
.ICECandidates((DefaultClusterCallback) callback
3128031280
, (Integer)
3128131281
commandArguments.get("webRTCSessionID")
31282-
, (String)
31283-
commandArguments.get("ICECandidate")
31282+
, (ArrayList<String>)
31283+
commandArguments.get("ICECandidates")
3128431284
);
3128531285
},
3128631286
() -> new DelegatedDefaultClusterCallback(),
31287-
webRTCTransportRequestorICECandidateCommandParams
31287+
webRTCTransportRequestorICECandidatesCommandParams
3128831288
);
31289-
webRTCTransportRequestorClusterInteractionInfoMap.put("ICECandidate", webRTCTransportRequestorICECandidateInteractionInfo);
31289+
webRTCTransportRequestorClusterInteractionInfoMap.put("ICECandidates", webRTCTransportRequestorICECandidatesInteractionInfo);
3129031290

3129131291
Map<String, CommandParameterInfo> webRTCTransportRequestorendCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
3129231292

src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt

+8-4
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ class WebRTCTransportRequestorCluster(
164164
logger.log(Level.FINE, "Invoke command succeeded: ${response}")
165165
}
166166

167-
suspend fun ICECandidate(
167+
suspend fun ICECandidates(
168168
webRTCSessionID: UShort,
169-
ICECandidate: String,
169+
ICECandidates: List<String>,
170170
timedInvokeTimeout: Duration? = null,
171171
) {
172172
val commandId: UInt = 3u
@@ -177,8 +177,12 @@ class WebRTCTransportRequestorCluster(
177177
val TAG_WEB_RTC_SESSION_ID_REQ: Int = 0
178178
tlvWriter.put(ContextSpecificTag(TAG_WEB_RTC_SESSION_ID_REQ), webRTCSessionID)
179179

180-
val TAG_ICE_CANDIDATE_REQ: Int = 1
181-
tlvWriter.put(ContextSpecificTag(TAG_ICE_CANDIDATE_REQ), ICECandidate)
180+
val TAG_ICE_CANDIDATES_REQ: Int = 1
181+
tlvWriter.startArray(ContextSpecificTag(TAG_ICE_CANDIDATES_REQ))
182+
for (item in ICECandidates.iterator()) {
183+
tlvWriter.put(AnonymousTag, item)
184+
}
185+
tlvWriter.endArray()
182186
tlvWriter.endStructure()
183187

184188
val request: InvokeRequest =

src/controller/python/chip/clusters/CHIPClusters.py

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controller/python/chip/clusters/Objects.py

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)