/src/connectedhomeip/zzz_generated/app-common/clusters/MediaPlayback/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/MediaPlayback/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 MediaPlayback { |
31 | | namespace Commands { |
32 | | namespace Play { |
33 | | |
34 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
35 | 0 | { |
36 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
37 | 0 | return encoder.Finalize(); |
38 | 0 | } |
39 | | |
40 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
41 | 0 | { |
42 | 0 | detail::StructDecodeIterator __iterator(reader); |
43 | 0 | while (true) |
44 | 0 | { |
45 | 0 | uint8_t __context_tag = 0; |
46 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
47 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
48 | 0 | ReturnErrorOnFailure(err); |
49 | | |
50 | 0 | ReturnErrorOnFailure(err); |
51 | 0 | } |
52 | 0 | } |
53 | | } // namespace Play |
54 | | namespace Pause { |
55 | | |
56 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
57 | 0 | { |
58 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
59 | 0 | return encoder.Finalize(); |
60 | 0 | } |
61 | | |
62 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
63 | 0 | { |
64 | 0 | detail::StructDecodeIterator __iterator(reader); |
65 | 0 | while (true) |
66 | 0 | { |
67 | 0 | uint8_t __context_tag = 0; |
68 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
69 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
70 | 0 | ReturnErrorOnFailure(err); |
71 | | |
72 | 0 | ReturnErrorOnFailure(err); |
73 | 0 | } |
74 | 0 | } |
75 | | } // namespace Pause |
76 | | namespace Stop { |
77 | | |
78 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
79 | 0 | { |
80 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
81 | 0 | return encoder.Finalize(); |
82 | 0 | } |
83 | | |
84 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
85 | 0 | { |
86 | 0 | detail::StructDecodeIterator __iterator(reader); |
87 | 0 | while (true) |
88 | 0 | { |
89 | 0 | uint8_t __context_tag = 0; |
90 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
91 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
92 | 0 | ReturnErrorOnFailure(err); |
93 | | |
94 | 0 | ReturnErrorOnFailure(err); |
95 | 0 | } |
96 | 0 | } |
97 | | } // namespace Stop |
98 | | namespace StartOver { |
99 | | |
100 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
101 | 0 | { |
102 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
103 | 0 | return encoder.Finalize(); |
104 | 0 | } |
105 | | |
106 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
107 | 0 | { |
108 | 0 | detail::StructDecodeIterator __iterator(reader); |
109 | 0 | while (true) |
110 | 0 | { |
111 | 0 | uint8_t __context_tag = 0; |
112 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
113 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
114 | 0 | ReturnErrorOnFailure(err); |
115 | | |
116 | 0 | ReturnErrorOnFailure(err); |
117 | 0 | } |
118 | 0 | } |
119 | | } // namespace StartOver |
120 | | namespace Previous { |
121 | | |
122 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
123 | 0 | { |
124 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
125 | 0 | return encoder.Finalize(); |
126 | 0 | } |
127 | | |
128 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
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 | ReturnErrorOnFailure(err); |
139 | 0 | } |
140 | 0 | } |
141 | | } // namespace Previous |
142 | | namespace Next { |
143 | | |
144 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
145 | 0 | { |
146 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
147 | 0 | return encoder.Finalize(); |
148 | 0 | } |
149 | | |
150 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
151 | 0 | { |
152 | 0 | detail::StructDecodeIterator __iterator(reader); |
153 | 0 | while (true) |
154 | 0 | { |
155 | 0 | uint8_t __context_tag = 0; |
156 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
157 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
158 | 0 | ReturnErrorOnFailure(err); |
159 | | |
160 | 0 | ReturnErrorOnFailure(err); |
161 | 0 | } |
162 | 0 | } |
163 | | } // namespace Next |
164 | | namespace Rewind { |
165 | | |
166 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
167 | 0 | { |
168 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
169 | 0 | encoder.Encode(to_underlying(Fields::kAudioAdvanceUnmuted), audioAdvanceUnmuted); |
170 | 0 | return encoder.Finalize(); |
171 | 0 | } |
172 | | |
173 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
174 | 0 | { |
175 | 0 | detail::StructDecodeIterator __iterator(reader); |
176 | 0 | while (true) |
177 | 0 | { |
178 | 0 | uint8_t __context_tag = 0; |
179 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
180 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
181 | 0 | ReturnErrorOnFailure(err); |
182 | | |
183 | 0 | if (__context_tag == to_underlying(Fields::kAudioAdvanceUnmuted)) |
184 | 0 | { |
185 | 0 | err = DataModel::Decode(reader, audioAdvanceUnmuted); |
186 | 0 | } |
187 | |
|
188 | 0 | ReturnErrorOnFailure(err); |
189 | 0 | } |
190 | 0 | } |
191 | | } // namespace Rewind |
192 | | namespace FastForward { |
193 | | |
194 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
195 | 0 | { |
196 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
197 | 0 | encoder.Encode(to_underlying(Fields::kAudioAdvanceUnmuted), audioAdvanceUnmuted); |
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::kAudioAdvanceUnmuted)) |
212 | 0 | { |
213 | 0 | err = DataModel::Decode(reader, audioAdvanceUnmuted); |
214 | 0 | } |
215 | |
|
216 | 0 | ReturnErrorOnFailure(err); |
217 | 0 | } |
218 | 0 | } |
219 | | } // namespace FastForward |
220 | | namespace SkipForward { |
221 | | |
222 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
223 | 0 | { |
224 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
225 | 0 | encoder.Encode(to_underlying(Fields::kDeltaPositionMilliseconds), deltaPositionMilliseconds); |
226 | 0 | return encoder.Finalize(); |
227 | 0 | } |
228 | | |
229 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
230 | 0 | { |
231 | 0 | detail::StructDecodeIterator __iterator(reader); |
232 | 0 | while (true) |
233 | 0 | { |
234 | 0 | uint8_t __context_tag = 0; |
235 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
236 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
237 | 0 | ReturnErrorOnFailure(err); |
238 | | |
239 | 0 | if (__context_tag == to_underlying(Fields::kDeltaPositionMilliseconds)) |
240 | 0 | { |
241 | 0 | err = DataModel::Decode(reader, deltaPositionMilliseconds); |
242 | 0 | } |
243 | |
|
244 | 0 | ReturnErrorOnFailure(err); |
245 | 0 | } |
246 | 0 | } |
247 | | } // namespace SkipForward |
248 | | namespace SkipBackward { |
249 | | |
250 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
251 | 0 | { |
252 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
253 | 0 | encoder.Encode(to_underlying(Fields::kDeltaPositionMilliseconds), deltaPositionMilliseconds); |
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::kDeltaPositionMilliseconds)) |
268 | 0 | { |
269 | 0 | err = DataModel::Decode(reader, deltaPositionMilliseconds); |
270 | 0 | } |
271 | |
|
272 | 0 | ReturnErrorOnFailure(err); |
273 | 0 | } |
274 | 0 | } |
275 | | } // namespace SkipBackward |
276 | | namespace PlaybackResponse { |
277 | | |
278 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
279 | 0 | { |
280 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
281 | 0 | encoder.Encode(to_underlying(Fields::kStatus), status); |
282 | 0 | encoder.Encode(to_underlying(Fields::kData), data); |
283 | 0 | return encoder.Finalize(); |
284 | 0 | } |
285 | | |
286 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
287 | 0 | { |
288 | 0 | detail::StructDecodeIterator __iterator(reader); |
289 | 0 | while (true) |
290 | 0 | { |
291 | 0 | uint8_t __context_tag = 0; |
292 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
293 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
294 | 0 | ReturnErrorOnFailure(err); |
295 | | |
296 | 0 | if (__context_tag == to_underlying(Fields::kStatus)) |
297 | 0 | { |
298 | 0 | err = DataModel::Decode(reader, status); |
299 | 0 | } |
300 | 0 | else if (__context_tag == to_underlying(Fields::kData)) |
301 | 0 | { |
302 | 0 | err = DataModel::Decode(reader, data); |
303 | 0 | } |
304 | |
|
305 | 0 | ReturnErrorOnFailure(err); |
306 | 0 | } |
307 | 0 | } |
308 | | } // namespace PlaybackResponse |
309 | | namespace Seek { |
310 | | |
311 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
312 | 0 | { |
313 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
314 | 0 | encoder.Encode(to_underlying(Fields::kPosition), position); |
315 | 0 | return encoder.Finalize(); |
316 | 0 | } |
317 | | |
318 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
319 | 0 | { |
320 | 0 | detail::StructDecodeIterator __iterator(reader); |
321 | 0 | while (true) |
322 | 0 | { |
323 | 0 | uint8_t __context_tag = 0; |
324 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
325 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
326 | 0 | ReturnErrorOnFailure(err); |
327 | | |
328 | 0 | if (__context_tag == to_underlying(Fields::kPosition)) |
329 | 0 | { |
330 | 0 | err = DataModel::Decode(reader, position); |
331 | 0 | } |
332 | |
|
333 | 0 | ReturnErrorOnFailure(err); |
334 | 0 | } |
335 | 0 | } |
336 | | } // namespace Seek |
337 | | namespace ActivateAudioTrack { |
338 | | |
339 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
340 | 0 | { |
341 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
342 | 0 | encoder.Encode(to_underlying(Fields::kTrackID), trackID); |
343 | 0 | encoder.Encode(to_underlying(Fields::kAudioOutputIndex), audioOutputIndex); |
344 | 0 | return encoder.Finalize(); |
345 | 0 | } |
346 | | |
347 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
348 | 0 | { |
349 | 0 | detail::StructDecodeIterator __iterator(reader); |
350 | 0 | while (true) |
351 | 0 | { |
352 | 0 | uint8_t __context_tag = 0; |
353 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
354 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
355 | 0 | ReturnErrorOnFailure(err); |
356 | | |
357 | 0 | if (__context_tag == to_underlying(Fields::kTrackID)) |
358 | 0 | { |
359 | 0 | err = DataModel::Decode(reader, trackID); |
360 | 0 | } |
361 | 0 | else if (__context_tag == to_underlying(Fields::kAudioOutputIndex)) |
362 | 0 | { |
363 | 0 | err = DataModel::Decode(reader, audioOutputIndex); |
364 | 0 | } |
365 | |
|
366 | 0 | ReturnErrorOnFailure(err); |
367 | 0 | } |
368 | 0 | } |
369 | | } // namespace ActivateAudioTrack |
370 | | namespace ActivateTextTrack { |
371 | | |
372 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
373 | 0 | { |
374 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
375 | 0 | encoder.Encode(to_underlying(Fields::kTrackID), trackID); |
376 | 0 | return encoder.Finalize(); |
377 | 0 | } |
378 | | |
379 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
380 | 0 | { |
381 | 0 | detail::StructDecodeIterator __iterator(reader); |
382 | 0 | while (true) |
383 | 0 | { |
384 | 0 | uint8_t __context_tag = 0; |
385 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
386 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
387 | 0 | ReturnErrorOnFailure(err); |
388 | | |
389 | 0 | if (__context_tag == to_underlying(Fields::kTrackID)) |
390 | 0 | { |
391 | 0 | err = DataModel::Decode(reader, trackID); |
392 | 0 | } |
393 | |
|
394 | 0 | ReturnErrorOnFailure(err); |
395 | 0 | } |
396 | 0 | } |
397 | | } // namespace ActivateTextTrack |
398 | | namespace DeactivateTextTrack { |
399 | | |
400 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
401 | 0 | { |
402 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
403 | 0 | return encoder.Finalize(); |
404 | 0 | } |
405 | | |
406 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
407 | 0 | { |
408 | 0 | detail::StructDecodeIterator __iterator(reader); |
409 | 0 | while (true) |
410 | 0 | { |
411 | 0 | uint8_t __context_tag = 0; |
412 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
413 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
414 | 0 | ReturnErrorOnFailure(err); |
415 | | |
416 | 0 | ReturnErrorOnFailure(err); |
417 | 0 | } |
418 | 0 | } |
419 | | } // namespace DeactivateTextTrack |
420 | | } // namespace Commands |
421 | | } // namespace MediaPlayback |
422 | | } // namespace Clusters |
423 | | } // namespace app |
424 | | } // namespace chip |