/src/connectedhomeip/zzz_generated/app-common/clusters/ContentLauncher/Structs.ipp
Line | Count | Source |
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-Structs.ipp.zapt |
20 | | |
21 | | #include <clusters/ContentLauncher/Structs.h> |
22 | | |
23 | | #include <app/data-model/StructDecodeIterator.h> |
24 | | #include <app/data-model/WrappedStructEncoder.h> |
25 | | |
26 | | namespace chip { |
27 | | namespace app { |
28 | | namespace Clusters { |
29 | | namespace ContentLauncher { |
30 | | namespace Structs { |
31 | | |
32 | | namespace DimensionStruct { |
33 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
34 | 0 | { |
35 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
36 | 0 | encoder.Encode(to_underlying(Fields::kWidth), width); |
37 | 0 | encoder.Encode(to_underlying(Fields::kHeight), height); |
38 | 0 | encoder.Encode(to_underlying(Fields::kMetric), metric); |
39 | 0 | return encoder.Finalize(); |
40 | 0 | } |
41 | | |
42 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
43 | 0 | { |
44 | 0 | detail::StructDecodeIterator __iterator(reader); |
45 | 0 | while (true) |
46 | 0 | { |
47 | 0 | uint8_t __context_tag = 0; |
48 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
49 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
50 | 0 | ReturnErrorOnFailure(err); |
51 | | |
52 | 0 | if (__context_tag == to_underlying(Fields::kWidth)) |
53 | 0 | { |
54 | 0 | err = DataModel::Decode(reader, width); |
55 | 0 | } |
56 | 0 | else if (__context_tag == to_underlying(Fields::kHeight)) |
57 | 0 | { |
58 | 0 | err = DataModel::Decode(reader, height); |
59 | 0 | } |
60 | 0 | else if (__context_tag == to_underlying(Fields::kMetric)) |
61 | 0 | { |
62 | 0 | err = DataModel::Decode(reader, metric); |
63 | 0 | } |
64 | |
|
65 | 0 | ReturnErrorOnFailure(err); |
66 | 0 | } |
67 | 0 | } |
68 | | |
69 | | } // namespace DimensionStruct |
70 | | |
71 | | namespace ContentAppInfo { |
72 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
73 | 0 | { |
74 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
75 | 0 | encoder.Encode(to_underlying(Fields::kContentAppVendorID), contentAppVendorID); |
76 | 0 | encoder.Encode(to_underlying(Fields::kContentAppProductID), contentAppProductID); |
77 | 0 | encoder.Encode(to_underlying(Fields::kData), data); |
78 | 0 | return encoder.Finalize(); |
79 | 0 | } |
80 | | |
81 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
82 | 0 | { |
83 | 0 | detail::StructDecodeIterator __iterator(reader); |
84 | 0 | while (true) |
85 | 0 | { |
86 | 0 | uint8_t __context_tag = 0; |
87 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
88 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
89 | 0 | ReturnErrorOnFailure(err); |
90 | | |
91 | 0 | if (__context_tag == to_underlying(Fields::kContentAppVendorID)) |
92 | 0 | { |
93 | 0 | err = DataModel::Decode(reader, contentAppVendorID); |
94 | 0 | } |
95 | 0 | else if (__context_tag == to_underlying(Fields::kContentAppProductID)) |
96 | 0 | { |
97 | 0 | err = DataModel::Decode(reader, contentAppProductID); |
98 | 0 | } |
99 | 0 | else if (__context_tag == to_underlying(Fields::kData)) |
100 | 0 | { |
101 | 0 | err = DataModel::Decode(reader, data); |
102 | 0 | } |
103 | |
|
104 | 0 | ReturnErrorOnFailure(err); |
105 | 0 | } |
106 | 0 | } |
107 | | |
108 | | } // namespace ContentAppInfo |
109 | | |
110 | | namespace LaunchUrlInfo { |
111 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
112 | 0 | { |
113 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
114 | 0 | encoder.Encode(to_underlying(Fields::kUrl), url); |
115 | 0 | encoder.Encode(to_underlying(Fields::kData), data); |
116 | 0 | encoder.Encode(to_underlying(Fields::kContentType), contentType); |
117 | 0 | encoder.Encode(to_underlying(Fields::kContentHeaders), contentHeaders); |
118 | 0 | encoder.Encode(to_underlying(Fields::kOffsetMillisecs), offsetMillisecs); |
119 | 0 | encoder.Encode(to_underlying(Fields::kQueueType), queueType); |
120 | 0 | encoder.Encode(to_underlying(Fields::kNextUrl), nextUrl); |
121 | 0 | return encoder.Finalize(); |
122 | 0 | } |
123 | | |
124 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
125 | 0 | { |
126 | 0 | detail::StructDecodeIterator __iterator(reader); |
127 | 0 | while (true) |
128 | 0 | { |
129 | 0 | uint8_t __context_tag = 0; |
130 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
131 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
132 | 0 | ReturnErrorOnFailure(err); |
133 | | |
134 | 0 | if (__context_tag == to_underlying(Fields::kUrl)) |
135 | 0 | { |
136 | 0 | err = DataModel::Decode(reader, url); |
137 | 0 | } |
138 | 0 | else if (__context_tag == to_underlying(Fields::kData)) |
139 | 0 | { |
140 | 0 | err = DataModel::Decode(reader, data); |
141 | 0 | } |
142 | 0 | else if (__context_tag == to_underlying(Fields::kContentType)) |
143 | 0 | { |
144 | 0 | err = DataModel::Decode(reader, contentType); |
145 | 0 | } |
146 | 0 | else if (__context_tag == to_underlying(Fields::kContentHeaders)) |
147 | 0 | { |
148 | 0 | err = DataModel::Decode(reader, contentHeaders); |
149 | 0 | } |
150 | 0 | else if (__context_tag == to_underlying(Fields::kOffsetMillisecs)) |
151 | 0 | { |
152 | 0 | err = DataModel::Decode(reader, offsetMillisecs); |
153 | 0 | } |
154 | 0 | else if (__context_tag == to_underlying(Fields::kQueueType)) |
155 | 0 | { |
156 | 0 | err = DataModel::Decode(reader, queueType); |
157 | 0 | } |
158 | 0 | else if (__context_tag == to_underlying(Fields::kNextUrl)) |
159 | 0 | { |
160 | 0 | err = DataModel::Decode(reader, nextUrl); |
161 | 0 | } |
162 | |
|
163 | 0 | ReturnErrorOnFailure(err); |
164 | 0 | } |
165 | 0 | } |
166 | | |
167 | | } // namespace LaunchUrlInfo |
168 | | |
169 | | namespace ReplicationInfo { |
170 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
171 | 0 | { |
172 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
173 | 0 | encoder.Encode(to_underlying(Fields::kLaunchUrlInfo), launchUrlInfo); |
174 | 0 | encoder.Encode(to_underlying(Fields::kContentAppInfo), contentAppInfo); |
175 | 0 | return encoder.Finalize(); |
176 | 0 | } |
177 | | |
178 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
179 | 0 | { |
180 | 0 | detail::StructDecodeIterator __iterator(reader); |
181 | 0 | while (true) |
182 | 0 | { |
183 | 0 | uint8_t __context_tag = 0; |
184 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
185 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
186 | 0 | ReturnErrorOnFailure(err); |
187 | | |
188 | 0 | if (__context_tag == to_underlying(Fields::kLaunchUrlInfo)) |
189 | 0 | { |
190 | 0 | err = DataModel::Decode(reader, launchUrlInfo); |
191 | 0 | } |
192 | 0 | else if (__context_tag == to_underlying(Fields::kContentAppInfo)) |
193 | 0 | { |
194 | 0 | err = DataModel::Decode(reader, contentAppInfo); |
195 | 0 | } |
196 | |
|
197 | 0 | ReturnErrorOnFailure(err); |
198 | 0 | } |
199 | 0 | } |
200 | | |
201 | | } // namespace ReplicationInfo |
202 | | |
203 | | namespace TrackPreferenceStruct { |
204 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
205 | 0 | { |
206 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
207 | 0 | encoder.Encode(to_underlying(Fields::kLanguageCode), languageCode); |
208 | 0 | encoder.Encode(to_underlying(Fields::kCharacteristics), characteristics); |
209 | 0 | encoder.Encode(to_underlying(Fields::kAudioOutputIndex), audioOutputIndex); |
210 | 0 | return encoder.Finalize(); |
211 | 0 | } |
212 | | |
213 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
214 | 0 | { |
215 | 0 | detail::StructDecodeIterator __iterator(reader); |
216 | 0 | while (true) |
217 | 0 | { |
218 | 0 | uint8_t __context_tag = 0; |
219 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
220 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
221 | 0 | ReturnErrorOnFailure(err); |
222 | | |
223 | 0 | if (__context_tag == to_underlying(Fields::kLanguageCode)) |
224 | 0 | { |
225 | 0 | err = DataModel::Decode(reader, languageCode); |
226 | 0 | } |
227 | 0 | else if (__context_tag == to_underlying(Fields::kCharacteristics)) |
228 | 0 | { |
229 | 0 | err = DataModel::Decode(reader, characteristics); |
230 | 0 | } |
231 | 0 | else if (__context_tag == to_underlying(Fields::kAudioOutputIndex)) |
232 | 0 | { |
233 | 0 | err = DataModel::Decode(reader, audioOutputIndex); |
234 | 0 | } |
235 | |
|
236 | 0 | ReturnErrorOnFailure(err); |
237 | 0 | } |
238 | 0 | } |
239 | | |
240 | | } // namespace TrackPreferenceStruct |
241 | | |
242 | | namespace PlaybackPreferencesStruct { |
243 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
244 | 0 | { |
245 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
246 | 0 | encoder.Encode(to_underlying(Fields::kPlaybackPosition), playbackPosition); |
247 | 0 | encoder.Encode(to_underlying(Fields::kTextTrack), textTrack); |
248 | 0 | encoder.Encode(to_underlying(Fields::kAudioTracks), audioTracks); |
249 | 0 | return encoder.Finalize(); |
250 | 0 | } |
251 | | |
252 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
253 | 0 | { |
254 | 0 | detail::StructDecodeIterator __iterator(reader); |
255 | 0 | while (true) |
256 | 0 | { |
257 | 0 | uint8_t __context_tag = 0; |
258 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
259 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
260 | 0 | ReturnErrorOnFailure(err); |
261 | | |
262 | 0 | if (__context_tag == to_underlying(Fields::kPlaybackPosition)) |
263 | 0 | { |
264 | 0 | err = DataModel::Decode(reader, playbackPosition); |
265 | 0 | } |
266 | 0 | else if (__context_tag == to_underlying(Fields::kTextTrack)) |
267 | 0 | { |
268 | 0 | err = DataModel::Decode(reader, textTrack); |
269 | 0 | } |
270 | 0 | else if (__context_tag == to_underlying(Fields::kAudioTracks)) |
271 | 0 | { |
272 | 0 | err = DataModel::Decode(reader, audioTracks); |
273 | 0 | } |
274 | |
|
275 | 0 | ReturnErrorOnFailure(err); |
276 | 0 | } |
277 | 0 | } |
278 | | |
279 | | } // namespace PlaybackPreferencesStruct |
280 | | |
281 | | namespace AdditionalInfoStruct { |
282 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
283 | 0 | { |
284 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
285 | 0 | encoder.Encode(to_underlying(Fields::kName), name); |
286 | 0 | encoder.Encode(to_underlying(Fields::kValue), value); |
287 | 0 | return encoder.Finalize(); |
288 | 0 | } |
289 | | |
290 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
291 | 0 | { |
292 | 0 | detail::StructDecodeIterator __iterator(reader); |
293 | 0 | while (true) |
294 | 0 | { |
295 | 0 | uint8_t __context_tag = 0; |
296 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
297 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
298 | 0 | ReturnErrorOnFailure(err); |
299 | | |
300 | 0 | if (__context_tag == to_underlying(Fields::kName)) |
301 | 0 | { |
302 | 0 | err = DataModel::Decode(reader, name); |
303 | 0 | } |
304 | 0 | else if (__context_tag == to_underlying(Fields::kValue)) |
305 | 0 | { |
306 | 0 | err = DataModel::Decode(reader, value); |
307 | 0 | } |
308 | |
|
309 | 0 | ReturnErrorOnFailure(err); |
310 | 0 | } |
311 | 0 | } |
312 | | |
313 | | } // namespace AdditionalInfoStruct |
314 | | |
315 | | namespace ParameterStruct { |
316 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
317 | 0 | { |
318 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
319 | 0 | encoder.Encode(to_underlying(Fields::kType), type); |
320 | 0 | encoder.Encode(to_underlying(Fields::kValue), value); |
321 | 0 | encoder.Encode(to_underlying(Fields::kExternalIDList), externalIDList); |
322 | 0 | return encoder.Finalize(); |
323 | 0 | } |
324 | | |
325 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
326 | 0 | { |
327 | 0 | detail::StructDecodeIterator __iterator(reader); |
328 | 0 | while (true) |
329 | 0 | { |
330 | 0 | uint8_t __context_tag = 0; |
331 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
332 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
333 | 0 | ReturnErrorOnFailure(err); |
334 | | |
335 | 0 | if (__context_tag == to_underlying(Fields::kType)) |
336 | 0 | { |
337 | 0 | err = DataModel::Decode(reader, type); |
338 | 0 | } |
339 | 0 | else if (__context_tag == to_underlying(Fields::kValue)) |
340 | 0 | { |
341 | 0 | err = DataModel::Decode(reader, value); |
342 | 0 | } |
343 | 0 | else if (__context_tag == to_underlying(Fields::kExternalIDList)) |
344 | 0 | { |
345 | 0 | err = DataModel::Decode(reader, externalIDList); |
346 | 0 | } |
347 | |
|
348 | 0 | ReturnErrorOnFailure(err); |
349 | 0 | } |
350 | 0 | } |
351 | | |
352 | | } // namespace ParameterStruct |
353 | | |
354 | | namespace ContentSearchStruct { |
355 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
356 | 0 | { |
357 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
358 | 0 | encoder.Encode(to_underlying(Fields::kParameterList), parameterList); |
359 | 0 | return encoder.Finalize(); |
360 | 0 | } |
361 | | |
362 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
363 | 0 | { |
364 | 0 | detail::StructDecodeIterator __iterator(reader); |
365 | 0 | while (true) |
366 | 0 | { |
367 | 0 | uint8_t __context_tag = 0; |
368 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
369 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
370 | 0 | ReturnErrorOnFailure(err); |
371 | | |
372 | 0 | if (__context_tag == to_underlying(Fields::kParameterList)) |
373 | 0 | { |
374 | 0 | err = DataModel::Decode(reader, parameterList); |
375 | 0 | } |
376 | |
|
377 | 0 | ReturnErrorOnFailure(err); |
378 | 0 | } |
379 | 0 | } |
380 | | |
381 | | } // namespace ContentSearchStruct |
382 | | |
383 | | namespace StyleInformationStruct { |
384 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
385 | 0 | { |
386 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
387 | 0 | encoder.Encode(to_underlying(Fields::kImageURL), imageURL); |
388 | 0 | encoder.Encode(to_underlying(Fields::kColor), color); |
389 | 0 | encoder.Encode(to_underlying(Fields::kSize), size); |
390 | 0 | return encoder.Finalize(); |
391 | 0 | } |
392 | | |
393 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
394 | 0 | { |
395 | 0 | detail::StructDecodeIterator __iterator(reader); |
396 | 0 | while (true) |
397 | 0 | { |
398 | 0 | uint8_t __context_tag = 0; |
399 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
400 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
401 | 0 | ReturnErrorOnFailure(err); |
402 | | |
403 | 0 | if (__context_tag == to_underlying(Fields::kImageURL)) |
404 | 0 | { |
405 | 0 | err = DataModel::Decode(reader, imageURL); |
406 | 0 | } |
407 | 0 | else if (__context_tag == to_underlying(Fields::kColor)) |
408 | 0 | { |
409 | 0 | err = DataModel::Decode(reader, color); |
410 | 0 | } |
411 | 0 | else if (__context_tag == to_underlying(Fields::kSize)) |
412 | 0 | { |
413 | 0 | err = DataModel::Decode(reader, size); |
414 | 0 | } |
415 | |
|
416 | 0 | ReturnErrorOnFailure(err); |
417 | 0 | } |
418 | 0 | } |
419 | | |
420 | | } // namespace StyleInformationStruct |
421 | | |
422 | | namespace BrandingInformationStruct { |
423 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
424 | 0 | { |
425 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
426 | 0 | encoder.Encode(to_underlying(Fields::kProviderName), providerName); |
427 | 0 | encoder.Encode(to_underlying(Fields::kBackground), background); |
428 | 0 | encoder.Encode(to_underlying(Fields::kLogo), logo); |
429 | 0 | encoder.Encode(to_underlying(Fields::kProgressBar), progressBar); |
430 | 0 | encoder.Encode(to_underlying(Fields::kSplash), splash); |
431 | 0 | encoder.Encode(to_underlying(Fields::kWaterMark), waterMark); |
432 | 0 | return encoder.Finalize(); |
433 | 0 | } |
434 | | |
435 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
436 | 0 | { |
437 | 0 | detail::StructDecodeIterator __iterator(reader); |
438 | 0 | while (true) |
439 | 0 | { |
440 | 0 | uint8_t __context_tag = 0; |
441 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
442 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
443 | 0 | ReturnErrorOnFailure(err); |
444 | | |
445 | 0 | if (__context_tag == to_underlying(Fields::kProviderName)) |
446 | 0 | { |
447 | 0 | err = DataModel::Decode(reader, providerName); |
448 | 0 | } |
449 | 0 | else if (__context_tag == to_underlying(Fields::kBackground)) |
450 | 0 | { |
451 | 0 | err = DataModel::Decode(reader, background); |
452 | 0 | } |
453 | 0 | else if (__context_tag == to_underlying(Fields::kLogo)) |
454 | 0 | { |
455 | 0 | err = DataModel::Decode(reader, logo); |
456 | 0 | } |
457 | 0 | else if (__context_tag == to_underlying(Fields::kProgressBar)) |
458 | 0 | { |
459 | 0 | err = DataModel::Decode(reader, progressBar); |
460 | 0 | } |
461 | 0 | else if (__context_tag == to_underlying(Fields::kSplash)) |
462 | 0 | { |
463 | 0 | err = DataModel::Decode(reader, splash); |
464 | 0 | } |
465 | 0 | else if (__context_tag == to_underlying(Fields::kWaterMark)) |
466 | 0 | { |
467 | 0 | err = DataModel::Decode(reader, waterMark); |
468 | 0 | } |
469 | |
|
470 | 0 | ReturnErrorOnFailure(err); |
471 | 0 | } |
472 | 0 | } |
473 | | |
474 | | } // namespace BrandingInformationStruct |
475 | | |
476 | | namespace ContentPresetStruct { |
477 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
478 | 0 | { |
479 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
480 | 0 | encoder.Encode(to_underlying(Fields::kPresetID), presetID); |
481 | 0 | encoder.Encode(to_underlying(Fields::kPresetName), presetName); |
482 | 0 | return encoder.Finalize(); |
483 | 0 | } |
484 | | |
485 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
486 | 0 | { |
487 | 0 | detail::StructDecodeIterator __iterator(reader); |
488 | 0 | while (true) |
489 | 0 | { |
490 | 0 | uint8_t __context_tag = 0; |
491 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
492 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
493 | 0 | ReturnErrorOnFailure(err); |
494 | | |
495 | 0 | if (__context_tag == to_underlying(Fields::kPresetID)) |
496 | 0 | { |
497 | 0 | err = DataModel::Decode(reader, presetID); |
498 | 0 | } |
499 | 0 | else if (__context_tag == to_underlying(Fields::kPresetName)) |
500 | 0 | { |
501 | 0 | err = DataModel::Decode(reader, presetName); |
502 | 0 | } |
503 | |
|
504 | 0 | ReturnErrorOnFailure(err); |
505 | 0 | } |
506 | 0 | } |
507 | | |
508 | | } // namespace ContentPresetStruct |
509 | | } // namespace Structs |
510 | | } // namespace ContentLauncher |
511 | | } // namespace Clusters |
512 | | } // namespace app |
513 | | } // namespace chip |