Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebRTC requestor cluster #35910

Merged
merged 6 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml \
Expand Down
1 change: 1 addition & 0 deletions docs/zap_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Generally regenerate using one of:
| 1295 | 0x50F | ContentControl |
| 1296 | 0x510 | ContentAppObserver |
| 1363 | 0x553 | WebRTCTransportProvider |
| 1364 | 0x554 | WebRTCTransportRequestor |
| 1366 | 0x556 | Chime |
| 1872 | 0x750 | EcosystemInformation |
| 1873 | 0x751 | CommissionerControl |
Expand Down
1 change: 1 addition & 0 deletions scripts/rules.matterlint
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/water-heater-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml";
Expand Down
andyg-apple marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2024 Project CHIP Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
XML generated by Alchemy; DO NOT EDIT.
Source: src/app_clusters/WebRTC_Requestor.adoc
Parameters: in-progress
Git: 0.9-fall2024-228-g54b1ae035
-->
<configurator>
<domain name="CHIP"/>
<cluster>
<domain>Cameras</domain>
<name>WebRTC Transport Requestor</name>
<code>0x0554</code>
<define>WEBRTC_TRANSPORT_REQUESTOR_CLUSTER</define>
<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>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<globalAttribute code="0xFFFD" side="either" value="1"/>
<attribute code="0x0000" side="server" define="CURRENT_SESSIONS" type="array" entryType="WebRTCSessionStruct" default="0">CurrentSessions</attribute>
<command code="0x01" source="client" name="Offer" optional="false">
andyg-apple marked this conversation as resolved.
Show resolved Hide resolved
<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>
<arg id="1" name="WebRTCSessionID" type="int16u"/>
<arg id="2" name="SDP" type="char_string"/>
<arg id="3" name="ICEServers" array="true" type="ICEServerStruct" optional="true"/>
<arg id="4" name="ICETransportPolicy" type="char_string" optional="true"/>
</command>

<command code="0x02" source="client" name="Answer" optional="false">
<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>
<arg id="1" name="WebRTCSessionID" type="int16u"/>
<arg id="2" name="SDP" type="char_string"/>
</command>

<command code="0x03" source="client" name="ICECandidate" optional="false">
<description>This command provides an ICE candidate to the stream requestor in a WebRTC session.</description>
<arg id="1" name="WebRTCSessionID" type="int16u"/>
<arg id="2" name="ICECandidate" type="char_string"/>
</command>

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

</cluster>
</configurator>
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"water-heater-management-cluster.xml",
"water-heater-mode-cluster.xml",
"webrtc-provider-cluster.xml",
"webrtc-requestor-cluster.xml",
"wifi-network-diagnostics-cluster.xml",
"wifi-network-management-cluster.xml",
"window-covering.xml",
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"water-heater-management-cluster.xml",
"water-heater-mode-cluster.xml",
"webrtc-provider-cluster.xml",
"webrtc-requestor-cluster.xml",
"wifi-network-diagnostics-cluster.xml",
"wifi-network-management-cluster.xml",
"window-covering.xml",
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap_cluster_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"WATER_HEATER_MANAGEMENT_CLUSTER": [],
"WATER_HEATER_MODE_CLUSTER": [],
"WEB_RTC_PROVIDER_CLUSTER": [],
"WEBRTC_REQUESTOR_CLUSTER": [],
"WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [],
"WINDOW_COVERING_CLUSTER": []
},
Expand Down Expand Up @@ -312,6 +313,7 @@
"LAUNDRY_WASHER_CONTROLS_CLUSTER": ["laundry-washer-controls-server"],
"LAUNDRY_DRYER_CONTROLS_CLUSTER": ["laundry-dryer-controls-server"],
"WEB_RTC_PROVIDER_CLUSTER": [],
"WEBRTC_REQUESTOR_CLUSTER": [],
"WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"],
"WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"],
"WINDOW_COVERING_CLUSTER": ["window-covering-server"],
Expand Down
87 changes: 87 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -9531,6 +9531,93 @@ provisional cluster WebRTCTransportProvider = 1363 {
command EndSession(EndSessionRequest): DefaultSuccess = 7;
}

/** 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. */
cluster WebRTCTransportRequestor = 1364 {
revision 1;

enum StreamTypeEnum : enum8 {
kInternal = 0;
kRecording = 1;
kAnalysis = 2;
kLiveView = 3;
}

enum WebRTCEndReasonEnum : enum8 {
kIceFailed = 0;
kIceTimeout = 1;
kUserHangup = 2;
kUserBusy = 3;
kReplaced = 4;
kNoUserMedia = 5;
kInviteTimeout = 6;
kAnsweredElsewhere = 7;
kOutOfResources = 8;
kMediaTimeout = 9;
kLowPower = 10;
kUnknownReason = 11;
}

bitmap WebRTCMetadataOptions : bitmap8 {
kDataTLV = 0x1;
}

struct ICEServerStruct {
char_string urls[] = 1;
optional char_string username = 2;
optional char_string credential = 3;
optional int16u caid = 4;
}

struct WebRTCSessionStruct {
int16u id = 1;
node_id peerNodeID = 2;
fabric_idx peerFabricIndex = 3;
StreamTypeEnum streamType = 4;
nullable int16u videoStreamID = 5;
nullable int16u audioStreamID = 6;
WebRTCMetadataOptions metadataOptions = 7;
}

readonly attribute WebRTCSessionStruct currentSessions[] = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct OfferRequest {
int16u webRTCSessionID = 0;
char_string sdp = 1;
optional ICEServerStruct ICEServers[] = 2;
optional char_string ICETransportPolicy = 3;
}

request struct AnswerRequest {
int16u webRTCSessionID = 0;
char_string sdp = 1;
}

request struct ICECandidateRequest {
int16u webRTCSessionID = 0;
char_string ICECandidate = 1;
}

request struct EndRequest {
int16u webRTCSessionID = 0;
WebRTCEndReasonEnum reason = 1;
}

/** 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. */
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 notifies the stream requestor that the provider has ended the WebRTC session. */
command End(EndRequest): DefaultSuccess = 4;
}

/** This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */
provisional cluster Chime = 1366 {
revision 1;
Expand Down
Loading
Loading