Coverage Report

Created: 2026-07-10 06:38

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/connectedhomeip/zzz_generated/app-common/clusters/UnitTesting/Commands.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-Commands.ipp.zapt
20
21
#include <clusters/UnitTesting/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 UnitTesting {
31
namespace Commands {
32
namespace Test {
33
34
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
35
0
{
36
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
37
0
    return encoder.Finalize();
38
0
}
39
40
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
41
0
{
42
0
    detail::StructDecodeIterator __iterator(reader);
43
0
    while (true)
44
0
    {
45
0
        uint8_t __context_tag = 0;
46
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
47
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
48
0
        ReturnErrorOnFailure(err);
49
50
0
        ReturnErrorOnFailure(err);
51
0
    }
52
0
}
53
} // namespace Test
54
namespace TestSpecificResponse {
55
56
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
57
0
{
58
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
59
0
    encoder.Encode(to_underlying(Fields::kReturnValue), returnValue);
60
0
    return encoder.Finalize();
61
0
}
62
63
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
64
0
{
65
0
    detail::StructDecodeIterator __iterator(reader);
66
0
    while (true)
67
0
    {
68
0
        uint8_t __context_tag = 0;
69
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
70
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
71
0
        ReturnErrorOnFailure(err);
72
73
0
        if (__context_tag == to_underlying(Fields::kReturnValue))
74
0
        {
75
0
            err = DataModel::Decode(reader, returnValue);
76
0
        }
77
78
0
        ReturnErrorOnFailure(err);
79
0
    }
80
0
}
81
} // namespace TestSpecificResponse
82
namespace TestNotHandled {
83
84
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
85
0
{
86
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
87
0
    return encoder.Finalize();
88
0
}
89
90
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
91
0
{
92
0
    detail::StructDecodeIterator __iterator(reader);
93
0
    while (true)
94
0
    {
95
0
        uint8_t __context_tag = 0;
96
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
97
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
98
0
        ReturnErrorOnFailure(err);
99
100
0
        ReturnErrorOnFailure(err);
101
0
    }
102
0
}
103
} // namespace TestNotHandled
104
namespace TestAddArgumentsResponse {
105
106
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
107
0
{
108
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
109
0
    encoder.Encode(to_underlying(Fields::kReturnValue), returnValue);
110
0
    return encoder.Finalize();
111
0
}
112
113
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
114
0
{
115
0
    detail::StructDecodeIterator __iterator(reader);
116
0
    while (true)
117
0
    {
118
0
        uint8_t __context_tag = 0;
119
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
120
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
121
0
        ReturnErrorOnFailure(err);
122
123
0
        if (__context_tag == to_underlying(Fields::kReturnValue))
124
0
        {
125
0
            err = DataModel::Decode(reader, returnValue);
126
0
        }
127
128
0
        ReturnErrorOnFailure(err);
129
0
    }
130
0
}
131
} // namespace TestAddArgumentsResponse
132
namespace TestSpecific {
133
134
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
135
0
{
136
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
137
0
    return encoder.Finalize();
138
0
}
139
140
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
141
0
{
142
0
    detail::StructDecodeIterator __iterator(reader);
143
0
    while (true)
144
0
    {
145
0
        uint8_t __context_tag = 0;
146
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
147
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
148
0
        ReturnErrorOnFailure(err);
149
150
0
        ReturnErrorOnFailure(err);
151
0
    }
152
0
}
153
} // namespace TestSpecific
154
namespace TestSimpleArgumentResponse {
155
156
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
157
0
{
158
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
159
0
    encoder.Encode(to_underlying(Fields::kReturnValue), returnValue);
160
0
    return encoder.Finalize();
161
0
}
162
163
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
164
0
{
165
0
    detail::StructDecodeIterator __iterator(reader);
166
0
    while (true)
167
0
    {
168
0
        uint8_t __context_tag = 0;
169
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
170
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
171
0
        ReturnErrorOnFailure(err);
172
173
0
        if (__context_tag == to_underlying(Fields::kReturnValue))
174
0
        {
175
0
            err = DataModel::Decode(reader, returnValue);
176
0
        }
177
178
0
        ReturnErrorOnFailure(err);
179
0
    }
180
0
}
181
} // namespace TestSimpleArgumentResponse
182
namespace TestUnknownCommand {
183
184
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
185
0
{
186
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
187
0
    return encoder.Finalize();
188
0
}
189
190
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
191
0
{
192
0
    detail::StructDecodeIterator __iterator(reader);
193
0
    while (true)
194
0
    {
195
0
        uint8_t __context_tag = 0;
196
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
197
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
198
0
        ReturnErrorOnFailure(err);
199
200
0
        ReturnErrorOnFailure(err);
201
0
    }
202
0
}
203
} // namespace TestUnknownCommand
204
namespace TestStructArrayArgumentResponse {
205
206
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
207
0
{
208
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
209
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
210
0
    encoder.Encode(to_underlying(Fields::kArg2), arg2);
211
0
    encoder.Encode(to_underlying(Fields::kArg3), arg3);
212
0
    encoder.Encode(to_underlying(Fields::kArg4), arg4);
213
0
    encoder.Encode(to_underlying(Fields::kArg5), arg5);
214
0
    encoder.Encode(to_underlying(Fields::kArg6), arg6);
215
0
    return encoder.Finalize();
216
0
}
217
218
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
219
0
{
220
0
    detail::StructDecodeIterator __iterator(reader);
221
0
    while (true)
222
0
    {
223
0
        uint8_t __context_tag = 0;
224
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
225
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
226
0
        ReturnErrorOnFailure(err);
227
228
0
        if (__context_tag == to_underlying(Fields::kArg1))
229
0
        {
230
0
            err = DataModel::Decode(reader, arg1);
231
0
        }
232
0
        else if (__context_tag == to_underlying(Fields::kArg2))
233
0
        {
234
0
            err = DataModel::Decode(reader, arg2);
235
0
        }
236
0
        else if (__context_tag == to_underlying(Fields::kArg3))
237
0
        {
238
0
            err = DataModel::Decode(reader, arg3);
239
0
        }
240
0
        else if (__context_tag == to_underlying(Fields::kArg4))
241
0
        {
242
0
            err = DataModel::Decode(reader, arg4);
243
0
        }
244
0
        else if (__context_tag == to_underlying(Fields::kArg5))
245
0
        {
246
0
            err = DataModel::Decode(reader, arg5);
247
0
        }
248
0
        else if (__context_tag == to_underlying(Fields::kArg6))
249
0
        {
250
0
            err = DataModel::Decode(reader, arg6);
251
0
        }
252
253
0
        ReturnErrorOnFailure(err);
254
0
    }
255
0
}
256
} // namespace TestStructArrayArgumentResponse
257
namespace TestAddArguments {
258
259
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
260
0
{
261
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
262
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
263
0
    encoder.Encode(to_underlying(Fields::kArg2), arg2);
264
0
    return encoder.Finalize();
265
0
}
266
267
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
268
0
{
269
0
    detail::StructDecodeIterator __iterator(reader);
270
0
    while (true)
271
0
    {
272
0
        uint8_t __context_tag = 0;
273
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
274
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
275
0
        ReturnErrorOnFailure(err);
276
277
0
        if (__context_tag == to_underlying(Fields::kArg1))
278
0
        {
279
0
            err = DataModel::Decode(reader, arg1);
280
0
        }
281
0
        else if (__context_tag == to_underlying(Fields::kArg2))
282
0
        {
283
0
            err = DataModel::Decode(reader, arg2);
284
0
        }
285
286
0
        ReturnErrorOnFailure(err);
287
0
    }
288
0
}
289
} // namespace TestAddArguments
290
namespace TestListInt8UReverseResponse {
291
292
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
293
0
{
294
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
295
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
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::kArg1))
310
0
        {
311
0
            err = DataModel::Decode(reader, arg1);
312
0
        }
313
314
0
        ReturnErrorOnFailure(err);
315
0
    }
