/src/connectedhomeip/zzz_generated/app-common/clusters/Actions/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/Actions/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 Actions { |
31 | | namespace Commands { |
32 | | namespace InstantAction { |
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::kActionID), actionID); |
38 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
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::kActionID)) |
53 | 0 | { |
54 | 0 | err = DataModel::Decode(reader, actionID); |
55 | 0 | } |
56 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
57 | 0 | { |
58 | 0 | err = DataModel::Decode(reader, invokeID); |
59 | 0 | } |
60 | |
|
61 | 0 | ReturnErrorOnFailure(err); |
62 | 0 | } |
63 | 0 | } |
64 | | } // namespace InstantAction. |
65 | | namespace InstantActionWithTransition { |
66 | | |
67 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
68 | 0 | { |
69 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
70 | 0 | encoder.Encode(to_underlying(Fields::kActionID), actionID); |
71 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
72 | 0 | encoder.Encode(to_underlying(Fields::kTransitionTime), transitionTime); |
73 | 0 | return encoder.Finalize(); |
74 | 0 | } |
75 | | |
76 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
77 | 0 | { |
78 | 0 | detail::StructDecodeIterator __iterator(reader); |
79 | 0 | while (true) |
80 | 0 | { |
81 | 0 | uint8_t __context_tag = 0; |
82 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
83 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
84 | 0 | ReturnErrorOnFailure(err); |
85 | | |
86 | 0 | if (__context_tag == to_underlying(Fields::kActionID)) |
87 | 0 | { |
88 | 0 | err = DataModel::Decode(reader, actionID); |
89 | 0 | } |
90 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
91 | 0 | { |
92 | 0 | err = DataModel::Decode(reader, invokeID); |
93 | 0 | } |
94 | 0 | else if (__context_tag == to_underlying(Fields::kTransitionTime)) |
95 | 0 | { |
96 | 0 | err = DataModel::Decode(reader, transitionTime); |
97 | 0 | } |
98 | |
|
99 | 0 | ReturnErrorOnFailure(err); |
100 | 0 | } |
101 | 0 | } |
102 | | } // namespace InstantActionWithTransition. |
103 | | namespace StartAction { |
104 | | |
105 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
106 | 0 | { |
107 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
108 | 0 | encoder.Encode(to_underlying(Fields::kActionID), actionID); |
109 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
110 | 0 | return encoder.Finalize(); |
111 | 0 | } |
112 | | |
113 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
114 | 0 | { |
115 | 0 | detail::StructDecodeIterator __iterator(reader); |
116 | 0 | while (true) |
117 | 0 | { |
118 | 0 | uint8_t __context_tag = 0; |
119 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
120 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
121 | 0 | ReturnErrorOnFailure(err); |
122 | | |
123 | 0 | if (__context_tag == to_underlying(Fields::kActionID)) |
124 | 0 | { |
125 | 0 | err = DataModel::Decode(reader, actionID); |
126 | 0 | } |
127 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
128 | 0 | { |
129 | 0 | err = DataModel::Decode(reader, invokeID); |
130 | 0 | } |
131 | |
|
132 | 0 | ReturnErrorOnFailure(err); |
133 | 0 | } |
134 | 0 | } |
135 | | } // namespace StartAction. |
136 | | namespace StartActionWithDuration { |
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::kActionID), actionID); |
142 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
143 | 0 | encoder.Encode(to_underlying(Fields::kDuration), duration); |
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::kActionID)) |
158 | 0 | { |
159 | 0 | err = DataModel::Decode(reader, actionID); |
160 | 0 | } |
161 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
162 | 0 | { |
163 | 0 | err = DataModel::Decode(reader, invokeID); |
164 | 0 | } |
165 | 0 | else if (__context_tag == to_underlying(Fields::kDuration)) |
166 | 0 | { |
167 | 0 | err = DataModel::Decode(reader, duration); |
168 | 0 | } |
169 | |
|
170 | 0 | ReturnErrorOnFailure(err); |
171 | 0 | } |
172 | 0 | } |
173 | | } // namespace StartActionWithDuration. |
174 | | namespace StopAction { |
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::kActionID), actionID); |
180 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
181 | 0 | return encoder.Finalize(); |
182 | 0 | } |
183 | | |
184 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
185 | 0 | { |
186 | 0 | detail::StructDecodeIterator __iterator(reader); |
187 | 0 | while (true) |
188 | 0 | { |
189 | 0 | uint8_t __context_tag = 0; |
190 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
191 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
192 | 0 | ReturnErrorOnFailure(err); |
193 | | |
194 | 0 | if (__context_tag == to_underlying(Fields::kActionID)) |
195 | 0 | { |
196 | 0 | err = DataModel::Decode(reader, actionID); |
197 | 0 | } |
198 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
199 | 0 | { |
200 | 0 | err = DataModel::Decode(reader, invokeID); |
201 | 0 | } |
202 | |
|
203 | 0 | ReturnErrorOnFailure(err); |
204 | 0 | } |
205 | 0 | } |
206 | | } // namespace StopAction. |
207 | | namespace PauseAction { |
208 | | |
209 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
210 | 0 | { |
211 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
212 | 0 | encoder.Encode(to_underlying(Fields::kActionID), actionID); |
213 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
214 | 0 | return encoder.Finalize(); |
215 | 0 | } |
216 | | |
217 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
218 | 0 | { |
219 | 0 | detail::StructDecodeIterator __iterator(reader); |
220 | 0 | while (true) |
221 | 0 | { |
222 | 0 | uint8_t __context_tag = 0; |
223 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
224 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
225 | 0 | ReturnErrorOnFailure(err); |
226 | | |
227 | 0 | if (__context_tag == to_underlying(Fields::kActionID)) |
228 | 0 | { |
229 | 0 | err = DataModel::Decode(reader, actionID); |
230 | 0 | } |
231 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
232 | 0 | { |
233 | 0 | err = DataModel::Decode(reader, invokeID); |
234 | 0 | } |
235 | |
|
236 | 0 | ReturnErrorOnFailure(err); |
237 | 0 | } |
238 | 0 | } |
239 | | } // namespace PauseAction. |
240 | | namespace PauseActionWithDuration { |
241 | | |
242 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
243 | 0 | { |
244 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
245 | 0 | encoder.Encode(to_underlying(Fields::kActionID), actionID); |
246 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
247 | 0 | encoder.Encode(to_underlying(Fields::kDuration), duration); |
248 | 0 | return encoder.Finalize(); |
249 | 0 | } |
250 | | |
251 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
252 | 0 | { |
253 | 0 | detail::StructDecodeIterator __iterator(reader); |
254 | 0 | while (true) |
255 | 0 | { |
256 | 0 | uint8_t __context_tag = 0; |
257 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
258 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
259 | 0 | ReturnErrorOnFailure(err); |
260 | | |
261 | 0 | if (__context_tag == to_underlying(Fields::kActionID)) |
262 | 0 | { |
263 | 0 | err = DataModel::Decode(reader, actionID); |
264 | 0 | } |
265 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
266 | 0 | { |
267 | 0 | err = DataModel::Decode(reader, invokeID); |
268 | 0 | } |
269 | 0 | else if (__context_tag == to_underlying(Fields::kDuration)) |
270 | 0 | { |
271 | 0 | err = DataModel::Decode(reader, duration); |
272 | 0 | } |
273 | |
|
274 | 0 | ReturnErrorOnFailure(err); |
275 | 0 | } |
276 | 0 | } |
277 | | } // namespace PauseActionWithDuration. |
278 | | namespace ResumeAction { |
279 | | |
280 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
281 | 0 | { |
282 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
283 | 0 | encoder.Encode(to_underlying(Fields::kActionID), actionID); |
284 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
285 | 0 | return encoder.Finalize(); |
286 | 0 | } |
287 | | |
288 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
289 | 0 | { |
290 | 0 | detail::StructDecodeIterator __iterator(reader); |
291 | 0 | while (true) |
292 | 0 | { |
293 | 0 | uint8_t __context_tag = 0; |
294 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
295 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
296 | 0 | ReturnErrorOnFailure(err); |
297 | | |
298 | 0 | if (__context_tag == to_underlying(Fields::kActionID)) |
299 | 0 | { |
300 | 0 | err = DataModel::Decode(reader, actionID); |
301 | 0 | } |
302 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
303 | 0 | { |
304 | 0 | err = DataModel::Decode(reader, invokeID); |
305 | 0 | } |
306 | |
|
307 | 0 | ReturnErrorOnFailure(err); |
308 | 0 | } |
309 | 0 | } |
310 | | } // namespace ResumeAction. |
311 | | namespace EnableAction { |
312 | | |
313 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
314 | 0 | { |
315 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
316 | 0 | encoder.Encode(to_underlying(Fields::kActionID), actionID); |
317 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
318 | 0 | return encoder.Finalize(); |
319 | 0 | } |
320 | | |
321 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
322 | 0 | { |
323 | 0 | detail::StructDecodeIterator __iterator(reader); |
324 | 0 | while (true) |
325 | 0 | { |
326 | 0 | uint8_t __context_tag = 0; |
327 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
328 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
329 | 0 | ReturnErrorOnFailure(err); |
330 | | |
331 | 0 | if (__context_tag == to_underlying(Fields::kActionID)) |
332 | 0 | { |
333 | 0 | err = DataModel::Decode(reader, actionID); |
334 | 0 | } |
335 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
336 | 0 | { |
337 | 0 | err = DataModel::Decode(reader, invokeID); |
338 | 0 | } |
339 | |
|
340 | 0 | ReturnErrorOnFailure(err); |
341 | 0 | } |
342 | 0 | } |
343 | | } // namespace EnableAction. |
344 | | namespace EnableActionWithDuration { |
345 | | |
346 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
347 | 0 | { |
348 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
349 | 0 | encoder.Encode(to_underlying(Fields::kActionID), actionID); |
350 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
351 | 0 | encoder.Encode(to_underlying(Fields::kDuration), duration); |
352 | 0 | return encoder.Finalize(); |
353 | 0 | } |
354 | | |
355 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
356 | 0 | { |
357 | 0 | detail::StructDecodeIterator __iterator(reader); |
358 | 0 | while (true) |
359 | 0 | { |
360 | 0 | uint8_t __context_tag = 0; |
361 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
362 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
363 | 0 | ReturnErrorOnFailure(err); |
364 | | |
365 | 0 | if (__context_tag == to_underlying(Fields::kActionID)) |
366 | 0 | { |
367 | 0 | err = DataModel::Decode(reader, actionID); |
368 | 0 | } |
369 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
370 | 0 | { |
371 | 0 | err = DataModel::Decode(reader, invokeID); |
372 | 0 | } |
373 | 0 | else if (__context_tag == to_underlying(Fields::kDuration)) |
374 | 0 | { |
375 | 0 | err = DataModel::Decode(reader, duration); |
376 | 0 | } |
377 | |
|
378 | 0 | ReturnErrorOnFailure(err); |
379 | 0 | } |
380 | 0 | } |
381 | | } // namespace EnableActionWithDuration. |
382 | | namespace DisableAction { |
383 | | |
384 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
385 | 0 | { |
386 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
387 | 0 | encoder.Encode(to_underlying(Fields::kActionID), actionID); |
388 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
389 | 0 | return encoder.Finalize(); |
390 | 0 | } |
391 | | |
392 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
393 | 0 | { |
394 | 0 | detail::StructDecodeIterator __iterator(reader); |
395 | 0 | while (true) |
396 | 0 | { |
397 | 0 | uint8_t __context_tag = 0; |
398 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
399 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
400 | 0 | ReturnErrorOnFailure(err); |
401 | | |
402 | 0 | if (__context_tag == to_underlying(Fields::kActionID)) |
403 | 0 | { |
404 | 0 | err = DataModel::Decode(reader, actionID); |
405 | 0 | } |
406 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
407 | 0 | { |
408 | 0 | err = DataModel::Decode(reader, invokeID); |
409 | 0 | } |
410 | |
|
411 | 0 | ReturnErrorOnFailure(err); |
412 | 0 | } |
413 | 0 | } |
414 | | } // namespace DisableAction. |
415 | | namespace DisableActionWithDuration { |
416 | | |
417 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
418 | 0 | { |
419 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
420 | 0 | encoder.Encode(to_underlying(Fields::kActionID), actionID); |
421 | 0 | encoder.Encode(to_underlying(Fields::kInvokeID), invokeID); |
422 | 0 | encoder.Encode(to_underlying(Fields::kDuration), duration); |
423 | 0 | return encoder.Finalize(); |
424 | 0 | } |
425 | | |
426 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
427 | 0 | { |
428 | 0 | detail::StructDecodeIterator __iterator(reader); |
429 | 0 | while (true) |
430 | 0 | { |
431 | 0 | uint8_t __context_tag = 0; |
432 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
433 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
434 | 0 | ReturnErrorOnFailure(err); |
435 | | |
436 | 0 | if (__context_tag == to_underlying(Fields::kActionID)) |
437 | 0 | { |
438 | 0 | err = DataModel::Decode(reader, actionID); |
439 | 0 | } |
440 | 0 | else if (__context_tag == to_underlying(Fields::kInvokeID)) |
441 | 0 | { |
442 | 0 | err = DataModel::Decode(reader, invokeID); |
443 | 0 | } |
444 | 0 | else if (__context_tag == to_underlying(Fields::kDuration)) |
445 | 0 | { |
446 | 0 | err = DataModel::Decode(reader, duration); |
447 | 0 | } |
448 | |
|
449 | 0 | ReturnErrorOnFailure(err); |
450 | 0 | } |
451 | 0 | } |
452 | | } // namespace DisableActionWithDuration. |
453 | | } // namespace Commands |
454 | | } // namespace Actions |
455 | | } // namespace Clusters |
456 | | } // namespace app |
457 | | } // namespace chip |