Coverage Report

Created: 2026-11-12 07:31

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/connectedhomeip/zzz_generated/app-common/clusters/Thermostat/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/Thermostat/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 Thermostat {
30
namespace Structs {
31
32
namespace ScheduleTransitionStruct {
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::kDayOfWeek), dayOfWeek);
37
0
    encoder.Encode(to_underlying(Fields::kTransitionTime), transitionTime);
38
0
    encoder.Encode(to_underlying(Fields::kPresetHandle), presetHandle);
39
0
    encoder.Encode(to_underlying(Fields::kSystemMode), systemMode);
40
0
    encoder.Encode(to_underlying(Fields::kCoolingSetpoint), coolingSetpoint);
41
0
    encoder.Encode(to_underlying(Fields::kHeatingSetpoint), heatingSetpoint);
42
0
    return encoder.Finalize();
43
0
}
44
45
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
46
0
{
47
0
    detail::StructDecodeIterator __iterator(reader);
48
0
    while (true)
49
0
    {
50
0
        uint8_t __context_tag = 0;
51
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
52
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
53
0
        ReturnErrorOnFailure(err);
54
55
0
        if (__context_tag == to_underlying(Fields::kDayOfWeek))
56
0
        {
57
0
            err = DataModel::Decode(reader, dayOfWeek);
58
0
        }
59
0
        else if (__context_tag == to_underlying(Fields::kTransitionTime))
60
0
        {
61
0
            err = DataModel::Decode(reader, transitionTime);
62
0
        }
63
0
        else if (__context_tag == to_underlying(Fields::kPresetHandle))
64
0
        {
65
0
            err = DataModel::Decode(reader, presetHandle);
66
0
        }
67
0
        else if (__context_tag == to_underlying(Fields::kSystemMode))
68
0
        {
69
0
            err = DataModel::Decode(reader, systemMode);
70
0
        }
71
0
        else if (__context_tag == to_underlying(Fields::kCoolingSetpoint))
72
0
        {
73
0
            err = DataModel::Decode(reader, coolingSetpoint);
74
0
        }
75
0
        else if (__context_tag == to_underlying(Fields::kHeatingSetpoint))
76
0
        {
77
0
            err = DataModel::Decode(reader, heatingSetpoint);
78
0
        }
79
80
0
        ReturnErrorOnFailure(err);
81
0
    }
82
0
}
83
84
} // namespace ScheduleTransitionStruct
85
86
namespace ScheduleStruct {
87
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
88
0
{
89
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
90
0
    encoder.Encode(to_underlying(Fields::kScheduleHandle), scheduleHandle);
91
0
    encoder.Encode(to_underlying(Fields::kSystemMode), systemMode);
92
0
    encoder.Encode(to_underlying(Fields::kName), name);
93
0
    encoder.Encode(to_underlying(Fields::kPresetHandle), presetHandle);
94
0
    encoder.Encode(to_underlying(Fields::kTransitions), transitions);
95
0
    encoder.Encode(to_underlying(Fields::kBuiltIn), builtIn);
96
0
    return encoder.Finalize();
97
0
}
98
99
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
100
0
{
101
0
    detail::StructDecodeIterator __iterator(reader);
102
0
    while (true)
103
0
    {
104
0
        uint8_t __context_tag = 0;
105
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
106
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
107
0
        ReturnErrorOnFailure(err);
108
109
0
        if (__context_tag == to_underlying(Fields::kScheduleHandle))
110
0
        {
111
0
            err = DataModel::Decode(reader, scheduleHandle);
112
0
        }
113
0
        else if (__context_tag == to_underlying(Fields::kSystemMode))
114
0
        {
115
0
            err = DataModel::Decode(reader, systemMode);
116
0
        }
117
0
        else if (__context_tag == to_underlying(Fields::kName))
118
0
        {
119
0
            err = DataModel::Decode(reader, name);
120
0
        }
121
0
        else if (__context_tag == to_underlying(Fields::kPresetHandle))
122
0
        {
123
0
            err = DataModel::Decode(reader, presetHandle);
124
0
        }
125
0
        else if (__context_tag == to_underlying(Fields::kTransitions))
126
0
        {
127
0
            err = DataModel::Decode(reader, transitions);
128
0
        }
129
0
        else if (__context_tag == to_underlying(Fields::kBuiltIn))
130
0
        {
131
0
            err = DataModel::Decode(reader, builtIn);
132
0
        }
133
134
0
        ReturnErrorOnFailure(err);
135
0
    }
136
0
}
137
138
} // namespace ScheduleStruct
139
140
namespace PresetStruct {
141
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
142
0
{
143
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
144
0
    encoder.Encode(to_underlying(Fields::kPresetHandle), presetHandle);
145
0
    encoder.Encode(to_underlying(Fields::kPresetScenario), presetScenario);
146
0
    encoder.Encode(to_underlying(Fields::kName), name);
147
0
    encoder.Encode(to_underlying(Fields::kCoolingSetpoint), coolingSetpoint);
148
0
    encoder.Encode(to_underlying(Fields::kHeatingSetpoint), heatingSetpoint);
149
0
    encoder.Encode(to_underlying(Fields::kBuiltIn), builtIn);
150
0
    return encoder.Finalize();
151
0
}
152
153
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
154
0
{
155
0
    detail::StructDecodeIterator __iterator(reader);
156
0
    while (true)
157
0
    {
158
0
        uint8_t __context_tag = 0;
159
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
160
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
161
0
        ReturnErrorOnFailure(err);
162
163
0
        if (__context_tag == to_underlying(Fields::kPresetHandle))
164
0
        {
165
0
            err = DataModel::Decode(reader, presetHandle);
166
0
        }
167
0
        else if (__context_tag == to_underlying(Fields::kPresetScenario))
168
0
        {
169
0
            err = DataModel::Decode(reader, presetScenario);
170
0
        }
171
0
        else if (__context_tag == to_underlying(Fields::kName))
172
0
        {
173
0
            err = DataModel::Decode(reader, name);
174
0
        }
175
0
        else if (__context_tag == to_underlying(Fields::kCoolingSetpoint))
176
0
        {
177
0
            err = DataModel::Decode(reader, coolingSetpoint);
178
0
        }
179
0
        else if (__context_tag == to_underlying(Fields::kHeatingSetpoint))
180
0
        {
181
0
            err = DataModel::Decode(reader, heatingSetpoint);
182
0
        }
183
0
        else if (__context_tag == to_underlying(Fields::kBuiltIn))
184
0
        {
185
0
            err = DataModel::Decode(reader, builtIn);
186
0
        }
187
188
0
        ReturnErrorOnFailure(err);
189
0
    }
190
0
}
191
192
} // namespace PresetStruct
193
194
namespace PresetTypeStruct {
195
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
196
0
{
197
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
198
0
    encoder.Encode(to_underlying(Fields::kPresetScenario), presetScenario);
199
0
    encoder.Encode(to_underlying(Fields::kNumberOfPresets), numberOfPresets);
200
0
    encoder.Encode(to_underlying(Fields::kPresetTypeFeatures), presetTypeFeatures);
201
0
    return encoder.Finalize();
202
0
}
203
204
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
205
0
{
206
0
    detail::StructDecodeIterator __iterator(reader);
207
0
    while (true)
208
0
    {
209
0
        uint8_t __context_tag = 0;
210
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
211
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
212
0
        ReturnErrorOnFailure(err);
213
214
0
        if (__context_tag == to_underlying(Fields::kPresetScenario))
215
0
        {
216
0
            err = DataModel::Decode(reader, presetScenario);
217
0
        }
218
0
        else if (__context_tag == to_underlying(Fields::kNumberOfPresets))
219
0
        {
220
0
            err = DataModel::Decode(reader, numberOfPresets);
221
0
        }
222
0
        else if (__context_tag == to_underlying(Fields::kPresetTypeFeatures))
223
0
        {
224
0
            err = DataModel::Decode(reader, presetTypeFeatures);
225
0
        }
226
227
0
        ReturnErrorOnFailure(err);
228
0
    }
229
0
}
230
231
} // namespace PresetTypeStruct
232
233
namespace ScheduleTypeStruct {
234
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
235
0
{
236
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
237
0
    encoder.Encode(to_underlying(Fields::kSystemMode), systemMode);
238
0
    encoder.Encode(to_underlying(Fields::kNumberOfSchedules), numberOfSchedules);
239
0
    encoder.Encode(to_underlying(Fields::kScheduleTypeFeatures), scheduleTypeFeatures);
240
0
    return encoder.Finalize();
241
0
}
242
243
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
244
0
{
245
0
    detail::StructDecodeIterator __iterator(reader);
246
0
    while (true)
247
0
    {
248
0
        uint8_t __context_tag = 0;
249
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
250
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
251
0
        ReturnErrorOnFailure(err);
252
253
0
        if (__context_tag == to_underlying(Fields::kSystemMode))
254
0
        {
255
0
            err = DataModel::Decode(reader, systemMode);
256
0
        }
257
0
        else if (__context_tag == to_underlying(Fields::kNumberOfSchedules))
258
0
        {
259
0
            err = DataModel::Decode(reader, numberOfSchedules);
260
0
        }
261
0
        else if (__context_tag == to_underlying(Fields::kScheduleTypeFeatures))
262
0
        {
263
0
            err = DataModel::Decode(reader, scheduleTypeFeatures);
264
0
        }
265
266
0
        ReturnErrorOnFailure(err);
267
0
    }
268
0
}
269
270
} // namespace ScheduleTypeStruct
271
272
namespace SensorScheduleTransitionStruct {
273
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
274
0
{
275
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
276
0
    encoder.Encode(to_underlying(Fields::kDayOfWeek), dayOfWeek);
277
0
    encoder.Encode(to_underlying(Fields::kTransitionTime), transitionTime);
278
0
    encoder.Encode(to_underlying(Fields::kEnabledSensorHandles), enabledSensorHandles);
279
0
    return encoder.Finalize();
280
0
}
281
282
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
283
0
{
284
0
    detail::StructDecodeIterator __iterator(reader);
285
0
    while (true)
286
0
    {
287
0
        uint8_t __context_tag = 0;
288
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
289
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
290
0
        ReturnErrorOnFailure(err);
291
292
0
        if (__context_tag == to_underlying(Fields::kDayOfWeek))
293
0
        {
294
0
            err = DataModel::Decode(reader, dayOfWeek);
295
0
        }
296
0
        else if (__context_tag == to_underlying(Fields::kTransitionTime))
297
0
        {
298
0
            err = DataModel::Decode(reader, transitionTime);
299
0
        }
300
0
        else if (__context_tag == to_underlying(Fields::kEnabledSensorHandles))
301
0
        {
302
0
            err = DataModel::Decode(reader, enabledSensorHandles);
303
0
        }
304
305
0
        ReturnErrorOnFailure(err);
306
0
    }
307
0
}
308
309
} // namespace SensorScheduleTransitionStruct
310
311
namespace ThermostatSensorStruct {
312
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
313
0
{
314
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
315
0
    encoder.Encode(to_underlying(Fields::kName), name);
316
0
    encoder.Encode(to_underlying(Fields::kSensorHandle), sensorHandle);
317
0
    encoder.Encode(to_underlying(Fields::kCluster), cluster);
318
0
    encoder.Encode(to_underlying(Fields::kEndpoint), endpoint);
319
0
    encoder.Encode(to_underlying(Fields::kNode), node);
320
0
    encoder.Encode(to_underlying(Fields::kFabricIndex), fabricIndex);
321
0
    return encoder.Finalize();
322
0
}
323
324
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
325
0
{
326
0
    detail::StructDecodeIterator __iterator(reader);
327
0
    while (true)
328
0
    {
329
0
        uint8_t __context_tag = 0;
330
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
331
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
332
0
        ReturnErrorOnFailure(err);
333
334
0
        if (__context_tag == to_underlying(Fields::kName))
335
0
        {
336
0
            err = DataModel::Decode(reader, name);
337
0
        }
338
0
        else if (__context_tag == to_underlying(Fields::kSensorHandle))
339
0
        {
340
0
            err = DataModel::Decode(reader, sensorHandle);
341
0
        }
342
0
        else if (__context_tag == to_underlying(Fields::kCluster))
343
0
        {
344
0
            err = DataModel::Decode(reader, cluster);
345
0
        }
346
0
        else if (__context_tag == to_underlying(Fields::kEndpoint))
347
0
        {
348
0
            err = DataModel::Decode(reader, endpoint);
349
0
        }
350
0
        else if (__context_tag == to_underlying(Fields::kNode))
351
0
        {
352
0
            err = DataModel::Decode(reader, node);
353
0
        }
354
0
        else if (__context_tag == to_underlying(Fields::kFabricIndex))
355
0
        {
356
0
            err = DataModel::Decode(reader, fabricIndex);
357
0
        }
358
359
0
        ReturnErrorOnFailure(err);
360
0
    }
361
0
}
362
363
} // namespace ThermostatSensorStruct
364
365
namespace ThermostatSuggestionStruct {
366
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
367
0
{
368
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
369
0
    encoder.Encode(to_underlying(Fields::kUniqueID), uniqueID);
370
0
    encoder.Encode(to_underlying(Fields::kPresetHandle), presetHandle);
371
0
    encoder.Encode(to_underlying(Fields::kEffectiveTime), effectiveTime);
372
0
    encoder.Encode(to_underlying(Fields::kExpirationTime), expirationTime);
373
0
    return encoder.Finalize();
374
0
}
375
376
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
377
0
{
378
0
    detail::StructDecodeIterator __iterator(reader);
379
0
    while (true)
380
0
    {
381
0
        uint8_t __context_tag = 0;
382
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
383
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
384
0
        ReturnErrorOnFailure(err);
385
386
0
        if (__context_tag == to_underlying(Fields::kUniqueID))
387
0
        {
388
0
            err = DataModel::Decode(reader, uniqueID);
389
0
        }
390
0
        else if (__context_tag == to_underlying(Fields::kPresetHandle))
391
0
        {
392
0
            err = DataModel::Decode(reader, presetHandle);
393
0
        }
394
0
        else if (__context_tag == to_underlying(Fields::kEffectiveTime))
395
0
        {
396
0
            err = DataModel::Decode(reader, effectiveTime);
397
0
        }
398
0
        else if (__context_tag == to_underlying(Fields::kExpirationTime))
399
0
        {
400
0
            err = DataModel::Decode(reader, expirationTime);
401
0
        }
402
403
0
        ReturnErrorOnFailure(err);
404
0
    }
405
0
}
406
407
} // namespace ThermostatSuggestionStruct
408
409
namespace WeeklyScheduleTransitionStruct {
410
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
411
0
{
412
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
413
0
    encoder.Encode(to_underlying(Fields::kTransitionTime), transitionTime);
414
0
    encoder.Encode(to_underlying(Fields::kHeatSetpoint), heatSetpoint);
415
0
    encoder.Encode(to_underlying(Fields::kCoolSetpoint), coolSetpoint);
416
0
    return encoder.Finalize();
417
0
}
418
419
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
420
0
{
421
0
    detail::StructDecodeIterator __iterator(reader);
422
0
    while (true)
423
0
    {
424
0
        uint8_t __context_tag = 0;
425
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
426
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
427
0
        ReturnErrorOnFailure(err);
428
429
0
        if (__context_tag == to_underlying(Fields::kTransitionTime))
430
0
        {
431
0
            err = DataModel::Decode(reader, transitionTime);
432
0
        }
433
0
        else if (__context_tag == to_underlying(Fields::kHeatSetpoint))
434
0
        {
435
0
            err = DataModel::Decode(reader, heatSetpoint);
436
0
        }
437
0
        else if (__context_tag == to_underlying(Fields::kCoolSetpoint))
438
0
        {
439
0
            err = DataModel::Decode(reader, coolSetpoint);
440
0
        }
441
442
0
        ReturnErrorOnFailure(err);
443
0
    }
444
0
}
445
446
} // namespace WeeklyScheduleTransitionStruct
447
} // namespace Structs
448
} // namespace Thermostat
449
} // namespace Clusters
450
} // namespace app
451
} // namespace chip