316
0
}
317
} // namespace TestListInt8UReverseResponse
318
namespace TestSimpleArgumentRequest {
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::kArg1), arg1);
324
0
    return encoder.Finalize();
325
0
}
326
327
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
328
0
{
329
0
    detail::StructDecodeIterator __iterator(reader);
330
0
    while (true)
331
0
    {
332
0
        uint8_t __context_tag = 0;
333
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
334
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
335
0
        ReturnErrorOnFailure(err);
336
337
0
        if (__context_tag == to_underlying(Fields::kArg1))
338
0
        {
339
0
            err = DataModel::Decode(reader, arg1);
340
0
        }
341
342
0
        ReturnErrorOnFailure(err);
343
0
    }
344
0
}
345
} // namespace TestSimpleArgumentRequest
346
namespace TestEnumsResponse {
347
348
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
349
0
{
350
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
351
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
352
0
    encoder.Encode(to_underlying(Fields::kArg2), arg2);
353
0
    return encoder.Finalize();
354
0
}
355
356
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
357
0
{
358
0
    detail::StructDecodeIterator __iterator(reader);
359
0
    while (true)
360
0
    {
361
0
        uint8_t __context_tag = 0;
362
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
363
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
364
0
        ReturnErrorOnFailure(err);
365
366
0
        if (__context_tag == to_underlying(Fields::kArg1))
367
0
        {
368
0
            err = DataModel::Decode(reader, arg1);
369
0
        }
370
0
        else if (__context_tag == to_underlying(Fields::kArg2))
371
0
        {
372
0
            err = DataModel::Decode(reader, arg2);
373
0
        }
374
375
0
        ReturnErrorOnFailure(err);
376
0
    }
377
0
}
378
} // namespace TestEnumsResponse
379
namespace TestStructArrayArgumentRequest {
380
381
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
382
0
{
383
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
384
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
385
0
    encoder.Encode(to_underlying(Fields::kArg2), arg2);
386
0
    encoder.Encode(to_underlying(Fields::kArg3), arg3);
387
0
    encoder.Encode(to_underlying(Fields::kArg4), arg4);
388
0
    encoder.Encode(to_underlying(Fields::kArg5), arg5);
389
0
    encoder.Encode(to_underlying(Fields::kArg6), arg6);
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::kArg1))
404
0
        {
405
0
            err = DataModel::Decode(reader, arg1);
406
0
        }
407
0
        else if (__context_tag == to_underlying(Fields::kArg2))
408
0
        {
409
0
            err = DataModel::Decode(reader, arg2);
410
0
        }
411
0
        else if (__context_tag == to_underlying(Fields::kArg3))
412
0
        {
413
0
            err = DataModel::Decode(reader, arg3);
414
0
        }
415
0
        else if (__context_tag == to_underlying(Fields::kArg4))
416
0
        {
417
0
            err = DataModel::Decode(reader, arg4);
418
0
        }
419
0
        else if (__context_tag == to_underlying(Fields::kArg5))
420
0
        {
421
0
            err = DataModel::Decode(reader, arg5);
422
0
        }
423
0
        else if (__context_tag == to_underlying(Fields::kArg6))
424
0
        {
425
0
            err = DataModel::Decode(reader, arg6);
426
0
        }
427
428
0
        ReturnErrorOnFailure(err);
429
0
    }
430
0
}
431
} // namespace TestStructArrayArgumentRequest
432
namespace TestNullableOptionalResponse {
433
434
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
435
0
{
436
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
437
0
    encoder.Encode(to_underlying(Fields::kWasPresent), wasPresent);
438
0
    encoder.Encode(to_underlying(Fields::kWasNull), wasNull);
439
0
    encoder.Encode(to_underlying(Fields::kValue), value);
440
0
    encoder.Encode(to_underlying(Fields::kOriginalValue), originalValue);
441
0
    return encoder.Finalize();
442
0
}
443
444
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
445
0
{
446
0
    detail::StructDecodeIterator __iterator(reader);
447
0
    while (true)
448
0
    {
449
0
        uint8_t __context_tag = 0;
450
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
451
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
452
0
        ReturnErrorOnFailure(err);
453
454
0
        if (__context_tag == to_underlying(Fields::kWasPresent))
455
0
        {
456
0
            err = DataModel::Decode(reader, wasPresent);
457
0
        }
458
0
        else if (__context_tag == to_underlying(Fields::kWasNull))
459
0
        {
460
0
            err = DataModel::Decode(reader, wasNull);
461
0
        }
462
0
        else if (__context_tag == to_underlying(Fields::kValue))
463
0
        {
464
0
            err = DataModel::Decode(reader, value);
465
0
        }
466
0
        else if (__context_tag == to_underlying(Fields::kOriginalValue))
467
0
        {
468
0
            err = DataModel::Decode(reader, originalValue);
469
0
        }
470
471
0
        ReturnErrorOnFailure(err);
472
0
    }
473
0
}
474
} // namespace TestNullableOptionalResponse
475
namespace TestStructArgumentRequest {
476
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::kArg1), arg1);
481
0
    return encoder.Finalize();
