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/MediaFileManagement/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/MediaFileManagement/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 MediaFileManagement {
31
namespace Commands {
32
namespace AddFile {
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::kName), name);
38
0
    encoder.Encode(to_underlying(Fields::kSize), size);
39
0
    encoder.Encode(to_underlying(Fields::kMimeType), mimeType);
40
0
    encoder.Encode(to_underlying(Fields::kImageUri), imageUri);
41
0
    return encoder.Finalize();
42
0
}
43
44
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
45
0
{
46
0
    detail::StructDecodeIterator __iterator(reader);
47
0
    while (true)
48
0
    {
49
0
        uint8_t __context_tag = 0;
50
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
51
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
52
0
        ReturnErrorOnFailure(err);
53
54
0
        if (__context_tag == to_underlying(Fields::kName))
55
0
        {
56
0
            err = DataModel::Decode(reader, name);
57
0
        }
58
0
        else if (__context_tag == to_underlying(Fields::kSize))
59
0
        {
60
0
            err = DataModel::Decode(reader, size);
61
0
        }
62
0
        else if (__context_tag == to_underlying(Fields::kMimeType))
63
0
        {
64
0
            err = DataModel::Decode(reader, mimeType);
65
0
        }
66
0
        else if (__context_tag == to_underlying(Fields::kImageUri))
67
0
        {
68
0
            err = DataModel::Decode(reader, imageUri);
69
0
        }
70
71
0
        ReturnErrorOnFailure(err);
72
0
    }
73
0
}
74
} // namespace AddFile
75
namespace AddFileResponse {
76
77
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
78
0
{
79
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
80
0
    encoder.Encode(to_underlying(Fields::kStatus), status);
81
0
    encoder.Encode(to_underlying(Fields::kFileID), fileID);
82
0
    return encoder.Finalize();
83
0
}
84
85
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
86
0
{
87
0
    detail::StructDecodeIterator __iterator(reader);
88
0
    while (true)
89
0
    {
90
0
        uint8_t __context_tag = 0;
91
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
92
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
93
0
        ReturnErrorOnFailure(err);
94
95
0
        if (__context_tag == to_underlying(Fields::kStatus))
96
0
        {
97
0
            err = DataModel::Decode(reader, status);
98
0
        }
99
0
        else if (__context_tag == to_underlying(Fields::kFileID))
100
0
        {
101
0
            err = DataModel::Decode(reader, fileID);
102
0
        }
103
104
0
        ReturnErrorOnFailure(err);
105
0
    }
106
0
}
107
} // namespace AddFileResponse
108
namespace DeleteFile {
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::kFileID), fileID);
114
0
    return encoder.Finalize();
