/src/connectedhomeip/zzz_generated/app-common/clusters/ScenesManagement/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/ScenesManagement/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 ScenesManagement { |
31 | | namespace Commands { |
32 | | namespace AddScene { |
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::kSceneID), sceneID); |
39 | 0 | encoder.Encode(to_underlying(Fields::kTransitionTime), transitionTime); |
40 | 0 | encoder.Encode(to_underlying(Fields::kSceneName), sceneName); |
41 | 0 | encoder.Encode(to_underlying(Fields::kExtensionFieldSetStructs), extensionFieldSetStructs); |
42 | 0 | return encoder.Finalize(); |
43 | 0 | } |
44 | | |
45 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
46 | 0 | { |
47 | 0 | detail::StructDecodeIterator __iterator(reader); |
48 | 0 | while (true) |
49 | 0 | { |
50 | 0 | uint8_t __context_tag = 0; |
51 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
52 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
53 | 0 | ReturnErrorOnFailure(err); |
54 | | |
55 | 0 | if (__context_tag == to_underlying(Fields::kGroupID)) |
56 | 0 | { |
57 | 0 | err = DataModel::Decode(reader, groupID); |
58 | 0 | } |
59 | 0 | else if (__context_tag == to_underlying(Fields::kSceneID)) |
60 | 0 | { |
61 | 0 | err = DataModel::Decode(reader, sceneID); |
62 | 0 | } |
63 | 0 | else if (__context_tag == to_underlying(Fields::kTransitionTime)) |
64 | 0 | { |
65 | 0 | err = DataModel::Decode(reader, transitionTime); |
66 | 0 | } |
67 | 0 | else if (__context_tag == to_underlying(Fields::kSceneName)) |
68 | 0 | { |
69 | 0 | err = DataModel::Decode(reader, sceneName); |
70 | 0 | } |
71 | 0 | else if (__context_tag == to_underlying(Fields::kExtensionFieldSetStructs)) |
72 | 0 | { |
73 | 0 | err = DataModel::Decode(reader, extensionFieldSetStructs); |
74 | 0 | } |
75 | |
|
76 | 0 | ReturnErrorOnFailure(err); |
77 | 0 | } |
78 | 0 | } |
79 | | } // namespace AddScene |
80 | | namespace AddSceneResponse { |
81 | | |
82 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
83 | 0 | { |
84 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
85 | 0 | encoder.Encode(to_underlying(Fields::kStatus), status); |
86 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
87 | 0 | encoder.Encode(to_underlying(Fields::kSceneID), sceneID); |
88 | 0 | return encoder.Finalize(); |
89 | 0 | } |
90 | | |
91 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
92 | 0 | { |
93 | 0 | detail::StructDecodeIterator __iterator(reader); |
94 | 0 | while (true) |
95 | 0 | { |
96 | 0 | uint8_t __context_tag = 0; |
97 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
98 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
99 | 0 | ReturnErrorOnFailure(err); |
100 | | |
101 | 0 | if (__context_tag == to_underlying(Fields::kStatus)) |
102 | 0 | { |
103 | 0 | err = DataModel::Decode(reader, status); |
104 | 0 | } |
105 | 0 | else if (__context_tag == to_underlying(Fields::kGroupID)) |
106 | 0 | { |
107 | 0 | err = DataModel::Decode(reader, groupID); |
108 | 0 | } |
109 | 0 | else if (__context_tag == to_underlying(Fields::kSceneID)) |
110 | 0 | { |
111 | 0 | err = DataModel::Decode(reader, sceneID); |
112 | 0 | } |
113 | |
|
114 | 0 | ReturnErrorOnFailure(err); |
115 | 0 | } |
116 | 0 | } |
117 | | } // namespace AddSceneResponse |
118 | | namespace ViewScene { |
119 | | |
120 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
121 | 0 | { |
122 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
123 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
124 | 0 | encoder.Encode(to_underlying(Fields::kSceneID), sceneID); |
125 | 0 | return encoder.Finalize(); |
126 | 0 | } |
127 | | |
128 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
129 | 0 | { |
130 | 0 | detail::StructDecodeIterator __iterator(reader); |
131 | 0 | while (true) |
132 | 0 | { |
133 | 0 | uint8_t __context_tag = 0; |
134 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
135 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
136 | 0 | ReturnErrorOnFailure(err); |
137 | | |
138 | 0 | if (__context_tag == to_underlying(Fields::kGroupID)) |
139 | 0 | { |
140 | 0 | err = DataModel::Decode(reader, groupID); |
141 | 0 | } |
142 | 0 | else if (__context_tag == to_underlying(Fields::kSceneID)) |
143 | 0 | { |
144 | 0 | err = DataModel::Decode(reader, sceneID); |
145 | 0 | } |
146 | |
|
147 | 0 | ReturnErrorOnFailure(err); |
148 | 0 | } |
149 | 0 | } |
150 | | } // namespace ViewScene |
151 | | namespace ViewSceneResponse { |
152 | | |
153 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
154 | 0 | { |
155 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
156 | 0 | encoder.Encode(to_underlying(Fields::kStatus), status); |
157 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
158 | 0 | encoder.Encode(to_underlying(Fields::kSceneID), sceneID); |
159 | 0 | encoder.Encode(to_underlying(Fields::kTransitionTime), transitionTime); |
160 | 0 | encoder.Encode(to_underlying(Fields::kSceneName), sceneName); |
161 | 0 | encoder.Encode(to_underlying(Fields::kExtensionFieldSetStructs), extensionFieldSetStructs); |
162 | 0 | return encoder.Finalize(); |
163 | 0 | } |
164 | | |
165 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
166 | 0 | { |
167 | 0 | detail::StructDecodeIterator __iterator(reader); |
168 | 0 | while (true) |
169 | 0 | { |
170 | 0 | uint8_t __context_tag = 0; |
171 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
172 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
173 | 0 | ReturnErrorOnFailure(err); |
174 | | |
175 | 0 | if (__context_tag == to_underlying(Fields::kStatus)) |
176 | 0 | { |
177 | 0 | err = DataModel::Decode(reader, status); |
178 | 0 | } |
179 | 0 | else if (__context_tag == to_underlying(Fields::kGroupID)) |
180 | 0 | { |
181 | 0 | err = DataModel::Decode(reader, groupID); |
182 | 0 | } |
183 | 0 | else if (__context_tag == to_underlying(Fields::kSceneID)) |
184 | 0 | { |
185 | 0 | err = DataModel::Decode(reader, sceneID); |
186 | 0 | } |
187 | 0 | else if (__context_tag == to_underlying(Fields::kTransitionTime)) |
188 | 0 | { |
189 | 0 | err = DataModel::Decode(reader, transitionTime); |
190 | 0 | } |
191 | 0 | else if (__context_tag == to_underlying(Fields::kSceneName)) |
192 | 0 | { |
193 | 0 | err = DataModel::Decode(reader, sceneName); |
194 | 0 | } |
195 | 0 | else if (__context_tag == to_underlying(Fields::kExtensionFieldSetStructs)) |
196 | 0 | { |
197 | 0 | err = DataModel::Decode(reader, extensionFieldSetStructs); |
198 | 0 | } |
199 | |
|
200 | 0 | ReturnErrorOnFailure(err); |
201 | 0 | } |
202 | 0 | } |
203 | | } // namespace ViewSceneResponse |
204 | | namespace RemoveScene { |
205 | | |
206 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
207 | 0 | { |
208 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
209 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
210 | 0 | encoder.Encode(to_underlying(Fields::kSceneID), sceneID); |
211 | 0 | return encoder.Finalize(); |
212 | 0 | } |
213 | | |
214 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
215 | 0 | { |
216 | 0 | detail::StructDecodeIterator __iterator(reader); |
217 | 0 | while (true) |
218 | 0 | { |
219 | 0 | uint8_t __context_tag = 0; |
220 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
221 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
222 | 0 | ReturnErrorOnFailure(err); |
223 | | |
224 | 0 | if (__context_tag == to_underlying(Fields::kGroupID)) |
225 | 0 | { |
226 | 0 | err = DataModel::Decode(reader, groupID); |
227 | 0 | } |
228 | 0 | else if (__context_tag == to_underlying(Fields::kSceneID)) |
229 | 0 | { |
230 | 0 | err = DataModel::Decode(reader, sceneID); |
231 | 0 | } |
232 | |
|
233 | 0 | ReturnErrorOnFailure(err); |
234 | 0 | } |
235 | 0 | } |
236 | | } // namespace RemoveScene |
237 | | namespace RemoveSceneResponse { |
238 | | |
239 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
240 | 0 | { |
241 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
242 | 0 | encoder.Encode(to_underlying(Fields::kStatus), status); |
243 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
244 | 0 | encoder.Encode(to_underlying(Fields::kSceneID), sceneID); |
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::kStatus)) |
259 | 0 | { |
260 | 0 | err = DataModel::Decode(reader, status); |
261 | 0 | } |
262 | 0 | else if (__context_tag == to_underlying(Fields::kGroupID)) |
263 | 0 | { |
264 | 0 | err = DataModel::Decode(reader, groupID); |
265 | 0 | } |
266 | 0 | else if (__context_tag == to_underlying(Fields::kSceneID)) |
267 | 0 | { |
268 | 0 | err = DataModel::Decode(reader, sceneID); |
269 | 0 | } |
270 | |
|
271 | 0 | ReturnErrorOnFailure(err); |
272 | 0 | } |
273 | 0 | } |
274 | | } // namespace RemoveSceneResponse |
275 | | namespace RemoveAllScenes { |
276 | | |
277 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
278 | 0 | { |
279 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
280 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
281 | 0 | return encoder.Finalize(); |
282 | 0 | } |
283 | | |
284 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
285 | 0 | { |
286 | 0 | detail::StructDecodeIterator __iterator(reader); |
287 | 0 | while (true) |
288 | 0 | { |
289 | 0 | uint8_t __context_tag = 0; |
290 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
291 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
292 | 0 | ReturnErrorOnFailure(err); |
293 | | |
294 | 0 | if (__context_tag == to_underlying(Fields::kGroupID)) |
295 | 0 | { |
296 | 0 | err = DataModel::Decode(reader, groupID); |
297 | 0 | } |
298 | |
|
299 | 0 | ReturnErrorOnFailure(err); |
300 | 0 | } |
301 | 0 | } |
302 | | } // namespace RemoveAllScenes |
303 | | namespace RemoveAllScenesResponse { |
304 | | |
305 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
306 | 0 | { |
307 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
308 | 0 | encoder.Encode(to_underlying(Fields::kStatus), status); |
309 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
310 | 0 | return encoder.Finalize(); |
311 | 0 | } |
312 | | |
313 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
314 | 0 | { |
315 | 0 | detail::StructDecodeIterator __iterator(reader); |
316 | 0 | while (true) |
317 | 0 | { |
318 | 0 | uint8_t __context_tag = 0; |
319 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
320 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
321 | 0 | ReturnErrorOnFailure(err); |
322 | | |
323 | 0 | if (__context_tag == to_underlying(Fields::kStatus)) |
324 | 0 | { |
325 | 0 | err = DataModel::Decode(reader, status); |
326 | 0 | } |
327 | 0 | else if (__context_tag == to_underlying(Fields::kGroupID)) |
328 | 0 | { |
329 | 0 | err = DataModel::Decode(reader, groupID); |
330 | 0 | } |
331 | |
|
332 | 0 | ReturnErrorOnFailure(err); |
333 | 0 | } |
334 | 0 | } |
335 | | } // namespace RemoveAllScenesResponse |
336 | | namespace StoreScene { |
337 | | |
338 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
339 | 0 | { |
340 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
341 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
342 | 0 | encoder.Encode(to_underlying(Fields::kSceneID), sceneID); |
343 | 0 | return encoder.Finalize(); |
344 | 0 | } |
345 | | |
346 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
347 | 0 | { |
348 | 0 | detail::StructDecodeIterator __iterator(reader); |
349 | 0 | while (true) |
350 | 0 | { |
351 | 0 | uint8_t __context_tag = 0; |
352 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
353 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
354 | 0 | ReturnErrorOnFailure(err); |
355 | | |
356 | 0 | if (__context_tag == to_underlying(Fields::kGroupID)) |
357 | 0 | { |
358 | 0 | err = DataModel::Decode(reader, groupID); |
359 | 0 | } |
360 | 0 | else if (__context_tag == to_underlying(Fields::kSceneID)) |
361 | 0 | { |
362 | 0 | err = DataModel::Decode(reader, sceneID); |
363 | 0 | } |
364 | |
|
365 | 0 | ReturnErrorOnFailure(err); |
366 | 0 | } |
367 | 0 | } |
368 | | } // namespace StoreScene |
369 | | namespace StoreSceneResponse { |
370 | | |
371 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
372 | 0 | { |
373 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
374 | 0 | encoder.Encode(to_underlying(Fields::kStatus), status); |
375 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
376 | 0 | encoder.Encode(to_underlying(Fields::kSceneID), sceneID); |
377 | 0 | return encoder.Finalize(); |
378 | 0 | } |
379 | | |
380 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
381 | 0 | { |
382 | 0 | detail::StructDecodeIterator __iterator(reader); |
383 | 0 | while (true) |
384 | 0 | { |
385 | 0 | uint8_t __context_tag = 0; |
386 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
387 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
388 | 0 | ReturnErrorOnFailure(err); |
389 | | |
390 | 0 | if (__context_tag == to_underlying(Fields::kStatus)) |
391 | 0 | { |
392 | 0 | err = DataModel::Decode(reader, status); |
393 | 0 | } |
394 | 0 | else if (__context_tag == to_underlying(Fields::kGroupID)) |
395 | 0 | { |
396 | 0 | err = DataModel::Decode(reader, groupID); |
397 | 0 | } |
398 | 0 | else if (__context_tag == to_underlying(Fields::kSceneID)) |
399 | 0 | { |
400 | 0 | err = DataModel::Decode(reader, sceneID); |
401 | 0 | } |
402 | |
|
403 | 0 | ReturnErrorOnFailure(err); |
404 | 0 | } |
405 | 0 | } |
406 | | } // namespace StoreSceneResponse |
407 | | namespace RecallScene { |
408 | | |
409 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
410 | 0 | { |
411 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
412 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
413 | 0 | encoder.Encode(to_underlying(Fields::kSceneID), sceneID); |
414 | 0 | encoder.Encode(to_underlying(Fields::kTransitionTime), transitionTime); |
415 | 0 | return encoder.Finalize(); |
416 | 0 | } |
417 | | |
418 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
419 | 0 | { |
420 | 0 | detail::StructDecodeIterator __iterator(reader); |
421 | 0 | while (true) |
422 | 0 | { |
423 | 0 | uint8_t __context_tag = 0; |
424 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
425 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
426 | 0 | ReturnErrorOnFailure(err); |
427 | | |
428 | 0 | if (__context_tag == to_underlying(Fields::kGroupID)) |
429 | 0 | { |
430 | 0 | err = DataModel::Decode(reader, groupID); |
431 | 0 | } |
432 | 0 | else if (__context_tag == to_underlying(Fields::kSceneID)) |
433 | 0 | { |
434 | 0 | err = DataModel::Decode(reader, sceneID); |
435 | 0 | } |
436 | 0 | else if (__context_tag == to_underlying(Fields::kTransitionTime)) |
437 | 0 | { |
438 | 0 | err = DataModel::Decode(reader, transitionTime); |
439 | 0 | } |
440 | |
|
441 | 0 | ReturnErrorOnFailure(err); |
442 | 0 | } |
443 | 0 | } |
444 | | } // namespace RecallScene |
445 | | namespace GetSceneMembership { |
446 | | |
447 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
448 | 0 | { |
449 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
450 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
451 | 0 | return encoder.Finalize(); |
452 | 0 | } |
453 | | |
454 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
455 | 0 | { |
456 | 0 | detail::StructDecodeIterator __iterator(reader); |
457 | 0 | while (true) |
458 | 0 | { |
459 | 0 | uint8_t __context_tag = 0; |
460 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
461 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
462 | 0 | ReturnErrorOnFailure(err); |
463 | | |
464 | 0 | if (__context_tag == to_underlying(Fields::kGroupID)) |
465 | 0 | { |
466 | 0 | err = DataModel::Decode(reader, groupID); |
467 | 0 | } |
468 | |
|
469 | 0 | ReturnErrorOnFailure(err); |
470 | 0 | } |
471 | 0 | } |
472 | | } // namespace GetSceneMembership |
473 | | namespace GetSceneMembershipResponse { |
474 | | |
475 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
476 | 0 | { |
477 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
478 | 0 | encoder.Encode(to_underlying(Fields::kStatus), status); |
479 | 0 | encoder.Encode(to_underlying(Fields::kCapacity), capacity); |
480 | 0 | encoder.Encode(to_underlying(Fields::kGroupID), groupID); |
481 | 0 | encoder.Encode(to_underlying(Fields::kSceneList), sceneList); |
482 | 0 | return encoder.Finalize(); |
483 | 0 | } |
484 | | |
485 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
486 | 0 | { |
487 | 0 | detail::StructDecodeIterator __iterator(reader); |
488 | 0 | while (true) |
489 | 0 | { |
490 | 0 | uint8_t __context_tag = 0; |
491 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
492 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
493 | 0 | ReturnErrorOnFailure(err); |
494 | | |
495 | 0 | if (__context_tag == to_underlying(Fields::kStatus)) |
496 | 0 | { |
497 | 0 | err = DataModel::Decode(reader, status); |
498 | 0 | } |
499 | 0 | else if (__context_tag == to_underlying(Fields::kCapacity)) |
500 | 0 | { |
501 | 0 | err = DataModel::Decode(reader, capacity); |
502 | 0 | } |
503 | 0 | else if (__context_tag == to_underlying(Fields::kGroupID)) |
504 | 0 | { |
505 | 0 | err = DataModel::Decode(reader, groupID); |
506 | 0 | } |
507 | 0 | else if (__context_tag == to_underlying(Fields::kSceneList)) |
508 | 0 | { |
509 | 0 | err = DataModel::Decode(reader, sceneList); |
510 | 0 | } |
511 | |
|
512 | 0 | ReturnErrorOnFailure(err); |
513 | 0 | } |
514 | 0 | } |
515 | | } // namespace GetSceneMembershipResponse |
516 | | namespace CopyScene { |
517 | | |
518 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
519 | 0 | { |
520 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
521 | 0 | encoder.Encode(to_underlying(Fields::kMode), mode); |
522 | 0 | encoder.Encode(to_underlying(Fields::kGroupIdentifierFrom), groupIdentifierFrom); |
523 | 0 | encoder.Encode(to_underlying(Fields::kSceneIdentifierFrom), sceneIdentifierFrom); |
524 | 0 | encoder.Encode(to_underlying(Fields::kGroupIdentifierTo), groupIdentifierTo); |
525 | 0 | encoder.Encode(to_underlying(Fields::kSceneIdentifierTo), sceneIdentifierTo); |
526 | 0 | return encoder.Finalize(); |
527 | 0 | } |
528 | | |
529 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
530 | 0 | { |
531 | 0 | detail::StructDecodeIterator __iterator(reader); |
532 | 0 | while (true) |
533 | 0 | { |
534 | 0 | uint8_t __context_tag = 0; |
535 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
536 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
537 | 0 | ReturnErrorOnFailure(err); |
538 | | |
539 | 0 | if (__context_tag == to_underlying(Fields::kMode)) |
540 | 0 | { |
541 | 0 | err = DataModel::Decode(reader, mode); |
542 | 0 | } |
543 | 0 | else if (__context_tag == to_underlying(Fields::kGroupIdentifierFrom)) |
544 | 0 | { |
545 | 0 | err = DataModel::Decode(reader, groupIdentifierFrom); |
546 | 0 | } |
547 | 0 | else if (__context_tag == to_underlying(Fields::kSceneIdentifierFrom)) |
548 | 0 | { |
549 | 0 | err = DataModel::Decode(reader, sceneIdentifierFrom); |
550 | 0 | } |
551 | 0 | else if (__context_tag == to_underlying(Fields::kGroupIdentifierTo)) |
552 | 0 | { |
553 | 0 | err = DataModel::Decode(reader, groupIdentifierTo); |
554 | 0 | } |
555 | 0 | else if (__context_tag == to_underlying(Fields::kSceneIdentifierTo)) |
556 | 0 | { |
557 | 0 | err = DataModel::Decode(reader, sceneIdentifierTo); |
558 | 0 | } |
559 | |
|
560 | 0 | ReturnErrorOnFailure(err); |
561 | 0 | } |
562 | 0 | } |
563 | | } // namespace CopyScene |
564 | | namespace CopySceneResponse { |
565 | | |
566 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
567 | 0 | { |
568 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
569 | 0 | encoder.Encode(to_underlying(Fields::kStatus), status); |
570 | 0 | encoder.Encode(to_underlying(Fields::kGroupIdentifierFrom), groupIdentifierFrom); |
571 | 0 | encoder.Encode(to_underlying(Fields::kSceneIdentifierFrom), sceneIdentifierFrom); |
572 | 0 | return encoder.Finalize(); |
573 | 0 | } |
574 | | |
575 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
576 | 0 | { |
577 | 0 | detail::StructDecodeIterator __iterator(reader); |
578 | 0 | while (true) |
579 | 0 | { |
580 | 0 | uint8_t __context_tag = 0; |
581 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
582 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
583 | 0 | ReturnErrorOnFailure(err); |
584 | | |
585 | 0 | if (__context_tag == to_underlying(Fields::kStatus)) |
586 | 0 | { |
587 | 0 | err = DataModel::Decode(reader, status); |
588 | 0 | } |
589 | 0 | else if (__context_tag == to_underlying(Fields::kGroupIdentifierFrom)) |
590 | 0 | { |
591 | 0 | err = DataModel::Decode(reader, groupIdentifierFrom); |
592 | 0 | } |
593 | 0 | else if (__context_tag == to_underlying(Fields::kSceneIdentifierFrom)) |
594 | 0 | { |
595 | 0 | err = DataModel::Decode(reader, sceneIdentifierFrom); |
596 | 0 | } |
597 | |
|
598 | 0 | ReturnErrorOnFailure(err); |
599 | 0 | } |
600 | 0 | } |
601 | | } // namespace CopySceneResponse |
602 | | } // namespace Commands |
603 | | } // namespace ScenesManagement |
604 | | } // namespace Clusters |
605 | | } // namespace app |
606 | | } // namespace chip |