482
0
}
483
484
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
485
0
{
486
0
    detail::StructDecodeIterator __iterator(reader);
487
0
    while (true)
488
0
    {
489
0
        uint8_t __context_tag = 0;
490
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
491
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
492
0
        ReturnErrorOnFailure(err);
493
494
0
        if (__context_tag == to_underlying(Fields::kArg1))
495
0
        {
496
0
            err = DataModel::Decode(reader, arg1);
497
0
        }
498
499
0
        ReturnErrorOnFailure(err);
500
0
    }
501
0
}
502
} // namespace TestStructArgumentRequest
503
namespace TestComplexNullableOptionalResponse {
504
505
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
506
0
{
507
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
508
0
    encoder.Encode(to_underlying(Fields::kNullableIntWasNull), nullableIntWasNull);
509
0
    encoder.Encode(to_underlying(Fields::kNullableIntValue), nullableIntValue);
510
0
    encoder.Encode(to_underlying(Fields::kOptionalIntWasPresent), optionalIntWasPresent);
511
0
    encoder.Encode(to_underlying(Fields::kOptionalIntValue), optionalIntValue);
512
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalIntWasPresent), nullableOptionalIntWasPresent);
513
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalIntWasNull), nullableOptionalIntWasNull);
514
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalIntValue), nullableOptionalIntValue);
515
0
    encoder.Encode(to_underlying(Fields::kNullableStringWasNull), nullableStringWasNull);
516
0
    encoder.Encode(to_underlying(Fields::kNullableStringValue), nullableStringValue);
517
0
    encoder.Encode(to_underlying(Fields::kOptionalStringWasPresent), optionalStringWasPresent);
518
0
    encoder.Encode(to_underlying(Fields::kOptionalStringValue), optionalStringValue);
519
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalStringWasPresent), nullableOptionalStringWasPresent);
520
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalStringWasNull), nullableOptionalStringWasNull);
521
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalStringValue), nullableOptionalStringValue);
522
0
    encoder.Encode(to_underlying(Fields::kNullableStructWasNull), nullableStructWasNull);
523
0
    encoder.Encode(to_underlying(Fields::kNullableStructValue), nullableStructValue);
524
0
    encoder.Encode(to_underlying(Fields::kOptionalStructWasPresent), optionalStructWasPresent);
525
0
    encoder.Encode(to_underlying(Fields::kOptionalStructValue), optionalStructValue);
526
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalStructWasPresent), nullableOptionalStructWasPresent);
527
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalStructWasNull), nullableOptionalStructWasNull);
528
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalStructValue), nullableOptionalStructValue);
529
0
    encoder.Encode(to_underlying(Fields::kNullableListWasNull), nullableListWasNull);
530
0
    encoder.Encode(to_underlying(Fields::kNullableListValue), nullableListValue);
531
0
    encoder.Encode(to_underlying(Fields::kOptionalListWasPresent), optionalListWasPresent);
532
0
    encoder.Encode(to_underlying(Fields::kOptionalListValue), optionalListValue);
533
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalListWasPresent), nullableOptionalListWasPresent);
534
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalListWasNull), nullableOptionalListWasNull);
535
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalListValue), nullableOptionalListValue);
536
0
    return encoder.Finalize();
537
0
}
538
539
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
540
0
{
541
0
    detail::StructDecodeIterator __iterator(reader);
542
0
    while (true)
543
0
    {
544
0
        uint8_t __context_tag = 0;
545
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
546
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
547
0
        ReturnErrorOnFailure(err);
548
549
0
        if (__context_tag == to_underlying(Fields::kNullableIntWasNull))
550
0
        {
551
0
            err = DataModel::Decode(reader, nullableIntWasNull);
552
0
        }
553
0
        else if (__context_tag == to_underlying(Fields::kNullableIntValue))
554
0
        {
555
0
            err = DataModel::Decode(reader, nullableIntValue);
556
0
        }
557
0
        else if (__context_tag == to_underlying(Fields::kOptionalIntWasPresent))
558
0
        {
559
0
            err = DataModel::Decode(reader, optionalIntWasPresent);
560
0
        }
561
0
        else if (__context_tag == to_underlying(Fields::kOptionalIntValue))
562
0
        {
563
0
            err = DataModel::Decode(reader, optionalIntValue);
564
0
        }
565
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalIntWasPresent))
566
0
        {
567
0
            err = DataModel::Decode(reader, nullableOptionalIntWasPresent);
568
0
        }
569
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalIntWasNull))
570
0
        {
571
0
            err = DataModel::Decode(reader, nullableOptionalIntWasNull);
572
0
        }
573
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalIntValue))
574
0
        {
575
0
            err = DataModel::Decode(reader, nullableOptionalIntValue);
576
0
        }
577
0
        else if (__context_tag == to_underlying(Fields::kNullableStringWasNull))
578
0
        {
579
0
            err = DataModel::Decode(reader, nullableStringWasNull);
580
0
        }
581
0
        else if (__context_tag == to_underlying(Fields::kNullableStringValue))
582
0
        {
583
0
            err = DataModel::Decode(reader, nullableStringValue);
584
0
        }
585
0
        else if (__context_tag == to_underlying(Fields::kOptionalStringWasPresent))
586
0
        {
587
0
            err = DataModel::Decode(reader, optionalStringWasPresent);
588
0
        }
589
0
        else if (__context_tag == to_underlying(Fields::kOptionalStringValue))
590
0
        {
591
0
            err = DataModel::Decode(reader, optionalStringValue);
592
0
        }
