Coverage Report

Created: 2025-06-24 06:17

/src/connectedhomeip/zzz_generated/app-common/clusters/Thermostat/Commands.ipp
Line
Count
Source (jump to first uncovered line)
1
/*
2
 *
3
 *    Copyright (c) 2022 Project CHIP Authors
4
 *
5
 *    Licensed under the Apache License, Version 2.0 (the "License");
6
 *    you may not use this file except in compliance with the License.
7
 *    You may obtain a copy of the License at
8
 *
9
 *        http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 *    Unless required by applicable law or agreed to in writing, software
12
 *    distributed under the License is distributed on an "AS IS" BASIS,
13
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 *    See the License for the specific language governing permissions and
15
 *    limitations under the License.
16
 */
17
18
// THIS FILE IS GENERATED BY ZAP
19
// This file is generated from clusters-Commands.ipp.zapt
20
21
#include <clusters/Thermostat/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 Thermostat {
31
namespace Commands {
32
namespace SetpointRaiseLower {
33
34
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
35
0
{
36
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
37
0
    encoder.Encode(to_underlying(Fields::kMode), mode);
38
0
    encoder.Encode(to_underlying(Fields::kAmount), amount);
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::kMode))
53
0
        {
54
0
            err = DataModel::Decode(reader, mode);
55
0
        }
56
0
        else if (__context_tag == to_underlying(Fields::kAmount))
57
0
        {
58
0
            err = DataModel::Decode(reader, amount);
59
0
        }
60
61
0
        ReturnErrorOnFailure(err);
62
0
    }
63
0
}
64
} // namespace SetpointRaiseLower.
65
namespace GetWeeklyScheduleResponse {
66
67
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
68
0
{
69
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
70
0
    encoder.Encode(to_underlying(Fields::kNumberOfTransitionsForSequence), numberOfTransitionsForSequence);
71
0
    encoder.Encode(to_underlying(Fields::kDayOfWeekForSequence), dayOfWeekForSequence);
72
0
    encoder.Encode(to_underlying(Fields::kModeForSequence), modeForSequence);
73
0
    encoder.Encode(to_underlying(Fields::kTransitions), transitions);
74
0
    return encoder.Finalize();
75
0
}
76
77
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
78
0
{
79
0
    detail::StructDecodeIterator __iterator(reader);
80
0
    while (true)
81
0
    {
82
0
        uint8_t __context_tag = 0;
83
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
84
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
85
0
        ReturnErrorOnFailure(err);
86
87
0
        if (__context_tag == to_underlying(Fields::kNumberOfTransitionsForSequence))
88
0
        {
89
0
            err = DataModel::Decode(reader, numberOfTransitionsForSequence);
90
0
        }
91
0
        else if (__context_tag == to_underlying(Fields::kDayOfWeekForSequence))
92
0
        {
93
0
            err = DataModel::Decode(reader, dayOfWeekForSequence);
94
0
        }
95
0
        else if (__context_tag == to_underlying(Fields::kModeForSequence))
96
0
        {
97
0
            err = DataModel::Decode(reader, modeForSequence);
98
0
        }
99
0
        else if (__context_tag == to_underlying(Fields::kTransitions))
100
0
        {
101
0
            err = DataModel::Decode(reader, transitions);
102
0
        }
103
104
0
        ReturnErrorOnFailure(err);
105
0
    }
106
0
}
107
} // namespace GetWeeklyScheduleResponse.
108
namespace SetWeeklySchedule {
109
110
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
111
0
{
112
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
113
0
    encoder.Encode(to_underlying(Fields::kNumberOfTransitionsForSequence), numberOfTransitionsForSequence);
114
0
    encoder.Encode(to_underlying(Fields::kDayOfWeekForSequence), dayOfWeekForSequence);
115
0
    encoder.Encode(to_underlying(Fields::kModeForSequence), modeForSequence);
116
0
    encoder.Encode(to_underlying(Fields::kTransitions), transitions);
117
0
    return encoder.Finalize();
118
0
}
119
120
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
121
0
{
122
0
    detail::StructDecodeIterator __iterator(reader);
123
0
    while (true)
124
0
    {
125
0
        uint8_t __context_tag = 0;
126
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
127
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
128
0
        ReturnErrorOnFailure(err);
129
130
0
        if (__context_tag == to_underlying(Fields::kNumberOfTransitionsForSequence))
131
0
        {
132
0
            err = DataModel::Decode(reader, numberOfTransitionsForSequence);
133
0
        }
134
0
        else if (__context_tag == to_underlying(Fields::kDayOfWeekForSequence))
135
0
        {
136
0
            err = DataModel::Decode(reader, dayOfWeekForSequence);
137
0
        }
138
0
        else if (__context_tag == to_underlying(Fields::kModeForSequence))
139
0
        {
140
0
            err = DataModel::Decode(reader, modeForSequence);
141
0
        }
142
0
        else if (__context_tag == to_underlying(Fields::kTransitions))
143
0
        {
144
0
            err = DataModel::Decode(reader, transitions);
145
0
        }
146
147
0
        ReturnErrorOnFailure(err);
148
0
    }
149
0
}
150
} // namespace SetWeeklySchedule.
151
namespace GetWeeklySchedule {
152
153
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
154
0
{
155
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
156
0
    encoder.Encode(to_underlying(Fields::kDaysToReturn), daysToReturn);
157
0
    encoder.Encode(to_underlying(Fields::kModeToReturn), modeToReturn);
158
0
    return encoder.Finalize();
159
0
}
160
161
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
162
0
{
163
0
    detail::StructDecodeIterator __iterator(reader);
164
0
    while (true)
165
0
    {
166
0
        uint8_t __context_tag = 0;
167
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
168
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
169
0
        ReturnErrorOnFailure(err);
170
171
0
        if (__context_tag == to_underlying(Fields::kDaysToReturn))
172
0
        {
173
0
            err = DataModel::Decode(reader, daysToReturn);
174
0
        }
175
0
        else if (__context_tag == to_underlying(Fields::kModeToReturn))
176
0
        {
177
0
            err = DataModel::Decode(reader, modeToReturn);
178
0
        }
179
180
0
        ReturnErrorOnFailure(err);
181
0
    }
182
0
}
183
} // namespace GetWeeklySchedule.
184
namespace ClearWeeklySchedule {
185
186
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
187
0
{
188
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
189
0
    return encoder.Finalize();
190
0
}
191
192
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
193
0
{
194
0
    detail::StructDecodeIterator __iterator(reader);
195
0
    while (true)
196
0
    {
197
0
        uint8_t __context_tag = 0;
198
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
199
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
200
0
        ReturnErrorOnFailure(err);
201
202
0
        ReturnErrorOnFailure(err);
203
0
    }
204
0
}
205
} // namespace ClearWeeklySchedule.
206
namespace SetActiveScheduleRequest {
207
208
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
209
0
{
210
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
211
0
    encoder.Encode(to_underlying(Fields::kScheduleHandle), scheduleHandle);
212
0
    return encoder.Finalize();
213
0
}
214
215
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
216
0
{
217
0
    detail::StructDecodeIterator __iterator(reader);
218
0
    while (true)
219
0
    {
220
0
        uint8_t __context_tag = 0;
221
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
222
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
223
0
        ReturnErrorOnFailure(err);
224
225
0
        if (__context_tag == to_underlying(Fields::kScheduleHandle))
226
0
        {
227
0
            err = DataModel::Decode(reader, scheduleHandle);
228
0
        }
229
230
0
        ReturnErrorOnFailure(err);
231
0
    }
232
0
}
233
} // namespace SetActiveScheduleRequest.
234
namespace SetActivePresetRequest {
235
236
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
237
0
{
238
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
239
0
    encoder.Encode(to_underlying(Fields::kPresetHandle), presetHandle);
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::kPresetHandle))
254
0
        {
255
0
            err = DataModel::Decode(reader, presetHandle);
256
0
        }
