/src/connectedhomeip/zzz_generated/app-common/clusters/CameraAvStreamManagement/Commands.ipp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * |
3 | | * Copyright (c) 2022 Project CHIP Authors |
4 | | * |
5 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | | * you may not use this file except in compliance with the License. |
7 | | * You may obtain a copy of the License at |
8 | | * |
9 | | * http://www.apache.org/licenses/LICENSE-2.0 |
10 | | * |
11 | | * Unless required by applicable law or agreed to in writing, software |
12 | | * distributed under the License is distributed on an "AS IS" BASIS, |
13 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 | | * See the License for the specific language governing permissions and |
15 | | * limitations under the License. |
16 | | */ |
17 | | |
18 | | // THIS FILE IS GENERATED BY ZAP |
19 | | // This file is generated from clusters-Commands.ipp.zapt |
20 | | |
21 | | #include <clusters/CameraAvStreamManagement/Commands.h> |
22 | | |
23 | | #include <app/data-model/Decode.h> |
24 | | #include <app/data-model/StructDecodeIterator.h> |
25 | | #include <app/data-model/WrappedStructEncoder.h> |
26 | | |
27 | | namespace chip { |
28 | | namespace app { |
29 | | namespace Clusters { |
30 | | namespace CameraAvStreamManagement { |
31 | | namespace Commands { |
32 | | namespace AudioStreamAllocate { |
33 | | |
34 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
35 | 0 | { |
36 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
37 | 0 | encoder.Encode(to_underlying(Fields::kStreamUsage), streamUsage); |
38 | 0 | encoder.Encode(to_underlying(Fields::kAudioCodec), audioCodec); |
39 | 0 | encoder.Encode(to_underlying(Fields::kChannelCount), channelCount); |
40 | 0 | encoder.Encode(to_underlying(Fields::kSampleRate), sampleRate); |
41 | 0 | encoder.Encode(to_underlying(Fields::kBitRate), bitRate); |
42 | 0 | encoder.Encode(to_underlying(Fields::kBitDepth), bitDepth); |
43 | 0 | return encoder.Finalize(); |
44 | 0 | } |
45 | | |
46 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
47 | 0 | { |
48 | 0 | detail::StructDecodeIterator __iterator(reader); |
49 | 0 | while (true) |
50 | 0 | { |
51 | 0 | uint8_t __context_tag = 0; |
52 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
53 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
54 | 0 | ReturnErrorOnFailure(err); |
55 | | |
56 | 0 | if (__context_tag == to_underlying(Fields::kStreamUsage)) |
57 | 0 | { |
58 | 0 | err = DataModel::Decode(reader, streamUsage); |
59 | 0 | } |
60 | 0 | else if (__context_tag == to_underlying(Fields::kAudioCodec)) |
61 | 0 | { |
62 | 0 | err = DataModel::Decode(reader, audioCodec); |
63 | 0 | } |
64 | 0 | else if (__context_tag == to_underlying(Fields::kChannelCount)) |
65 | 0 | { |
66 | 0 | err = DataModel::Decode(reader, channelCount); |
67 | 0 | } |
68 | 0 | else if (__context_tag == to_underlying(Fields::kSampleRate)) |
69 | 0 | { |
70 | 0 | err = DataModel::Decode(reader, sampleRate); |
71 | 0 | } |
72 | 0 | else if (__context_tag == to_underlying(Fields::kBitRate)) |
73 | 0 | { |
74 | 0 | err = DataModel::Decode(reader, bitRate); |
75 | 0 | } |
76 | 0 | else if (__context_tag == to_underlying(Fields::kBitDepth)) |
77 | 0 | { |
78 | 0 | err = DataModel::Decode(reader, bitDepth); |
79 | 0 | } |
80 | |
|
81 | 0 | ReturnErrorOnFailure(err); |
82 | 0 | } |
83 | 0 | } |
84 | | } // namespace AudioStreamAllocate. |
85 | | namespace AudioStreamAllocateResponse { |
86 | | |
87 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
88 | 0 | { |
89 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
90 | 0 | encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID); |
91 | 0 | return encoder.Finalize(); |
92 | 0 | } |
93 | | |
94 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
95 | 0 | { |
96 | 0 | detail::StructDecodeIterator __iterator(reader); |
97 | 0 | while (true) |
98 | 0 | { |
99 | 0 | uint8_t __context_tag = 0; |
100 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
101 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
102 | 0 | ReturnErrorOnFailure(err); |
103 | | |
104 | 0 | if (__context_tag == to_underlying(Fields::kAudioStreamID)) |
105 | 0 | { |
106 | 0 | err = DataModel::Decode(reader, audioStreamID); |
107 | 0 | } |
108 | |
|
109 | 0 | ReturnErrorOnFailure(err); |
110 | 0 | } |
111 | 0 | } |
112 | | } // namespace AudioStreamAllocateResponse. |
113 | | namespace AudioStreamDeallocate { |
114 | | |
115 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
116 | 0 | { |
117 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
118 | 0 | encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID); |
119 | 0 | return encoder.Finalize(); |
120 | 0 | } |
121 | | |
122 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
123 | 0 | { |
124 | 0 | detail::StructDecodeIterator __iterator(reader); |
125 | 0 | while (true) |
126 | 0 | { |
127 | 0 | uint8_t __context_tag = 0; |
128 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
129 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
130 | 0 | ReturnErrorOnFailure(err); |
131 | | |
132 | 0 | if (__context_tag == to_underlying(Fields::kAudioStreamID)) |
133 | 0 | { |
134 | 0 | err = DataModel::Decode(reader, audioStreamID); |
135 | 0 | } |
136 | |
|
137 | 0 | ReturnErrorOnFailure(err); |
138 | 0 | } |
139 | 0 | } |
140 | | } // namespace AudioStreamDeallocate. |
141 | | namespace VideoStreamAllocate { |
142 | | |
143 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
144 | 0 | { |
145 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
146 | 0 | encoder.Encode(to_underlying(Fields::kStreamUsage), streamUsage); |
147 | 0 | encoder.Encode(to_underlying(Fields::kVideoCodec), videoCodec); |
148 | 0 | encoder.Encode(to_underlying(Fields::kMinFrameRate), minFrameRate); |
149 | 0 | encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate); |
150 | 0 | encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); |
151 | 0 | encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); |
152 | 0 | encoder.Encode(to_underlying(Fields::kMinBitRate), minBitRate); |
153 | 0 | encoder.Encode(to_underlying(Fields::kMaxBitRate), maxBitRate); |
154 | 0 | encoder.Encode(to_underlying(Fields::kKeyFrameInterval), keyFrameInterval); |
155 | 0 | encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); |
156 | 0 | encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); |
157 | 0 | return encoder.Finalize(); |
158 | 0 | } |
159 | | |
160 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
161 | 0 | { |
162 | 0 | detail::StructDecodeIterator __iterator(reader); |
163 | 0 | while (true) |
164 | 0 | { |
165 | 0 | uint8_t __context_tag = 0; |
166 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
167 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
168 | 0 | ReturnErrorOnFailure(err); |
169 | | |
170 | 0 | if (__context_tag == to_underlying(Fields::kStreamUsage)) |
171 | 0 | { |
172 | 0 | err = DataModel::Decode(reader, streamUsage); |
173 | 0 | } |
174 | 0 | else if (__context_tag == to_underlying(Fields::kVideoCodec)) |
175 | 0 | { |
176 | 0 | err = DataModel::Decode(reader, videoCodec); |
177 | 0 | } |
178 | 0 | else if (__context_tag == to_underlying(Fields::kMinFrameRate)) |
179 | 0 | { |
180 | 0 | err = DataModel::Decode(reader, minFrameRate); |
181 | 0 | } |
182 | 0 | else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) |
183 | 0 | { |
184 | 0 | err = DataModel::Decode(reader, maxFrameRate); |
185 | 0 | } |
186 | 0 | else if (__context_tag == to_underlying(Fields::kMinResolution)) |
187 | 0 | { |
188 | 0 | err = DataModel::Decode(reader, minResolution); |
189 | 0 | } |
190 | 0 | else if (__context_tag == to_underlying(Fields::kMaxResolution)) |
191 | 0 | { |
192 | 0 | err = DataModel::Decode(reader, maxResolution); |
193 | 0 | } |
194 | 0 | else if (__context_tag == to_underlying(Fields::kMinBitRate)) |
195 | 0 | { |
196 | 0 | err = DataModel::Decode(reader, minBitRate); |
197 | 0 | } |
198 | 0 | else if (__context_tag == to_underlying(Fields::kMaxBitRate)) |
199 | 0 | { |
200 | 0 | err = DataModel::Decode(reader, maxBitRate); |
201 | 0 | } |
202 | 0 | else if (__context_tag == to_underlying(Fields::kKeyFrameInterval)) |
203 | 0 | { |
204 | 0 | err = DataModel::Decode(reader, keyFrameInterval); |
205 | 0 | } |
206 | 0 | else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) |
207 | 0 | { |
208 | 0 | err = DataModel::Decode(reader, watermarkEnabled); |
209 | 0 | } |
210 | 0 | else if (__context_tag == to_underlying(Fields::kOSDEnabled)) |
211 | 0 | { |
212 | 0 | err = DataModel::Decode(reader, OSDEnabled); |
213 | 0 | } |
214 | |
|
215 | 0 | ReturnErrorOnFailure(err); |
216 | 0 | } |
217 | 0 | } |
218 | | } // namespace VideoStreamAllocate. |
219 | | namespace VideoStreamAllocateResponse { |
220 | | |
221 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
222 | 0 | { |
223 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
224 | 0 | encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); |
225 | 0 | return encoder.Finalize(); |
226 | 0 | } |
227 | | |
228 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
229 | 0 | { |
230 | 0 | detail::StructDecodeIterator __iterator(reader); |
231 | 0 | while (true) |
232 | 0 | { |
233 | 0 | uint8_t __context_tag = 0; |
234 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
235 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
236 | 0 | ReturnErrorOnFailure(err); |
237 | | |
238 | 0 | if (__context_tag == to_underlying(Fields::kVideoStreamID)) |
239 | 0 | { |
240 | 0 | err = DataModel::Decode(reader, videoStreamID); |
241 | 0 | } |
242 | |
|
243 | 0 | ReturnErrorOnFailure(err); |
244 | 0 | } |
245 | 0 | } |
246 | | } // namespace VideoStreamAllocateResponse. |
247 | | namespace VideoStreamModify { |
248 | | |
249 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
250 | 0 | { |
251 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
252 | 0 | encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); |
253 | 0 | encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); |
254 | 0 | encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); |
255 | 0 | return encoder.Finalize(); |
256 | 0 | } |
257 | | |
258 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
259 | 0 | { |
260 | 0 | detail::StructDecodeIterator __iterator(reader); |
261 | 0 | while (true) |
262 | 0 | { |
263 | 0 | uint8_t __context_tag = 0; |
264 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
265 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
266 | 0 | ReturnErrorOnFailure(err); |
267 | | |
268 | 0 | if (__context_tag == to_underlying(Fields::kVideoStreamID)) |
269 | 0 | { |
270 | 0 | err = DataModel::Decode(reader, videoStreamID); |
271 | 0 | } |
272 | 0 | else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) |
273 | 0 | { |
274 | 0 | err = DataModel::Decode(reader, watermarkEnabled); |
275 | 0 | } |
276 | 0 | else if (__context_tag == to_underlying(Fields::kOSDEnabled)) |
277 | 0 | { |
278 | 0 | err = DataModel::Decode(reader, OSDEnabled); |
279 | 0 | } |
280 | |
|
281 | 0 | ReturnErrorOnFailure(err); |
282 | 0 | } |
283 | 0 | } |
284 | | } // namespace VideoStreamModify. |
285 | | namespace VideoStreamDeallocate { |
286 | | |
287 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
288 | 0 | { |
289 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
290 | 0 | encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); |
291 | 0 | return encoder.Finalize(); |
292 | 0 | } |
293 | | |
294 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
295 | 0 | { |
296 | 0 | detail::StructDecodeIterator __iterator(reader); |
297 | 0 | while (true) |
298 | 0 | { |
299 | 0 | uint8_t __context_tag = 0; |
300 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
301 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
302 | 0 | ReturnErrorOnFailure(err); |
303 | | |
304 | 0 | if (__context_tag == to_underlying(Fields::kVideoStreamID)) |
305 | 0 | { |
306 | 0 | err = DataModel::Decode(reader, videoStreamID); |
307 | 0 | } |
308 | |
|
309 | 0 | ReturnErrorOnFailure(err); |
310 | 0 | } |
311 | 0 | } |
312 | | } // namespace VideoStreamDeallocate. |
313 | | namespace SnapshotStreamAllocate { |
314 | | |
315 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
316 | 0 | { |
317 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
318 | 0 | encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); |
319 | 0 | encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate); |
320 | 0 | encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); |
321 | 0 | encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); |
322 | 0 | encoder.Encode(to_underlying(Fields::kQuality), quality); |
323 | 0 | encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); |
324 | 0 | encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); |
325 | 0 | return encoder.Finalize(); |
326 | 0 | } |
327 | | |
328 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
329 | 0 | { |
330 | 0 | detail::StructDecodeIterator __iterator(reader); |
331 | 0 | while (true) |
332 | 0 | { |
333 | 0 | uint8_t __context_tag = 0; |
334 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
335 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
336 | 0 | ReturnErrorOnFailure(err); |
337 | | |
338 | 0 | if (__context_tag == to_underlying(Fields::kImageCodec)) |
339 | 0 | { |
340 | 0 | err = DataModel::Decode(reader, imageCodec); |
341 | 0 | } |
342 | 0 | else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) |
343 | 0 | { |
344 | 0 | err = DataModel::Decode(reader, maxFrameRate); |
345 | 0 | } |
346 | 0 | else if (__context_tag == to_underlying(Fields::kMinResolution)) |
347 | 0 | { |
348 | 0 | err = DataModel::Decode(reader, minResolution); |
349 | 0 | } |
350 | 0 | else if (__context_tag == to_underlying(Fields::kMaxResolution)) |
351 | 0 | { |
352 | 0 | err = DataModel::Decode(reader, maxResolution); |
353 | 0 | } |
354 | 0 | else if (__context_tag == to_underlying(Fields::kQuality)) |
355 | 0 | { |
356 | 0 | err = DataModel::Decode(reader, quality); |
357 | 0 | } |
358 | 0 | else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) |
359 | 0 | { |
360 | 0 | err = DataModel::Decode(reader, watermarkEnabled); |
361 | 0 | } |
362 | 0 | else if (__context_tag == to_underlying(Fields::kOSDEnabled)) |
363 | 0 | { |
364 | 0 | err = DataModel::Decode(reader, OSDEnabled); |
365 | 0 | } |
366 | |
|
367 | 0 | ReturnErrorOnFailure(err); |
368 | 0 | } |
369 | 0 | } |
370 | | } // namespace SnapshotStreamAllocate. |
371 | | namespace SnapshotStreamAllocateResponse { |
372 | | |
373 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
374 | 0 | { |
375 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
376 | 0 | encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); |
377 | 0 | return encoder.Finalize(); |
378 | 0 | } |
379 | | |
380 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
381 | 0 | { |
382 | 0 | detail::StructDecodeIterator __iterator(reader); |
383 | 0 | while (true) |
384 | 0 | { |
385 | 0 | uint8_t __context_tag = 0; |
386 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
387 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
388 | 0 | ReturnErrorOnFailure(err); |
389 | | |
390 | 0 | if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) |
391 | 0 | { |
392 | 0 | err = DataModel::Decode(reader, snapshotStreamID); |
393 | 0 | } |
394 | |
|
395 | 0 | ReturnErrorOnFailure(err); |
396 | 0 | } |
397 | 0 | } |
398 | | } // namespace SnapshotStreamAllocateResponse. |
399 | | namespace SnapshotStreamModify { |
400 | | |
401 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
402 | 0 | { |
403 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
404 | 0 | encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); |
405 | 0 | encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); |
406 | 0 | encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); |
407 | 0 | return encoder.Finalize(); |
408 | 0 | } |
409 | | |
410 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
411 | 0 | { |
412 | 0 | detail::StructDecodeIterator __iterator(reader); |
413 | 0 | while (true) |
414 | 0 | { |
415 | 0 | uint8_t __context_tag = 0; |
416 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
417 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
418 | 0 | ReturnErrorOnFailure(err); |
419 | | |
420 | 0 | if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) |
421 | 0 | { |
422 | 0 | err = DataModel::Decode(reader, snapshotStreamID); |
423 | 0 | } |
424 | 0 | else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) |
425 | 0 | { |
426 | 0 | err = DataModel::Decode(reader, watermarkEnabled); |
427 | 0 | } |
428 | 0 | else if (__context_tag == to_underlying(Fields::kOSDEnabled)) |
429 | 0 | { |
430 | 0 | err = DataModel::Decode(reader, OSDEnabled); |
431 | 0 | } |
432 | |
|
433 | 0 | ReturnErrorOnFailure(err); |
434 | 0 | } |
435 | 0 | } |
436 | | } // namespace SnapshotStreamModify. |
437 | | namespace SnapshotStreamDeallocate { |
438 | | |
439 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
440 | 0 | { |
441 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
442 | 0 | encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); |
443 | 0 | return encoder.Finalize(); |
444 | 0 | } |
445 | | |
446 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
447 | 0 | { |
448 | 0 | detail::StructDecodeIterator __iterator(reader); |
449 | 0 | while (true) |
450 | 0 | { |
451 | 0 | uint8_t __context_tag = 0; |
452 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
453 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
454 | 0 | ReturnErrorOnFailure(err); |
455 | | |
456 | 0 | if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) |
457 | 0 | { |
458 | 0 | err = DataModel::Decode(reader, snapshotStreamID); |
459 | 0 | } |
460 | |
|
461 | 0 | ReturnErrorOnFailure(err); |
462 | 0 | } |
463 | 0 | } |
464 | | } // namespace SnapshotStreamDeallocate. |
465 | | namespace SetStreamPriorities { |
466 | | |
467 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
468 | 0 | { |
469 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
470 | 0 | encoder.Encode(to_underlying(Fields::kStreamPriorities), streamPriorities); |
471 | 0 | return encoder.Finalize(); |
472 | 0 | } |
473 | | |
474 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
475 | 0 | { |
476 | 0 | detail::StructDecodeIterator __iterator(reader); |
477 | 0 | while (true) |
478 | 0 | { |
479 | 0 | uint8_t __context_tag = 0; |
480 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
481 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
482 | 0 | ReturnErrorOnFailure(err); |
483 | | |
484 | 0 | if (__context_tag == to_underlying(Fields::kStreamPriorities)) |
485 | 0 | { |
486 | 0 | err = DataModel::Decode(reader, streamPriorities); |
487 | 0 | } |
488 | |
|
489 | 0 | ReturnErrorOnFailure(err); |
490 | 0 | } |
491 | 0 | } |
492 | | } // namespace SetStreamPriorities. |
493 | | namespace CaptureSnapshot { |
494 | | |
495 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
496 | 0 | { |
497 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
498 | 0 | encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); |
499 | 0 | encoder.Encode(to_underlying(Fields::kRequestedResolution), requestedResolution); |
500 | 0 | return encoder.Finalize(); |
501 | 0 | } |
502 | | |
503 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
504 | 0 | { |
505 | 0 | detail::StructDecodeIterator __iterator(reader); |
506 | 0 | while (true) |
507 | 0 | { |
508 | 0 | uint8_t __context_tag = 0; |
509 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
510 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
511 | 0 | ReturnErrorOnFailure(err); |
512 | | |
513 | 0 | if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) |
514 | 0 | { |
515 | 0 | err = DataModel::Decode(reader, snapshotStreamID); |
516 | 0 | } |
517 | 0 | else if (__context_tag == to_underlying(Fields::kRequestedResolution)) |
518 | 0 | { |
519 | 0 | err = DataModel::Decode(reader, requestedResolution); |
520 | 0 | } |
521 | |
|
522 | 0 | ReturnErrorOnFailure(err); |
523 | 0 | } |
524 | 0 | } |
525 | | } // namespace CaptureSnapshot. |
526 | | namespace CaptureSnapshotResponse { |
527 | | |
528 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
529 | 0 | { |
530 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
531 | 0 | encoder.Encode(to_underlying(Fields::kData), data); |
532 | 0 | encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); |
533 | 0 | encoder.Encode(to_underlying(Fields::kResolution), resolution); |
534 | 0 | return encoder.Finalize(); |
535 | 0 | } |
536 | | |
537 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
538 | 0 | { |
539 | 0 | detail::StructDecodeIterator __iterator(reader); |
540 | 0 | while (true) |
541 | 0 | { |
542 | 0 | uint8_t __context_tag = 0; |
543 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
544 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
545 | 0 | ReturnErrorOnFailure(err); |
546 | | |
547 | 0 | if (__context_tag == to_underlying(Fields::kData)) |
548 | 0 | { |
549 | 0 | err = DataModel::Decode(reader, data); |
550 | 0 | } |
551 | 0 | else if (__context_tag == to_underlying(Fields::kImageCodec)) |
552 | 0 | { |
553 | 0 | err = DataModel::Decode(reader, imageCodec); |
554 | 0 | } |
555 | 0 | else if (__context_tag == to_underlying(Fields::kResolution)) |
556 | 0 | { |
557 | 0 | err = DataModel::Decode(reader, resolution); |
558 | 0 | } |
559 | |
|
560 | 0 | ReturnErrorOnFailure(err); |
561 | 0 | } |
562 | 0 | } |
563 | | } // namespace CaptureSnapshotResponse. |
564 | | } // namespace Commands |
565 | | } // namespace CameraAvStreamManagement |
566 | | } // namespace Clusters |
567 | | } // namespace app |
568 | | } // namespace chip |