593
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalStringWasPresent))
594
0
        {
595
0
            err = DataModel::Decode(reader, nullableOptionalStringWasPresent);
596
0
        }
597
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalStringWasNull))
598
0
        {
599
0
            err = DataModel::Decode(reader, nullableOptionalStringWasNull);
600
0
        }
601
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalStringValue))
602
0
        {
603
0
            err = DataModel::Decode(reader, nullableOptionalStringValue);
604
0
        }
605
0
        else if (__context_tag == to_underlying(Fields::kNullableStructWasNull))
606
0
        {
607
0
            err = DataModel::Decode(reader, nullableStructWasNull);
608
0
        }
609
0
        else if (__context_tag == to_underlying(Fields::kNullableStructValue))
610
0
        {
611
0
            err = DataModel::Decode(reader, nullableStructValue);
612
0
        }
613
0
        else if (__context_tag == to_underlying(Fields::kOptionalStructWasPresent))
614
0
        {
615
0
            err = DataModel::Decode(reader, optionalStructWasPresent);
616
0
        }
617
0
        else if (__context_tag == to_underlying(Fields::kOptionalStructValue))
618
0
        {
619
0
            err = DataModel::Decode(reader, optionalStructValue);
620
0
        }
621
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalStructWasPresent))
622
0
        {
623
0
            err = DataModel::Decode(reader, nullableOptionalStructWasPresent);
624
0
        }
625
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalStructWasNull))
626
0
        {
627
0
            err = DataModel::Decode(reader, nullableOptionalStructWasNull);
628
0
        }
629
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalStructValue))
630
0
        {
631
0
            err = DataModel::Decode(reader, nullableOptionalStructValue);
632
0
        }
633
0
        else if (__context_tag == to_underlying(Fields::kNullableListWasNull))
634
0
        {
635
0
            err = DataModel::Decode(reader, nullableListWasNull);
636
0
        }
637
0
        else if (__context_tag == to_underlying(Fields::kNullableListValue))
638
0
        {
639
0
            err = DataModel::Decode(reader, nullableListValue);
640
0
        }
641
0
        else if (__context_tag == to_underlying(Fields::kOptionalListWasPresent))
642
0
        {
643
0
            err = DataModel::Decode(reader, optionalListWasPresent);
644
0
        }
645
0
        else if (__context_tag == to_underlying(Fields::kOptionalListValue))
646
0
        {
647
0
            err = DataModel::Decode(reader, optionalListValue);
648
0
        }
649
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalListWasPresent))
650
0
        {
651
0
            err = DataModel::Decode(reader, nullableOptionalListWasPresent);
652
0
        }
653
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalListWasNull))
654
0
        {
655
0
            err = DataModel::Decode(reader, nullableOptionalListWasNull);
656
0
        }
657
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalListValue))
658
0
        {
659
0
            err = DataModel::Decode(reader, nullableOptionalListValue);
660
0
        }
661
662
0
        ReturnErrorOnFailure(err);
663
0
    }
