@@ -2119,6 +2119,121 @@ cluster UserLabel = 65 {
2119
2119
readonly attribute int16u clusterRevision = 65533;
2120
2120
}
2121
2121
2122
+ /** The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. */
2123
+ provisional cluster WebRTCTransportProvider = 1363 {
2124
+ revision 1;
2125
+
2126
+ enum StreamUsageEnum : enum8 {
2127
+ kInternal = 0;
2128
+ kRecording = 1;
2129
+ kAnalysis = 2;
2130
+ kLiveView = 3;
2131
+ }
2132
+
2133
+ enum WebRTCEndReasonEnum : enum8 {
2134
+ kIceFailed = 0;
2135
+ kIceTimeout = 1;
2136
+ kUserHangup = 2;
2137
+ kUserBusy = 3;
2138
+ kReplaced = 4;
2139
+ kNoUserMedia = 5;
2140
+ kInviteTimeout = 6;
2141
+ kAnsweredElsewhere = 7;
2142
+ kOutOfResources = 8;
2143
+ kMediaTimeout = 9;
2144
+ kLowPower = 10;
2145
+ kUnknownReason = 11;
2146
+ }
2147
+
2148
+ bitmap WebRTCMetadataOptionsBitmap : bitmap8 {
2149
+ kDataTLV = 0x1;
2150
+ }
2151
+
2152
+ struct ICEServerStruct {
2153
+ char_string urls[] = 1;
2154
+ optional char_string username = 2;
2155
+ optional char_string credential = 3;
2156
+ optional int16u caid = 4;
2157
+ }
2158
+
2159
+ fabric_scoped struct WebRTCSessionStruct {
2160
+ int16u id = 1;
2161
+ node_id peerNodeID = 2;
2162
+ StreamUsageEnum streamUsage = 3;
2163
+ nullable int16u videoStreamID = 4;
2164
+ nullable int16u audioStreamID = 5;
2165
+ WebRTCMetadataOptionsBitmap metadataOptions = 6;
2166
+ fabric_idx fabricIndex = 254;
2167
+ }
2168
+
2169
+ readonly attribute access(read: manage) WebRTCSessionStruct currentSessions[] = 0;
2170
+ readonly attribute command_id generatedCommandList[] = 65528;
2171
+ readonly attribute command_id acceptedCommandList[] = 65529;
2172
+ readonly attribute event_id eventList[] = 65530;
2173
+ readonly attribute attrib_id attributeList[] = 65531;
2174
+ readonly attribute bitmap32 featureMap = 65532;
2175
+ readonly attribute int16u clusterRevision = 65533;
2176
+
2177
+ request struct SolicitOfferRequest {
2178
+ StreamUsageEnum streamUsage = 0;
2179
+ optional nullable int16u videoStreamID = 1;
2180
+ optional nullable int16u audioStreamID = 2;
2181
+ optional ICEServerStruct ICEServers[] = 3;
2182
+ optional char_string ICETransportPolicy = 4;
2183
+ optional WebRTCMetadataOptionsBitmap metadataOptions = 5;
2184
+ }
2185
+
2186
+ response struct SolicitOfferResponse = 2 {
2187
+ int16u webRTCSessionID = 0;
2188
+ boolean deferredOffer = 1;
2189
+ optional nullable int16u videoStreamID = 2;
2190
+ optional nullable int16u audioStreamID = 3;
2191
+ }
2192
+
2193
+ request struct ProvideOfferRequest {
2194
+ nullable int16u webRTCSessionID = 0;
2195
+ char_string sdp = 1;
2196
+ StreamUsageEnum streamUsage = 2;
2197
+ optional nullable int16u videoStreamID = 3;
2198
+ optional nullable int16u audioStreamID = 4;
2199
+ optional ICEServerStruct ICEServers[] = 5;
2200
+ optional char_string ICETransportPolicy = 6;
2201
+ optional WebRTCMetadataOptionsBitmap metadataOptions = 7;
2202
+ }
2203
+
2204
+ response struct ProvideOfferResponse = 4 {
2205
+ int16u webRTCSessionID = 0;
2206
+ optional nullable int16u videoStreamID = 1;
2207
+ optional nullable int16u audioStreamID = 2;
2208
+ }
2209
+
2210
+ request struct ProvideAnswerRequest {
2211
+ int16u webRTCSessionID = 0;
2212
+ char_string sdp = 1;
2213
+ }
2214
+
2215
+ request struct ProvideICECandidatesRequest {
2216
+ int16u webRTCSessionID = 0;
2217
+ char_string ICECandidates[] = 1;
2218
+ }
2219
+
2220
+ request struct EndSessionRequest {
2221
+ int16u webRTCSessionID = 0;
2222
+ WebRTCEndReasonEnum reason = 1;
2223
+ }
2224
+
2225
+ /** 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. */
2226
+ fabric command SolicitOffer(SolicitOfferRequest): SolicitOfferResponse = 1;
2227
+ /** This command allows an SDP Offer to be set and start a new session. */
2228
+ fabric command ProvideOffer(ProvideOfferRequest): ProvideOfferResponse = 3;
2229
+ /** This command SHALL be initiated from a Node in response to an Offer that was previously received from a remote peer. */
2230
+ fabric command ProvideAnswer(ProvideAnswerRequest): DefaultSuccess = 5;
2231
+ /** 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. */
2232
+ fabric command ProvideICECandidates(ProvideICECandidatesRequest): DefaultSuccess = 6;
2233
+ /** This command instructs the stream provider to end the WebRTC session. */
2234
+ fabric command EndSession(EndSessionRequest): DefaultSuccess = 7;
2235
+ }
2236
+
2122
2237
/** This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */
2123
2238
provisional cluster Chime = 1366 {
2124
2239
revision 1;
@@ -2581,6 +2696,23 @@ endpoint 1 {
2581
2696
handle command SetDefaultNTP;
2582
2697
}
2583
2698
2699
+ server cluster WebRTCTransportProvider {
2700
+ callback attribute currentSessions;
2701
+ callback attribute generatedCommandList;
2702
+ callback attribute acceptedCommandList;
2703
+ callback attribute attributeList;
2704
+ ram attribute featureMap default = 0;
2705
+ ram attribute clusterRevision default = 1;
2706
+
2707
+ handle command SolicitOffer;
2708
+ handle command SolicitOfferResponse;
2709
+ handle command ProvideOffer;
2710
+ handle command ProvideOfferResponse;
2711
+ handle command ProvideAnswer;
2712
+ handle command ProvideICECandidates;
2713
+ handle command EndSession;
2714
+ }
2715
+
2584
2716
server cluster Chime {
2585
2717
callback attribute installedChimeSounds;
2586
2718
callback attribute selectedChime;
0 commit comments