257
258
0
        ReturnErrorOnFailure(err);
259
0
    }
260
0
}
261
} // namespace SetActivePresetRequest.
262
namespace AtomicResponse {
263
264
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
265
0
{
266
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
267
0
    encoder.Encode(to_underlying(Fields::kStatusCode), statusCode);
268
0
    encoder.Encode(to_underlying(Fields::kAttributeStatus), attributeStatus);
269
0
    encoder.Encode(to_underlying(Fields::kTimeout), timeout);
270
0
    return encoder.Finalize();
271
0
}
272
273
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
274
0
{
275
0
    detail::StructDecodeIterator __iterator(reader);
276
0
    while (true)
277
0
    {
278
0
        uint8_t __context_tag = 0;
279
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
280
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
281
0
        ReturnErrorOnFailure(err);
282
283
0
        if (__context_tag == to_underlying(Fields::kStatusCode))
284
0
        {
285
0
            err = DataModel::Decode(reader, statusCode);
286
0
        }
287
0
        else if (__context_tag == to_underlying(Fields::kAttributeStatus))
288
0
        {
289
0
            err = DataModel::Decode(reader, attributeStatus);
290
0
        }
291
0
        else if (__context_tag == to_underlying(Fields::kTimeout))
292
0
        {
293
0
            err = DataModel::Decode(reader, timeout);
294
0
        }
295
296
0
        ReturnErrorOnFailure(err);
297
0
    }
298
0
}
299
} // namespace AtomicResponse.
300
namespace AtomicRequest {
301
302
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
303
0
{
304
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
305
0
    encoder.Encode(to_underlying(Fields::kRequestType), requestType);
306
0
    encoder.Encode(to_underlying(Fields::kAttributeRequests), attributeRequests);
307
0
    encoder.Encode(to_underlying(Fields::kTimeout), timeout);
308
0
    return encoder.Finalize();
309
0
}
310
311
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
312
0
{
313
0
    detail::StructDecodeIterator __iterator(reader);
314
0
    while (true)
315
0
    {
316
0
        uint8_t __context_tag = 0;
317
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
318
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
319
0
        ReturnErrorOnFailure(err);
320
321
0
        if (__context_tag == to_underlying(Fields::kRequestType))
322
0
        {
323
0
            err = DataModel::Decode(reader, requestType);
324
0
        }
325
0
        else if (__context_tag == to_underlying(Fields::kAttributeRequests))
326
0
        {
327
0
            err = DataModel::Decode(reader, attributeRequests);
328
0
        }
329
0
        else if (__context_tag == to_underlying(Fields::kTimeout))
330
0
        {
331
0
            err = DataModel::Decode(reader, timeout);
332
0
        }
333
334
0
        ReturnErrorOnFailure(err);
335
0
    }
336
0
}
337
} // namespace AtomicRequest.
338
} // namespace Commands
339
} // namespace Thermostat
340
} // namespace Clusters
341
} // namespace app
342
} // namespace chip