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