/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::kMinKeyFrameInterval), minKeyFrameInterval); |
155 | 0 | encoder.Encode(to_underlying(Fields::kMaxKeyFrameInterval), maxKeyFrameInterval); |
156 | 0 | encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); |
157 | 0 | encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); |
158 | 0 | return encoder.Finalize(); |
159 | 0 | } |
160 | | |
161 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
162 | 0 | { |
163 | 0 | detail::StructDecodeIterator __iterator(reader); |
164 | 0 | while (true) |
165 | 0 | { |
166 | 0 | uint8_t __context_tag = 0; |
167 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
168 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
169 | 0 | ReturnErrorOnFailure(err); |
170 | | |
171 | 0 | if (__context_tag == to_underlying(Fields::kStreamUsage)) |
172 | 0 | { |
173 | 0 | err = DataModel::Decode(reader, streamUsage); |
174 | 0 | } |
175 | 0 | else if (__context_tag == to_underlying(Fields::kVideoCodec)) |
176 | 0 | { |
177 | 0 | err = DataModel::Decode(reader, videoCodec); |
178 | 0 | } |
179 | 0 | else if (__context_tag == to_underlying(Fields::kMinFrameRate)) |
180 | 0 | { |
181 | 0 | err = DataModel::Decode(reader, minFrameRate); |
182 | 0 | } |
183 | 0 | else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) |
184 | 0 | { |
185 | 0 | err = DataModel::Decode(reader, maxFrameRate); |
186 | 0 | } |
187 | 0 | else if (__context_tag == to_underlying(Fields::kMinResolution)) |
188 | 0 | { |
189 | 0 | err = DataModel::Decode(reader, minResolution); |
190 | 0 | } |
191 | 0 | else if (__context_tag == to_underlying(Fields::kMaxResolution)) |
192 | 0 | { |
193 | 0 | err = DataModel::Decode(reader, maxResolution); |
194 | 0 | } |
195 | 0 | else if (__context_tag == to_underlying(Fields::kMinBitRate)) |
196 | 0 | { |
197 | 0 | err = DataModel::Decode(reader, minBitRate); |
198 | 0 | } |
199 | 0 | else if (__context_tag == to_underlying(Fields::kMaxBitRate)) |
200 | 0 | { |
201 | 0 | err = DataModel::Decode(reader, maxBitRate); |
202 | 0 | } |
203 | 0 | else if (__context_tag == to_underlying(Fields::kMinKeyFrameInterval)) |
204 | 0 | { |
205 | 0 | err = DataModel::Decode(reader, minKeyFrameInterval); |
206 | 0 | } |
207 | 0 | else if (__context_tag == to_underlying(Fields::kMaxKeyFrameInterval)) |
208 | 0 | { |
209 | 0 | err = DataModel::Decode(reader, maxKeyFrameInterval); |
210 | 0 | } |
211 | 0 | else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) |
212 | 0 | { |
213 | 0 | err = DataModel::Decode(reader, watermarkEnabled); |
214 | 0 | } |
215 | 0 | else if (__context_tag == to_underlying(Fields::kOSDEnabled)) |
216 | 0 | { |
217 | 0 | err = DataModel::Decode(reader, OSDEnabled); |
218 | 0 | } |
219 | |
|
220 | 0 | ReturnErrorOnFailure(err); |
221 | 0 | } |
222 | 0 | } |
223 | | } // namespace VideoStreamAllocate. |
224 | | namespace VideoStreamAllocateResponse { |
225 | | |
226 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
227 | 0 | { |
228 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
229 | 0 | encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); |
230 | 0 | return encoder.Finalize(); |
231 | 0 | } |
232 | | |
233 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
234 | 0 | { |
235 | 0 | detail::StructDecodeIterator __iterator(reader); |
236 | 0 | while (true) |
237 | 0 | { |
238 | 0 | uint8_t __context_tag = 0; |
239 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
240 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
241 | 0 | ReturnErrorOnFailure(err); |
242 | | |
243 | 0 | if (__context_tag == to_underlying(Fields::kVideoStreamID)) |
244 | 0 | { |
245 | 0 | err = DataModel::Decode(reader, videoStreamID); |
246 | 0 | } |
247 | |
|
248 | 0 | ReturnErrorOnFailure(err); |
249 | 0 | } |
250 | 0 | } |
251 | | } // namespace VideoStreamAllocateResponse. |
252 | | namespace VideoStreamModify { |
253 | | |
254 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
255 | 0 | { |
256 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
257 | 0 | encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); |
258 | 0 | encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); |
259 | 0 | encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); |
260 | 0 | return encoder.Finalize(); |
261 | 0 | } |
262 | | |
263 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
264 | 0 | { |
265 | 0 | detail::StructDecodeIterator __iterator(reader); |
266 | 0 | while (true) |
267 | 0 | { |
268 | 0 | uint8_t __context_tag = 0; |
269 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
270 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
271 | 0 | ReturnErrorOnFailure(err); |
272 | | |
273 | 0 | if (__context_tag == to_underlying(Fields::kVideoStreamID)) |
274 | 0 | { |
275 | 0 | err = DataModel::Decode(reader, videoStreamID); |
276 | 0 | } |
277 | 0 | else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) |
278 | 0 | { |
279 | 0 | err = DataModel::Decode(reader, watermarkEnabled); |
280 | 0 | } |
281 | 0 | else if (__context_tag == to_underlying(Fields::kOSDEnabled)) |
282 | 0 | { |
283 | 0 | err = DataModel::Decode(reader, OSDEnabled); |
284 | 0 | } |
285 | |
|
286 | 0 | ReturnErrorOnFailure(err); |
287 | 0 | } |
288 | 0 | } |
289 | | } // namespace VideoStreamModify. |
290 | | namespace VideoStreamDeallocate { |
291 | | |
292 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
293 | 0 | { |
294 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
295 | 0 | encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); |
296 | 0 | return encoder.Finalize(); |
297 | 0 | } |
298 | | |
299 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
300 | 0 | { |
301 | 0 | detail::StructDecodeIterator __iterator(reader); |
302 | 0 | while (true) |
303 | 0 | { |
304 | 0 | uint8_t __context_tag = 0; |
305 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
306 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
307 | 0 | ReturnErrorOnFailure(err); |
308 | | |
309 | 0 | if (__context_tag == to_underlying(Fields::kVideoStreamID)) |
310 | 0 | { |
311 | 0 | err = DataModel::Decode(reader, videoStreamID); |
312 | 0 | } |
313 | |
|
314 | 0 | ReturnErrorOnFailure(err); |
315 | 0 | } |
316 | 0 | } |
317 | | } // namespace VideoStreamDeallocate. |
318 | | namespace SnapshotStreamAllocate { |
319 | | |
320 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
321 | 0 | { |
322 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
323 | 0 | encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); |
324 | 0 | encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate); |
325 | 0 | encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); |
326 | 0 | encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); |
327 | 0 | encoder.Encode(to_underlying(Fields::kQuality), quality); |
328 | 0 | encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); |
329 | 0 | encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); |
330 | 0 | return encoder.Finalize(); |
331 | 0 | } |
332 | | |
333 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
334 | 0 | { |
335 | 0 | detail::StructDecodeIterator __iterator(reader); |
336 | 0 | while (true) |
337 | 0 | { |
338 | 0 | uint8_t __context_tag = 0; |
339 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
340 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
341 | 0 | ReturnErrorOnFailure(err); |
342 | | |
343 | 0 | if (__context_tag == to_underlying(Fields::kImageCodec)) |
344 | 0 | { |
345 | 0 | err = DataModel::Decode(reader, imageCodec); |
346 | 0 | } |
347 | 0 | else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) |
348 | 0 | { |
349 | 0 | err = DataModel::Decode(reader, maxFrameRate); |
350 | 0 | } |
351 | 0 | else if (__context_tag == to_underlying(Fields::kMinResolution)) |
352 | 0 | { |
353 | 0 | err = DataModel::Decode(reader, minResolution); |
354 | 0 | } |
355 | 0 | else if (__context_tag == to_underlying(Fields::kMaxResolution)) |
356 | 0 | { |
357 | 0 | err = DataModel::Decode(reader, maxResolution); |
358 | 0 | } |
359 | 0 | else if (__context_tag == to_underlying(Fields::kQuality)) |
360 | 0 | { |
361 | 0 | err = DataModel::Decode(reader, quality); |
362 | 0 | } |
363 | 0 | else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) |
364 | 0 | { |
365 | 0 | err = DataModel::Decode(reader, watermarkEnabled); |
366 | 0 | } |
367 | 0 | else if (__context_tag == to_underlying(Fields::kOSDEnabled)) |
368 | 0 | { |
369 | 0 | err = DataModel::Decode(reader, OSDEnabled); |
370 | 0 | } |
371 | |
|
372 | 0 | ReturnErrorOnFailure(err); |
373 | 0 | } |
374 | 0 | } |
375 | | } // namespace SnapshotStreamAllocate. |
376 | | namespace SnapshotStreamAllocateResponse { |
377 | | |
378 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
379 | 0 | { |
380 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
381 | 0 | encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); |
382 | 0 | return encoder.Finalize(); |
383 | 0 | } |
384 | | |
385 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
386 | 0 | { |
387 | 0 | detail::StructDecodeIterator __iterator(reader); |
388 | 0 | while (true) |
389 | 0 | { |
390 | 0 | uint8_t __context_tag = 0; |
391 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
392 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
393 | 0 | ReturnErrorOnFailure(err); |
394 | | |
395 | 0 | if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) |
396 | 0 | { |
397 | 0 | err = DataModel::Decode(reader, snapshotStreamID); |
398 | 0 | } |
399 | |
|
400 | 0 | ReturnErrorOnFailure(err); |
401 | 0 | } |
402 | 0 | } |
403 | | } // namespace SnapshotStreamAllocateResponse. |
404 | | namespace SnapshotStreamModify { |
405 | | |
406 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
407 | 0 | { |
408 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
409 | 0 | encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); |
410 | 0 | encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); |
411 | 0 | encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); |
412 | 0 | return encoder.Finalize(); |
413 | 0 | } |
414 | | |
415 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
416 | 0 | { |
417 | 0 | detail::StructDecodeIterator __iterator(reader); |
418 | 0 | while (true) |
419 | 0 | { |
420 | 0 | uint8_t __context_tag = 0; |
421 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
422 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
423 | 0 | ReturnErrorOnFailure(err); |
424 | | |
425 | 0 | if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) |
426 | 0 | { |
427 | 0 | err = DataModel::Decode(reader, snapshotStreamID); |
428 | 0 | } |
429 | 0 | else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) |
430 | 0 | { |
431 | 0 | err = DataModel::Decode(reader, watermarkEnabled); |
432 | 0 | } |
433 | 0 | else if (__context_tag == to_underlying(Fields::kOSDEnabled)) |
434 | 0 | { |
435 | 0 | err = DataModel::Decode(reader, OSDEnabled); |
436 | 0 | } |
437 | |
|
438 | 0 | ReturnErrorOnFailure(err); |
439 | 0 | } |
440 | 0 | } |
441 | | } // namespace SnapshotStreamModify. |
442 | | namespace SnapshotStreamDeallocate { |
443 | | |
444 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
445 | 0 | { |
446 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
447 | 0 | encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); |
448 | 0 | return encoder.Finalize(); |
449 | 0 | } |
450 | | |
451 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
452 | 0 | { |
453 | 0 | detail::StructDecodeIterator __iterator(reader); |
454 | 0 | while (true) |
455 | 0 | { |
456 | 0 | uint8_t __context_tag = 0; |
457 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
458 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
459 | 0 | ReturnErrorOnFailure(err); |
460 | | |
461 | 0 | if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) |
462 | 0 | { |
463 | 0 | err = DataModel::Decode(reader, snapshotStreamID); |
464 | 0 | } |
465 | |
|
466 | 0 | ReturnErrorOnFailure(err); |
467 | 0 | } |
468 | 0 | } |
469 | | } // namespace SnapshotStreamDeallocate. |
470 | | namespace SetStreamPriorities { |
471 | | |
472 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
473 | 0 | { |
474 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
475 | 0 | encoder.Encode(to_underlying(Fields::kStreamPriorities), streamPriorities); |
476 | 0 | return encoder.Finalize(); |
477 | 0 | } |
478 | | |
479 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
480 | 0 | { |
481 | 0 | detail::StructDecodeIterator __iterator(reader); |
482 | 0 | while (true) |
483 | 0 | { |
484 | 0 | uint8_t __context_tag = 0; |
485 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
486 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
487 | 0 | ReturnErrorOnFailure(err); |
488 | | |
489 | 0 | if (__context_tag == to_underlying(Fields::kStreamPriorities)) |
490 | 0 | { |
491 | 0 | err = DataModel::Decode(reader, streamPriorities); |
492 | 0 | } |
493 | |
|
494 | 0 | ReturnErrorOnFailure(err); |
495 | 0 | } |
496 | 0 | } |
497 | | } // namespace SetStreamPriorities. |
498 | | namespace CaptureSnapshot { |
499 | | |
500 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
501 | 0 | { |
502 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
503 | 0 | encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); |
504 | 0 | encoder.Encode(to_underlying(Fields::kRequestedResolution), requestedResolution); |
505 | 0 | return encoder.Finalize(); |
506 | 0 | } |
507 | | |
508 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
509 | 0 | { |
510 | 0 | detail::StructDecodeIterator __iterator(reader); |
511 | 0 | while (true) |
512 | 0 | { |
513 | 0 | uint8_t __context_tag = 0; |
514 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
515 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
516 | 0 | ReturnErrorOnFailure(err); |
517 | | |
518 | 0 | if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) |
519 | 0 | { |
520 | 0 | err = DataModel::Decode(reader, snapshotStreamID); |
521 | 0 | } |
522 | 0 | else if (__context_tag == to_underlying(Fields::kRequestedResolution)) |
523 | 0 | { |
524 | 0 | err = DataModel::Decode(reader, requestedResolution); |
525 | 0 | } |
526 | |
|
527 | 0 | ReturnErrorOnFailure(err); |
528 | 0 | } |
529 | 0 | } |
530 | | } // namespace CaptureSnapshot. |
531 | | namespace CaptureSnapshotResponse { |
532 | | |
533 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
534 | 0 | { |
535 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
536 | 0 | encoder.Encode(to_underlying(Fields::kData), data); |
537 | 0 | encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); |
538 | 0 | encoder.Encode(to_underlying(Fields::kResolution), resolution); |
539 | 0 | return encoder.Finalize(); |
540 | 0 | } |
541 | | |
542 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
543 | 0 | { |
544 | 0 | detail::StructDecodeIterator __iterator(reader); |
545 | 0 | while (true) |
546 | 0 | { |
547 | 0 | uint8_t __context_tag = 0; |
548 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
549 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
550 | 0 | ReturnErrorOnFailure(err); |
551 | | |
552 | 0 | if (__context_tag == to_underlying(Fields::kData)) |
553 | 0 | { |
554 | 0 | err = DataModel::Decode(reader, data); |
555 | 0 | } |
556 | 0 | else if (__context_tag == to_underlying(Fields::kImageCodec)) |
557 | 0 | { |
558 | 0 | err = DataModel::Decode(reader, imageCodec); |
559 | 0 | } |
560 | 0 | else if (__context_tag == to_underlying(Fields::kResolution)) |
561 | 0 | { |
562 | 0 | err = DataModel::Decode(reader, resolution); |
563 | 0 | } |
564 | |
|
565 | 0 | ReturnErrorOnFailure(err); |
566 | 0 | } |
567 | 0 | } |
568 | | } // namespace CaptureSnapshotResponse. |
569 | | } // namespace Commands |
570 | | } // namespace CameraAvStreamManagement |
571 | | } // namespace Clusters |
572 | | } // namespace app |
573 | | } // namespace chip |