115
0
}
116
117
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
118
0
{
119
0
    detail::StructDecodeIterator __iterator(reader);
120
0
    while (true)
121
0
    {
122
0
        uint8_t __context_tag = 0;
123
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
124
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
125
0
        ReturnErrorOnFailure(err);
126
127
0
        if (__context_tag == to_underlying(Fields::kFileID))
128
0
        {
129
0
            err = DataModel::Decode(reader, fileID);
130
0
        }
131
132
0
        ReturnErrorOnFailure(err);
133
0
    }
134
0
}
135
} // namespace DeleteFile
136
namespace RequestSharedFiles {
137
138
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
139
0
{
140
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
141
0
    encoder.Encode(to_underlying(Fields::kClientName), clientName);
142
0
    encoder.Encode(to_underlying(Fields::kRequestID), requestID);
143
0
    encoder.Encode(to_underlying(Fields::kSupportedMimeTypes), supportedMimeTypes);
144
0
    return encoder.Finalize();
145
0
}
146
147
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
148
0
{
149
0
    detail::StructDecodeIterator __iterator(reader);
150
0
    while (true)
151
0
    {
152
0
        uint8_t __context_tag = 0;
153
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
154
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
155
0
        ReturnErrorOnFailure(err);
156
157
0
        if (__context_tag == to_underlying(Fields::kClientName))
158
0
        {
159
0
            err = DataModel::Decode(reader, clientName);
160
0
        }
161
0
        else if (__context_tag == to_underlying(Fields::kRequestID))
162
0
        {
163
0
            err = DataModel::Decode(reader, requestID);
164
0
        }
165
0
        else if (__context_tag == to_underlying(Fields::kSupportedMimeTypes))
166
0
        {
167
0
            err = DataModel::Decode(reader, supportedMimeTypes);
168
0
        }
169
170
0
        ReturnErrorOnFailure(err);
171
0
    }
172
0
}
173
} // namespace RequestSharedFiles
174
namespace GetSharedFile {
175
176
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
177
0
{
178
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
179
0
    encoder.Encode(to_underlying(Fields::kResponseID), responseID);
180
0
    return encoder.Finalize();
181
0
}
182
183
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
184
0
{
185
0
    detail::StructDecodeIterator __iterator(reader);
186
0
    while (true)
187
0
    {
188
0
        uint8_t __context_tag = 0;
189
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
190
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
191
0
        ReturnErrorOnFailure(err);
192
193
0
        if (__context_tag == to_underlying(Fields::kResponseID))
194
0
        {
195
0
            err = DataModel::Decode(reader, responseID);
196
0
        }
197
198
0
        ReturnErrorOnFailure(err);
199
0
    }
200
0
}
201
} // namespace GetSharedFile
202
namespace GetSharedFileResponse {
203
204
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
205
0
{
206
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
207
0
    encoder.Encode(to_underlying(Fields::kStatus), status);
208
0
    encoder.Encode(to_underlying(Fields::kFileDescription), fileDescription);
209
0
    return encoder.Finalize();
210
0
}
211
212
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
213
0
{
214
0
    detail::StructDecodeIterator __iterator(reader);
215
0
    while (true)
216
0
    {
217
0
        uint8_t __context_tag = 0;
218
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
219
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
220
0
        ReturnErrorOnFailure(err);
221
222
0
        if (__context_tag == to_underlying(Fields::kStatus))
223
0
        {
224
0
            err = DataModel::Decode(reader, status);
225
0
        }
226
0
        else if (__context_tag == to_underlying(Fields::kFileDescription))
227
0
        {
228
0
            err = DataModel::Decode(reader, fileDescription);
229
0
        }
230
231
0
        ReturnErrorOnFailure(err);
232
0
    }
233
0
}
234
} // namespace GetSharedFileResponse
235
namespace OfferFile {
236
237
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
238
0
{
239
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
240
0
    encoder.Encode(to_underlying(Fields::kClientName), clientName);
241
0
    encoder.Encode(to_underlying(Fields::kName), name);
242
0
    encoder.Encode(to_underlying(Fields::kSize), size);
243
0
    encoder.Encode(to_underlying(Fields::kMimeType), mimeType);
244
0
    encoder.Encode(to_underlying(Fields::kImageUri), imageUri);
245
0
    return encoder.Finalize();
246
0
}
247
248
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
249
0
{
250
0
    detail::StructDecodeIterator __iterator(reader);
251
0
    while (true)
252
0
    {
253
0
        uint8_t __context_tag = 0;
254
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
255
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
256
0
        ReturnErrorOnFailure(err);
257
258
0
        if (__context_tag == to_underlying(Fields::kClientName))
259
0
        {
260
0
            err = DataModel::Decode(reader, clientName);
261
0
        }
262
0
        else if (__context_tag == to_underlying(Fields::kName))
263
0
        {
264
0
            err = DataModel::Decode(reader, name);
265
0
        }
266
0
        else if (__context_tag == to_underlying(Fields::kSize))
267
0
        {
268
0
            err = DataModel::Decode(reader, size);
269
0
        }
270
0
        else if (__context_tag == to_underlying(Fields::kMimeType))
271
0
        {
272
0
            err = DataModel::Decode(reader, mimeType);
273
0
        }
274
0
        else if (__context_tag == to_underlying(Fields::kImageUri))
275
0
        {
276
0
            err = DataModel::Decode(reader, imageUri);
277
0
        }
278
279
0
        ReturnErrorOnFailure(err);
280
0
    }
281
0
}
282
} // namespace OfferFile
283
} // namespace Commands
284
} // namespace MediaFileManagement
285
} // namespace Clusters
286
} // namespace app
287
} // namespace chip