Coverage Report

Created: 2025-06-20 06:55

/src/connectedhomeip/zzz_generated/app-common/clusters/OtaSoftwareUpdateProvider/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/OtaSoftwareUpdateProvider/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 OtaSoftwareUpdateProvider {
31
namespace Commands {
32
namespace QueryImage {
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::kVendorID), vendorID);
38
0
    encoder.Encode(to_underlying(Fields::kProductID), productID);
39
0
    encoder.Encode(to_underlying(Fields::kSoftwareVersion), softwareVersion);
40
0
    encoder.Encode(to_underlying(Fields::kProtocolsSupported), protocolsSupported);
41
0
    encoder.Encode(to_underlying(Fields::kHardwareVersion), hardwareVersion);
42
0
    encoder.Encode(to_underlying(Fields::kLocation), location);
43
0
    encoder.Encode(to_underlying(Fields::kRequestorCanConsent), requestorCanConsent);
44
0
    encoder.Encode(to_underlying(Fields::kMetadataForProvider), metadataForProvider);
45
0
    return encoder.Finalize();
46
0
}
47
48
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
49
0
{
50
0
    detail::StructDecodeIterator __iterator(reader);
51
0
    while (true)
52
0
    {
53
0
        uint8_t __context_tag = 0;
54
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
55
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
56
0
        ReturnErrorOnFailure(err);
57
58
0
        if (__context_tag == to_underlying(Fields::kVendorID))
59
0
        {
60
0
            err = DataModel::Decode(reader, vendorID);
61
0
        }
62
0
        else if (__context_tag == to_underlying(Fields::kProductID))
63
0
        {
64
0
            err = DataModel::Decode(reader, productID);
65
0
        }
66
0
        else if (__context_tag == to_underlying(Fields::kSoftwareVersion))
67
0
        {
68
0
            err = DataModel::Decode(reader, softwareVersion);
69
0
        }
70
0
        else if (__context_tag == to_underlying(Fields::kProtocolsSupported))
71
0
        {
72
0
            err = DataModel::Decode(reader, protocolsSupported);
73
0
        }
74
0
        else if (__context_tag == to_underlying(Fields::kHardwareVersion))
75
0
        {
76
0
            err = DataModel::Decode(reader, hardwareVersion);
77
0
        }
78
0
        else if (__context_tag == to_underlying(Fields::kLocation))
79
0
        {
80
0
            err = DataModel::Decode(reader, location);
81
0
        }
82
0
        else if (__context_tag == to_underlying(Fields::kRequestorCanConsent))
83
0
        {
84
0
            err = DataModel::Decode(reader, requestorCanConsent);
85
0
        }
86
0
        else if (__context_tag == to_underlying(Fields::kMetadataForProvider))
87
0
        {
88
0
            err = DataModel::Decode(reader, metadataForProvider);
89
0
        }
90
91
0
        ReturnErrorOnFailure(err);
92
0
    }
93
0
}
94
} // namespace QueryImage.
95
namespace QueryImageResponse {
96
97
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
98
0
{
99
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
100
0
    encoder.Encode(to_underlying(Fields::kStatus), status);
101
0
    encoder.Encode(to_underlying(Fields::kDelayedActionTime), delayedActionTime);
102
0
    encoder.Encode(to_underlying(Fields::kImageURI), imageURI);
103
0
    encoder.Encode(to_underlying(Fields::kSoftwareVersion), softwareVersion);
104
0
    encoder.Encode(to_underlying(Fields::kSoftwareVersionString), softwareVersionString);
105
0
    encoder.Encode(to_underlying(Fields::kUpdateToken), updateToken);
106
0
    encoder.Encode(to_underlying(Fields::kUserConsentNeeded), userConsentNeeded);
107
0
    encoder.Encode(to_underlying(Fields::kMetadataForRequestor), metadataForRequestor);
108
0
    return encoder.Finalize();
109
0
}
110
111
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
112
0
{
113
0
    detail::StructDecodeIterator __iterator(reader);
114
0
    while (true)
115
0
    {
116
0
        uint8_t __context_tag = 0;
117
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
118
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
119
0
        ReturnErrorOnFailure(err);
120
121
0
        if (__context_tag == to_underlying(Fields::kStatus))
122
0
        {
123
0
            err = DataModel::Decode(reader, status);
124
0
        }
125
0
        else if (__context_tag == to_underlying(Fields::kDelayedActionTime))
126
0
        {
127
0
            err = DataModel::Decode(reader, delayedActionTime);
128
0
        }
129
0
        else if (__context_tag == to_underlying(Fields::kImageURI))
130
0
        {
131
0
            err = DataModel::Decode(reader, imageURI);
132
0
        }
133
0
        else if (__context_tag == to_underlying(Fields::kSoftwareVersion))
134
0
        {
135
0
            err = DataModel::Decode(reader, softwareVersion);
136
0
        }
137
0
        else if (__context_tag == to_underlying(Fields::kSoftwareVersionString))
138
0
        {
139
0
            err = DataModel::Decode(reader, softwareVersionString);
140
0
        }
141
0
        else if (__context_tag == to_underlying(Fields::kUpdateToken))
142
0
        {
143
0
            err = DataModel::Decode(reader, updateToken);
144
0
        }
145
0
        else if (__context_tag == to_underlying(Fields::kUserConsentNeeded))
146
0
        {
147
0
            err = DataModel::Decode(reader, userConsentNeeded);
148
0
        }
149
0
        else if (__context_tag == to_underlying(Fields::kMetadataForRequestor))
150
0
        {
151
0
            err = DataModel::Decode(reader, metadataForRequestor);
152
0
        }
153
154
0
        ReturnErrorOnFailure(err);
155
0
    }
156
0
}
157
} // namespace QueryImageResponse.
158
namespace ApplyUpdateRequest {
159
160
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
161
0
{
162
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
163
0
    encoder.Encode(to_underlying(Fields::kUpdateToken), updateToken);
164
0
    encoder.Encode(to_underlying(Fields::kNewVersion), newVersion);
165
0
    return encoder.Finalize();
166
0
}
167
168
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
169
0
{
170
0
    detail::StructDecodeIterator __iterator(reader);
171
0
    while (true)
172
0
    {
173
0
        uint8_t __context_tag = 0;
174
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
175
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
176
0
        ReturnErrorOnFailure(err);
177
178
0
        if (__context_tag == to_underlying(Fields::kUpdateToken))
179
0
        {
180
0
            err = DataModel::Decode(reader, updateToken);
181
0
        }
182
0
        else if (__context_tag == to_underlying(Fields::kNewVersion))
183
0
        {
184
0
            err = DataModel::Decode(reader, newVersion);
185
0
        }
186
187
0
        ReturnErrorOnFailure(err);
188
0
    }
189
0
}
190
} // namespace ApplyUpdateRequest.
191
namespace ApplyUpdateResponse {
192
193
CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const
194
0
{
195
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
196
0
    encoder.Encode(to_underlying(Fields::kAction), action);
197
0
    encoder.Encode(to_underlying(Fields::kDelayedActionTime), delayedActionTime);
198
0
    return encoder.Finalize();
199
0
}
200
201
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
202
0
{
203
0
    detail::StructDecodeIterator __iterator(reader);
204
0
    while (true)
205
0
    {
206
0
        uint8_t __context_tag = 0;
207
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
208
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
209
0
        ReturnErrorOnFailure(err);
210
211
0
        if (__context_tag == to_underlying(Fields::kAction))
212
0
        {
213
0
            err = DataModel::Decode(reader, action);
214
0
        }
215
0
        else if (__context_tag == to_underlying(Fields::kDelayedActionTime))
216
0
        {
217
0
            err = DataModel::Decode(reader, delayedActionTime);
218
0
        }
219
220
0
        ReturnErrorOnFailure(err);
221
0
    }
222
0
}
223
} // namespace ApplyUpdateResponse.
224
namespace NotifyUpdateApplied {
225
226
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
227
0
{
228
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
229
0
    encoder.Encode(to_underlying(Fields::kUpdateToken), updateToken);
230
0
    encoder.Encode(to_underlying(Fields::kSoftwareVersion), softwareVersion);
231
0
    return encoder.Finalize();
232
0
}
233
234
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
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::kUpdateToken))
245
0
        {
246
0
            err = DataModel::Decode(reader, updateToken);
247
0
        }
248
0
        else if (__context_tag == to_underlying(Fields::kSoftwareVersion))
249
0
        {
250
0
            err = DataModel::Decode(reader, softwareVersion);
251
0
        }
252
253
0
        ReturnErrorOnFailure(err);
254
0
    }
255
0
}
256
} // namespace NotifyUpdateApplied.
257
} // namespace Commands
258
} // namespace OtaSoftwareUpdateProvider
259
} // namespace Clusters
260
} // namespace app
261
} // namespace chip