Coverage Report

Created: 2025-06-20 06:55

/src/connectedhomeip/zzz_generated/app-common/clusters/Groups/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/Groups/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 Groups {
31
namespace Commands {
32
namespace AddGroup {
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::kGroupID), groupID);
38
0
    encoder.Encode(to_underlying(Fields::kGroupName), groupName);
39
0
    return encoder.Finalize();
40
0
}
41
42
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
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::kGroupID))
53
0
        {
54
0
            err = DataModel::Decode(reader, groupID);
55
0
        }
56
0
        else if (__context_tag == to_underlying(Fields::kGroupName))
57
0
        {
58
0
            err = DataModel::Decode(reader, groupName);
59
0
        }
60
61
0
        ReturnErrorOnFailure(err);
62
0
    }
63
0
}
64
} // namespace AddGroup.
65
namespace AddGroupResponse {
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::kStatus), status);
71
0
    encoder.Encode(to_underlying(Fields::kGroupID), groupID);
72
0
    return encoder.Finalize();
73
0
}
74
75
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
76
0
{
77
0
    detail::StructDecodeIterator __iterator(reader);
78
0
    while (true)
79
0
    {
80
0
        uint8_t __context_tag = 0;
81
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
82
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
83
0
        ReturnErrorOnFailure(err);
84
85
0
        if (__context_tag == to_underlying(Fields::kStatus))
86
0
        {
87
0
            err = DataModel::Decode(reader, status);
88
0
        }
89
0
        else if (__context_tag == to_underlying(Fields::kGroupID))
90
0
        {
91
0
            err = DataModel::Decode(reader, groupID);
92
0
        }
93
94
0
        ReturnErrorOnFailure(err);
95
0
    }
96
0
}
97
} // namespace AddGroupResponse.
98
namespace ViewGroup {
99
100
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
101
0
{
102
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
103
0
    encoder.Encode(to_underlying(Fields::kGroupID), groupID);
104
0
    return encoder.Finalize();
105
0
}
106
107
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
108
0
{
109
0
    detail::StructDecodeIterator __iterator(reader);
110
0
    while (true)
111
0
    {
112
0
        uint8_t __context_tag = 0;
113
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
114
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
115
0
        ReturnErrorOnFailure(err);
116
117
0
        if (__context_tag == to_underlying(Fields::kGroupID))
118
0
        {
119
0
            err = DataModel::Decode(reader, groupID);
120
0
        }
121
122
0
        ReturnErrorOnFailure(err);
123
0
    }
124
0
}
125
} // namespace ViewGroup.
126
namespace ViewGroupResponse {
127
128
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
129
0
{
130
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
131
0
    encoder.Encode(to_underlying(Fields::kStatus), status);
132
0
    encoder.Encode(to_underlying(Fields::kGroupID), groupID);
133
0
    encoder.Encode(to_underlying(Fields::kGroupName), groupName);
134
0
    return encoder.Finalize();
135
0
}
136
137
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
138
0
{
139
0
    detail::StructDecodeIterator __iterator(reader);
140
0
    while (true)
141
0
    {
142
0
        uint8_t __context_tag = 0;
143
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
144
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
145
0
        ReturnErrorOnFailure(err);
146
147
0
        if (__context_tag == to_underlying(Fields::kStatus))
148
0
        {
149
0
            err = DataModel::Decode(reader, status);
150
0
        }
151
0
        else if (__context_tag == to_underlying(Fields::kGroupID))
152
0
        {
153
0
            err = DataModel::Decode(reader, groupID);
154
0
        }
155
0
        else if (__context_tag == to_underlying(Fields::kGroupName))
156
0
        {
157
0
            err = DataModel::Decode(reader, groupName);
158
0
        }
159
160
0
        ReturnErrorOnFailure(err);
161
0
    }
162
0
}
163
} // namespace ViewGroupResponse.
164
namespace GetGroupMembership {
165
166
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
167
0
{
168
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
169
0
    encoder.Encode(to_underlying(Fields::kGroupList), groupList);
170
0
    return encoder.Finalize();
171
0
}
172
173
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
174
0
{
175
0
    detail::StructDecodeIterator __iterator(reader);
176
0
    while (true)
177
0
    {
178
0
        uint8_t __context_tag = 0;
179
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
180
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
181
0
        ReturnErrorOnFailure(err);
182
183
0
        if (__context_tag == to_underlying(Fields::kGroupList))
184
0
        {
185
0
            err = DataModel::Decode(reader, groupList);
186
0
        }
187
188
0
        ReturnErrorOnFailure(err);
189
0
    }
190
0
}
191
} // namespace GetGroupMembership.
192
namespace GetGroupMembershipResponse {
193
194
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
195
0
{
196
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
197
0
    encoder.Encode(to_underlying(Fields::kCapacity), capacity);
198
0
    encoder.Encode(to_underlying(Fields::kGroupList), groupList);
199
0
    return encoder.Finalize();
200
0
}
201
202
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
203
0
{
204
0
    detail::StructDecodeIterator __iterator(reader);
205
0
    while (true)
206
0
    {
207
0
        uint8_t __context_tag = 0;
208
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
209
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
210
0
        ReturnErrorOnFailure(err);
211
212
0
        if (__context_tag == to_underlying(Fields::kCapacity))
213
0
        {
214
0
            err = DataModel::Decode(reader, capacity);
215
0
        }
216
0
        else if (__context_tag == to_underlying(Fields::kGroupList))
217
0
        {
218
0
            err = DataModel::Decode(reader, groupList);
219
0
        }
220
221
0
        ReturnErrorOnFailure(err);
222
0
    }
223
0
}
224
} // namespace GetGroupMembershipResponse.
225
namespace RemoveGroup {
226
227
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
228
0
{
229
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
230
0
    encoder.Encode(to_underlying(Fields::kGroupID), groupID);
231
0
    return encoder.Finalize();
232
0
}
233
234
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
235
0
{
236
0
    detail::StructDecodeIterator __iterator(reader);
237
0
    while (true)
238
0
    {
239
0
        uint8_t __context_tag = 0;
240
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
241
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
242
0
        ReturnErrorOnFailure(err);
243
244
0
        if (__context_tag == to_underlying(Fields::kGroupID))
245
0
        {
246
0
            err = DataModel::Decode(reader, groupID);
247
0
        }
248
249
0
        ReturnErrorOnFailure(err);
250
0
    }
251
0
}
252
} // namespace RemoveGroup.
253
namespace RemoveGroupResponse {
254
255
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
256
0
{
257
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
258
0
    encoder.Encode(to_underlying(Fields::kStatus), status);
259
0
    encoder.Encode(to_underlying(Fields::kGroupID), groupID);
260
0
    return encoder.Finalize();
261
0
}
262
263
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
264
0
{
265
0
    detail::StructDecodeIterator __iterator(reader);
266
0
    while (true)
267
0
    {
268
0
        uint8_t __context_tag = 0;
269
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
270
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
271
0
        ReturnErrorOnFailure(err);
272
273
0
        if (__context_tag == to_underlying(Fields::kStatus))
274
0
        {
275
0
            err = DataModel::Decode(reader, status);
276
0
        }
277
0
        else if (__context_tag == to_underlying(Fields::kGroupID))
278
0
        {
279
0
            err = DataModel::Decode(reader, groupID);
280
0
        }
281
282
0
        ReturnErrorOnFailure(err);
283
0
    }
284
0
}
285
} // namespace RemoveGroupResponse.
286
namespace RemoveAllGroups {
287
288
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
289
0
{
290
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
291
0
    return encoder.Finalize();
292
0
}
293
294
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
295
0
{
296
0
    detail::StructDecodeIterator __iterator(reader);
297
0
    while (true)
298
0
    {
299
0
        uint8_t __context_tag = 0;
300
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
301
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
302
0
        ReturnErrorOnFailure(err);
303
304
0
        ReturnErrorOnFailure(err);
305
0
    }
306
0
}
307
} // namespace RemoveAllGroups.
308
namespace AddGroupIfIdentifying {
309
310
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
311
0
{
312
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
313
0
    encoder.Encode(to_underlying(Fields::kGroupID), groupID);
314
0
    encoder.Encode(to_underlying(Fields::kGroupName), groupName);
315
0
    return encoder.Finalize();
316
0
}
317
318
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex)
319
0
{
320
0
    detail::StructDecodeIterator __iterator(reader);
321
0
    while (true)
322
0
    {
323
0
        uint8_t __context_tag = 0;
324
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
325
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
326
0
        ReturnErrorOnFailure(err);
327
328
0
        if (__context_tag == to_underlying(Fields::kGroupID))
329
0
        {
330
0
            err = DataModel::Decode(reader, groupID);
331
0
        }
332
0
        else if (__context_tag == to_underlying(Fields::kGroupName))
333
0
        {
334
0
            err = DataModel::Decode(reader, groupName);
335
0
        }
336
337
0
        ReturnErrorOnFailure(err);
338
0
    }
339
0
}
340
} // namespace AddGroupIfIdentifying.
341
} // namespace Commands
342
} // namespace Groups
343
} // namespace Clusters
344
} // namespace app
345
} // namespace chip