664
0
}
665
} // namespace TestComplexNullableOptionalResponse
666
namespace TestNestedStructArgumentRequest {
667
668
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
669
0
{
670
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
671
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
672
0
    return encoder.Finalize();
673
0
}
674
675
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
676
0
{
677
0
    detail::StructDecodeIterator __iterator(reader);
678
0
    while (true)
679
0
    {
680
0
        uint8_t __context_tag = 0;
681
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
682
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
683
0
        ReturnErrorOnFailure(err);
684
685
0
        if (__context_tag == to_underlying(Fields::kArg1))
686
0
        {
687
0
            err = DataModel::Decode(reader, arg1);
688
0
        }
689
690
0
        ReturnErrorOnFailure(err);
691
0
    }
692
0
}
693
} // namespace TestNestedStructArgumentRequest
694
namespace BooleanResponse {
695
696
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
697
0
{
698
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
699
0
    encoder.Encode(to_underlying(Fields::kValue), value);
700
0
    return encoder.Finalize();
701
0
}
702
703
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
704
0
{
705
0
    detail::StructDecodeIterator __iterator(reader);
706
0
    while (true)
707
0
    {
708
0
        uint8_t __context_tag = 0;
709
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
710
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
711
0
        ReturnErrorOnFailure(err);
712
713
0
        if (__context_tag == to_underlying(Fields::kValue))
714
0
        {
715
0
            err = DataModel::Decode(reader, value);
716
0
        }
717
718
0
        ReturnErrorOnFailure(err);
719
0
    }
720
0
}
721
} // namespace BooleanResponse
722
namespace TestListStructArgumentRequest {
723
724
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
725
0
{
726
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
727
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
728
0
    return encoder.Finalize();
729
0
}
730
731
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
732
0
{
733
0
    detail::StructDecodeIterator __iterator(reader);
734
0
    while (true)
735
0
    {
736
0
        uint8_t __context_tag = 0;
737
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
738
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
739
0
        ReturnErrorOnFailure(err);
740
741
0
        if (__context_tag == to_underlying(Fields::kArg1))
742
0
        {
743
0
            err = DataModel::Decode(reader, arg1);
744
0
        }
745
746
0
        ReturnErrorOnFailure(err);
747
0
    }
748
0
}
749
} // namespace TestListStructArgumentRequest
750
namespace SimpleStructResponse {
751
752
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
753
0
{
754
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
755
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
756
0
    return encoder.Finalize();
757
0
}
758
759
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
760
0
{
761
0
    detail::StructDecodeIterator __iterator(reader);
762
0
    while (true)
763
0
    {
764
0
        uint8_t __context_tag = 0;
765
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
766
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
767
0
        ReturnErrorOnFailure(err);
768
769
0
        if (__context_tag == to_underlying(Fields::kArg1))
770
0
        {
771
0
            err = DataModel::Decode(reader, arg1);
772
0
        }
773
774
0
        ReturnErrorOnFailure(err);
775
0
    }
776
0
}
777
} // namespace SimpleStructResponse
778
namespace TestListInt8UArgumentRequest {
779
780
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
781
0
{
782
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
783
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
784
0
    return encoder.Finalize();
785
0
}
786
787
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
788
0
{
789
0
    detail::StructDecodeIterator __iterator(reader);
790
0
    while (true)
791
0
    {
792
0
        uint8_t __context_tag = 0;
793
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
794
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
795
0
        ReturnErrorOnFailure(err);
796
797
0
        if (__context_tag == to_underlying(Fields::kArg1))
798
0
        {
799
0
            err = DataModel::Decode(reader, arg1);
800
0
        }
801
802
0
        ReturnErrorOnFailure(err);
803
0
    }
804
0
}
805
} // namespace TestListInt8UArgumentRequest
806
namespace TestEmitTestEventResponse {
807
808
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
809
0
{
810
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
811
0
    encoder.Encode(to_underlying(Fields::kValue), value);
812
0
    return encoder.Finalize();
813
0
}
814
815
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
816
0
{
817
0
    detail::StructDecodeIterator __iterator(reader);
818
0
    while (true)
819
0
    {
820
0
        uint8_t __context_tag = 0;
821
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
822
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
823
0
        ReturnErrorOnFailure(err);
824
825
0
        if (__context_tag == to_underlying(Fields::kValue))
826
0
        {
827
0
            err = DataModel::Decode(reader, value);
828
0
        }
829
830
0
        ReturnErrorOnFailure(err);
831
0
    }
832
0
}
833
} // namespace TestEmitTestEventResponse
834
namespace TestNestedStructListArgumentRequest {
835
836
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
837
0
{
838
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
839
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
840
0
    return encoder.Finalize();
841
0
}
842
843
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
844
0
{
845
0
    detail::StructDecodeIterator __iterator(reader);
846
0
    while (true)
847
0
    {
848
0
        uint8_t __context_tag = 0;
849
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
850
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
851
0
        ReturnErrorOnFailure(err);
852
853
0
        if (__context_tag == to_underlying(Fields::kArg1))
854
0
        {
855
0
            err = DataModel::Decode(reader, arg1);
856
0
        }
857
858
0
        ReturnErrorOnFailure(err);
859
0
    }
860
0
}
861
} // namespace TestNestedStructListArgumentRequest
862
namespace TestEmitTestFabricScopedEventResponse {
863
864
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
865
0
{
866
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
867
0
    encoder.Encode(to_underlying(Fields::kValue), value);
868
0
    return encoder.Finalize();
869
0
}
870
871
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
872
0
{
873
0
    detail::StructDecodeIterator __iterator(reader);
874
0
    while (true)
875
0
    {
876
0
        uint8_t __context_tag = 0;
877
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
878
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
879
0
        ReturnErrorOnFailure(err);
880
881
0
        if (__context_tag == to_underlying(Fields::kValue))
882
0
        {
883
0
            err = DataModel::Decode(reader, value);
884
0
        }
885
886
0
        ReturnErrorOnFailure(err);
887
0
    }
888
0
}
889
} // namespace TestEmitTestFabricScopedEventResponse
890
namespace TestListNestedStructListArgumentRequest {
891
892
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
893
0
{
894
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
895
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
896
0
    return encoder.Finalize();
897
0
}
898
899
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
900
0
{
901
0
    detail::StructDecodeIterator __iterator(reader);
902
0
    while (true)
903
0
    {
904
0
        uint8_t __context_tag = 0;
905
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
906
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
907
0
        ReturnErrorOnFailure(err);
908
909
0
        if (__context_tag == to_underlying(Fields::kArg1))
910
0
        {
911
0
            err = DataModel::Decode(reader, arg1);
912
0
        }
913
914
0
        ReturnErrorOnFailure(err);
915
0
    }
916
0
}
917
} // namespace TestListNestedStructListArgumentRequest
918
namespace TestBatchHelperResponse {
919
920
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
921
0
{
922
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
923
0
    encoder.Encode(to_underlying(Fields::kBuffer), buffer);
924
0
    return encoder.Finalize();
925
0
}
926
927
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
928
0
{
929
0
    detail::StructDecodeIterator __iterator(reader);
930
0
    while (true)
931
0
    {
932
0
        uint8_t __context_tag = 0;
933
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
934
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
935
0
        ReturnErrorOnFailure(err);
936
937
0
        if (__context_tag == to_underlying(Fields::kBuffer))
938
0
        {
939
0
            err = DataModel::Decode(reader, buffer);
940
0
        }
941
942
0
        ReturnErrorOnFailure(err);
943
0
    }
944
0
}
945
} // namespace TestBatchHelperResponse
946
namespace TestListInt8UReverseRequest {
947
948
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
949
0
{
950
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
951
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
952
0
    return encoder.Finalize();
953
0
}
954
955
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
956
0
{
957
0
    detail::StructDecodeIterator __iterator(reader);
958
0
    while (true)
959
0
    {
960
0
        uint8_t __context_tag = 0;
961
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
962
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
963
0
        ReturnErrorOnFailure(err);
964
965
0
        if (__context_tag == to_underlying(Fields::kArg1))
966
0
        {
967
0
            err = DataModel::Decode(reader, arg1);
968
0
        }
969
970
0
        ReturnErrorOnFailure(err);
971
0
    }
972
0
}
973
} // namespace TestListInt8UReverseRequest
974
namespace StringEchoResponse {
975
976
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
977
0
{
978
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
979
0
    encoder.Encode(to_underlying(Fields::kPayload), payload);
980
0
    return encoder.Finalize();
981
0
}
982
983
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
984
0
{
985
0
    detail::StructDecodeIterator __iterator(reader);
986
0
    while (true)
987
0
    {
988
0
        uint8_t __context_tag = 0;
989
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
990
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
991
0
        ReturnErrorOnFailure(err);
992
993
0
        if (__context_tag == to_underlying(Fields::kPayload))
994
0
        {
995
0
            err = DataModel::Decode(reader, payload);
996
0
        }
997
998
0
        ReturnErrorOnFailure(err);
999
0
    }
1000
0
}
1001
} // namespace StringEchoResponse
1002
namespace TestEnumsRequest {
1003
1004
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1005
0
{
1006
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1007
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
1008
0
    encoder.Encode(to_underlying(Fields::kArg2), arg2);
1009
0
    return encoder.Finalize();
1010
0
}
1011
1012
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1013
0
{
1014
0
    detail::StructDecodeIterator __iterator(reader);
1015
0
    while (true)
1016
0
    {
1017
0
        uint8_t __context_tag = 0;
1018
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1019
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1020
0
        ReturnErrorOnFailure(err);
1021
1022
0
        if (__context_tag == to_underlying(Fields::kArg1))
1023
0
        {
1024
0
            err = DataModel::Decode(reader, arg1);
1025
0
        }
1026
0
        else if (__context_tag == to_underlying(Fields::kArg2))
1027
0
        {
1028
0
            err = DataModel::Decode(reader, arg2);
1029
0
        }
1030
1031
0
        ReturnErrorOnFailure(err);
1032
0
    }
1033
0
}
1034
} // namespace TestEnumsRequest
1035
namespace GlobalEchoResponse {
1036
1037
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
1038
0
{
1039
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1040
0
    encoder.Encode(to_underlying(Fields::kField1), field1);
1041
0
    encoder.Encode(to_underlying(Fields::kField2), field2);
1042
0
    return encoder.Finalize();
1043
0
}
1044
1045
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1046
0
{
1047
0
    detail::StructDecodeIterator __iterator(reader);
1048
0
    while (true)
1049
0
    {
1050
0
        uint8_t __context_tag = 0;
1051
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1052
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1053
0
        ReturnErrorOnFailure(err);
1054
1055
0
        if (__context_tag == to_underlying(Fields::kField1))
1056
0
        {
1057
0
            err = DataModel::Decode(reader, field1);
1058
0
        }
1059
0
        else if (__context_tag == to_underlying(Fields::kField2))
1060
0
        {
1061
0
            err = DataModel::Decode(reader, field2);
1062
0
        }
1063
1064
0
        ReturnErrorOnFailure(err);
1065
0
    }
1066
0
}
1067
} // namespace GlobalEchoResponse
1068
namespace TestNullableOptionalRequest {
1069
1070
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1071
0
{
1072
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1073
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
1074
0
    return encoder.Finalize();
1075
0
}
1076
1077
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1078
0
{
1079
0
    detail::StructDecodeIterator __iterator(reader);
1080
0
    while (true)
1081
0
    {
1082
0
        uint8_t __context_tag = 0;
1083
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1084
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1085
0
        ReturnErrorOnFailure(err);
1086
1087
0
        if (__context_tag == to_underlying(Fields::kArg1))
1088
0
        {
1089
0
            err = DataModel::Decode(reader, arg1);
1090
0
        }
1091
1092
0
        ReturnErrorOnFailure(err);
1093
0
    }
1094
0
}
1095
} // namespace TestNullableOptionalRequest
1096
namespace TestComplexNullableOptionalRequest {
1097
1098
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1099
0
{
1100
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1101
0
    encoder.Encode(to_underlying(Fields::kNullableInt), nullableInt);
1102
0
    encoder.Encode(to_underlying(Fields::kOptionalInt), optionalInt);
1103
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalInt), nullableOptionalInt);
1104
0
    encoder.Encode(to_underlying(Fields::kNullableString), nullableString);
1105
0
    encoder.Encode(to_underlying(Fields::kOptionalString), optionalString);
1106
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalString), nullableOptionalString);
1107
0
    encoder.Encode(to_underlying(Fields::kNullableStruct), nullableStruct);
1108
0
    encoder.Encode(to_underlying(Fields::kOptionalStruct), optionalStruct);
1109
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalStruct), nullableOptionalStruct);
1110
0
    encoder.Encode(to_underlying(Fields::kNullableList), nullableList);
1111
0
    encoder.Encode(to_underlying(Fields::kOptionalList), optionalList);
1112
0
    encoder.Encode(to_underlying(Fields::kNullableOptionalList), nullableOptionalList);
1113
0
    return encoder.Finalize();
1114
0
}
1115
1116
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1117
0
{
1118
0
    detail::StructDecodeIterator __iterator(reader);
1119
0
    while (true)
1120
0
    {
1121
0
        uint8_t __context_tag = 0;
1122
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1123
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1124
0
        ReturnErrorOnFailure(err);
1125
1126
0
        if (__context_tag == to_underlying(Fields::kNullableInt))
1127
0
        {
1128
0
            err = DataModel::Decode(reader, nullableInt);
1129
0
        }
1130
0
        else if (__context_tag == to_underlying(Fields::kOptionalInt))
1131
0
        {
1132
0
            err = DataModel::Decode(reader, optionalInt);
1133
0
        }
1134
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalInt))
1135
0
        {
1136
0
            err = DataModel::Decode(reader, nullableOptionalInt);
1137
0
        }
1138
0
        else if (__context_tag == to_underlying(Fields::kNullableString))
1139
0
        {
1140
0
            err = DataModel::Decode(reader, nullableString);
1141
0
        }
1142
0
        else if (__context_tag == to_underlying(Fields::kOptionalString))
1143
0
        {
1144
0
            err = DataModel::Decode(reader, optionalString);
1145
0
        }
1146
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalString))
1147
0
        {
1148
0
            err = DataModel::Decode(reader, nullableOptionalString);
1149
0
        }
1150
0
        else if (__context_tag == to_underlying(Fields::kNullableStruct))
1151
0
        {
1152
0
            err = DataModel::Decode(reader, nullableStruct);
1153
0
        }
1154
0
        else if (__context_tag == to_underlying(Fields::kOptionalStruct))
1155
0
        {
1156
0
            err = DataModel::Decode(reader, optionalStruct);
1157
0
        }
1158
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalStruct))
1159
0
        {
1160
0
            err = DataModel::Decode(reader, nullableOptionalStruct);
1161
0
        }
1162
0
        else if (__context_tag == to_underlying(Fields::kNullableList))
1163
0
        {
1164
0
            err = DataModel::Decode(reader, nullableList);
1165
0
        }
1166
0
        else if (__context_tag == to_underlying(Fields::kOptionalList))
1167
0
        {
1168
0
            err = DataModel::Decode(reader, optionalList);
1169
0
        }
1170
0
        else if (__context_tag == to_underlying(Fields::kNullableOptionalList))
1171
0
        {
1172
0
            err = DataModel::Decode(reader, nullableOptionalList);
1173
0
        }
1174
1175
0
        ReturnErrorOnFailure(err);
1176
0
    }
1177
0
}
1178
} // namespace TestComplexNullableOptionalRequest
1179
namespace SimpleStructEchoRequest {
1180
1181
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1182
0
{
1183
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1184
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
1185
0
    return encoder.Finalize();
1186
0
}
1187
1188
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1189
0
{
1190
0
    detail::StructDecodeIterator __iterator(reader);
1191
0
    while (true)
1192
0
    {
1193
0
        uint8_t __context_tag = 0;
1194
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1195
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1196
0
        ReturnErrorOnFailure(err);
1197
1198
0
        if (__context_tag == to_underlying(Fields::kArg1))
1199
0
        {
1200
0
            err = DataModel::Decode(reader, arg1);
1201
0
        }
1202
1203
0
        ReturnErrorOnFailure(err);
1204
0
    }
1205
0
}
1206
} // namespace SimpleStructEchoRequest
1207
namespace TimedInvokeRequest {
1208
1209
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1210
0
{
1211
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1212
0
    return encoder.Finalize();
1213
0
}
1214
1215
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1216
0
{
1217
0
    detail::StructDecodeIterator __iterator(reader);
1218
0
    while (true)
1219
0
    {
1220
0
        uint8_t __context_tag = 0;
1221
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1222
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1223
0
        ReturnErrorOnFailure(err);
1224
1225
0
        ReturnErrorOnFailure(err);
1226
0
    }
1227
0
}
1228
} // namespace TimedInvokeRequest
1229
namespace TestSimpleOptionalArgumentRequest {
1230
1231
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1232
0
{
1233
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1234
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
1235
0
    return encoder.Finalize();
1236
0
}
1237
1238
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1239
0
{
1240
0
    detail::StructDecodeIterator __iterator(reader);
1241
0
    while (true)
1242
0
    {
1243
0
        uint8_t __context_tag = 0;
1244
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1245
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1246
0
        ReturnErrorOnFailure(err);
1247
1248
0
        if (__context_tag == to_underlying(Fields::kArg1))
1249
0
        {
1250
0
            err = DataModel::Decode(reader, arg1);
1251
0
        }
1252
1253
0
        ReturnErrorOnFailure(err);
1254
0
    }
1255
0
}
1256
} // namespace TestSimpleOptionalArgumentRequest
1257
namespace TestEmitTestEventRequest {
1258
1259
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1260
0
{
1261
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1262
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
1263
0
    encoder.Encode(to_underlying(Fields::kArg2), arg2);
1264
0
    encoder.Encode(to_underlying(Fields::kArg3), arg3);
1265
0
    return encoder.Finalize();
1266
0
}
1267
1268
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1269
0
{
1270
0
    detail::StructDecodeIterator __iterator(reader);
1271
0
    while (true)
1272
0
    {
1273
0
        uint8_t __context_tag = 0;
1274
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1275
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1276
0
        ReturnErrorOnFailure(err);
1277
1278
0
        if (__context_tag == to_underlying(Fields::kArg1))
1279
0
        {
1280
0
            err = DataModel::Decode(reader, arg1);
1281
0
        }
1282
0
        else if (__context_tag == to_underlying(Fields::kArg2))
1283
0
        {
1284
0
            err = DataModel::Decode(reader, arg2);
1285
0
        }
1286
0
        else if (__context_tag == to_underlying(Fields::kArg3))
1287
0
        {
1288
0
            err = DataModel::Decode(reader, arg3);
1289
0
        }
1290
1291
0
        ReturnErrorOnFailure(err);
1292
0
    }
1293
0
}
1294
} // namespace TestEmitTestEventRequest
1295
namespace TestEmitTestFabricScopedEventRequest {
1296
1297
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1298
0
{
1299
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1300
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
1301
0
    return encoder.Finalize();
1302
0
}
1303
1304
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1305
0
{
1306
0
    detail::StructDecodeIterator __iterator(reader);
1307
0
    while (true)
1308
0
    {
1309
0
        uint8_t __context_tag = 0;
1310
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1311
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1312
0
        ReturnErrorOnFailure(err);
1313
1314
0
        if (__context_tag == to_underlying(Fields::kArg1))
1315
0
        {
1316
0
            err = DataModel::Decode(reader, arg1);
1317
0
        }
1318
1319
0
        ReturnErrorOnFailure(err);
1320
0
    }
1321
0
}
1322
} // namespace TestEmitTestFabricScopedEventRequest
1323
namespace TestBatchHelperRequest {
1324
1325
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1326
0
{
1327
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1328
0
    encoder.Encode(to_underlying(Fields::kSleepBeforeResponseTimeMs), sleepBeforeResponseTimeMs);
1329
0
    encoder.Encode(to_underlying(Fields::kSizeOfResponseBuffer), sizeOfResponseBuffer);
1330
0
    encoder.Encode(to_underlying(Fields::kFillCharacter), fillCharacter);
1331
0
    return encoder.Finalize();
1332
0
}
1333
1334
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1335
0
{
1336
0
    detail::StructDecodeIterator __iterator(reader);
1337
0
    while (true)
1338
0
    {
1339
0
        uint8_t __context_tag = 0;
1340
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1341
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1342
0
        ReturnErrorOnFailure(err);
1343
1344
0
        if (__context_tag == to_underlying(Fields::kSleepBeforeResponseTimeMs))
1345
0
        {
1346
0
            err = DataModel::Decode(reader, sleepBeforeResponseTimeMs);
1347
0
        }
1348
0
        else if (__context_tag == to_underlying(Fields::kSizeOfResponseBuffer))
1349
0
        {
1350
0
            err = DataModel::Decode(reader, sizeOfResponseBuffer);
1351
0
        }
1352
0
        else if (__context_tag == to_underlying(Fields::kFillCharacter))
1353
0
        {
1354
0
            err = DataModel::Decode(reader, fillCharacter);
1355
0
        }
1356
1357
0
        ReturnErrorOnFailure(err);
1358
0
    }
1359
0
}
1360
} // namespace TestBatchHelperRequest
1361
namespace TestSecondBatchHelperRequest {
1362
1363
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1364
0
{
1365
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1366
0
    encoder.Encode(to_underlying(Fields::kSleepBeforeResponseTimeMs), sleepBeforeResponseTimeMs);
1367
0
    encoder.Encode(to_underlying(Fields::kSizeOfResponseBuffer), sizeOfResponseBuffer);
1368
0
    encoder.Encode(to_underlying(Fields::kFillCharacter), fillCharacter);
1369
0
    return encoder.Finalize();
1370
0
}
1371
1372
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1373
0
{
1374
0
    detail::StructDecodeIterator __iterator(reader);
1375
0
    while (true)
1376
0
    {
1377
0
        uint8_t __context_tag = 0;
1378
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1379
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1380
0
        ReturnErrorOnFailure(err);
1381
1382
0
        if (__context_tag == to_underlying(Fields::kSleepBeforeResponseTimeMs))
1383
0
        {
1384
0
            err = DataModel::Decode(reader, sleepBeforeResponseTimeMs);
1385
0
        }
1386
0
        else if (__context_tag == to_underlying(Fields::kSizeOfResponseBuffer))
1387
0
        {
1388
0
            err = DataModel::Decode(reader, sizeOfResponseBuffer);
1389
0
        }
1390
0
        else if (__context_tag == to_underlying(Fields::kFillCharacter))
1391
0
        {
1392
0
            err = DataModel::Decode(reader, fillCharacter);
1393
0
        }
1394
1395
0
        ReturnErrorOnFailure(err);
1396
0
    }
1397
0
}
1398
} // namespace TestSecondBatchHelperRequest
1399
namespace StringEchoRequest {
1400
1401
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1402
0
{
1403
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1404
0
    encoder.Encode(to_underlying(Fields::kPayload), payload);
1405
0
    return encoder.Finalize();
1406
0
}
1407
1408
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1409
0
{
1410
0
    detail::StructDecodeIterator __iterator(reader);
1411
0
    while (true)
1412
0
    {
1413
0
        uint8_t __context_tag = 0;
1414
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1415
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1416
0
        ReturnErrorOnFailure(err);
1417
1418
0
        if (__context_tag == to_underlying(Fields::kPayload))
1419
0
        {
1420
0
            err = DataModel::Decode(reader, payload);
1421
0
        }
1422
1423
0
        ReturnErrorOnFailure(err);
1424
0
    }
1425
0
}
1426
} // namespace StringEchoRequest
1427
namespace GlobalEchoRequest {
1428
1429
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1430
0
{
1431
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1432
0
    encoder.Encode(to_underlying(Fields::kField1), field1);
1433
0
    encoder.Encode(to_underlying(Fields::kField2), field2);
1434
0
    return encoder.Finalize();
1435
0
}
1436
1437
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1438
0
{
1439
0
    detail::StructDecodeIterator __iterator(reader);
1440
0
    while (true)
1441
0
    {
1442
0
        uint8_t __context_tag = 0;
1443
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1444
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1445
0
        ReturnErrorOnFailure(err);
1446
1447
0
        if (__context_tag == to_underlying(Fields::kField1))
1448
0
        {
1449
0
            err = DataModel::Decode(reader, field1);
1450
0
        }
1451
0
        else if (__context_tag == to_underlying(Fields::kField2))
1452
0
        {
1453
0
            err = DataModel::Decode(reader, field2);
1454
0
        }
1455
1456
0
        ReturnErrorOnFailure(err);
1457
0
    }
1458
0
}
1459
} // namespace GlobalEchoRequest
1460
namespace TestCheckCommandFlags {
1461
1462
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1463
0
{
1464
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1465
0
    return encoder.Finalize();
1466
0
}
1467
1468
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
1469
0
{
1470
0
    detail::StructDecodeIterator __iterator(reader);
1471
0
    while (true)
1472
0
    {
1473
0
        uint8_t __context_tag = 0;
1474
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1475
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1476
0
        ReturnErrorOnFailure(err);
1477
1478
0
        ReturnErrorOnFailure(err);
1479
0
    }
1480
0
}
1481
} // namespace TestCheckCommandFlags
1482
namespace TestDifferentVendorMeiRequest {
1483
1484
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
1485
0
{
1486
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1487
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
1488
0
    return encoder.Finalize();
1489
0
}
1490
1491
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1492
0
{
1493
0
    detail::StructDecodeIterator __iterator(reader);
1494
0
    while (true)
1495
0
    {
1496
0
        uint8_t __context_tag = 0;
1497
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1498
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1499
0
        ReturnErrorOnFailure(err);
1500
1501
0
        if (__context_tag == to_underlying(Fields::kArg1))
1502
0
        {
1503
0
            err = DataModel::Decode(reader, arg1);
1504
0
        }
1505
1506
0
        ReturnErrorOnFailure(err);
1507
0
    }
1508
0
}
1509
} // namespace TestDifferentVendorMeiRequest
1510
namespace TestDifferentVendorMeiResponse {
1511
1512
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
1513
0
{
1514
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
1515
0
    encoder.Encode(to_underlying(Fields::kArg1), arg1);
1516
0
    encoder.Encode(to_underlying(Fields::kEventNumber), eventNumber);
1517
0
    return encoder.Finalize();
1518
0
}
1519
1520
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
1521
0
{
1522
0
    detail::StructDecodeIterator __iterator(reader);
1523
0
    while (true)
1524
0
    {
1525
0
        uint8_t __context_tag = 0;
1526
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
1527
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
1528
0
        ReturnErrorOnFailure(err);
1529
1530
0
        if (__context_tag == to_underlying(Fields::kArg1))
1531
0
        {
1532
0
            err = DataModel::Decode(reader, arg1);
1533
0
        }
1534
0
        else if (__context_tag == to_underlying(Fields::kEventNumber))
1535
0
        {
1536
0
            err = DataModel::Decode(reader, eventNumber);
1537
0
        }
1538
1539
0
        ReturnErrorOnFailure(err);
1540
0
    }
1541
0
}
1542
} // namespace TestDifferentVendorMeiResponse
1543
} // namespace Commands
1544
} // namespace UnitTesting
1545
} // namespace Clusters
1546
} // namespace app
1547
} // namespace chip