/src/connectedhomeip/zzz_generated/app-common/clusters/CameraAvSettingsUserLevelManagement/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/CameraAvSettingsUserLevelManagement/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 CameraAvSettingsUserLevelManagement { |
31 | | namespace Commands { |
32 | | namespace MPTZSetPosition { |
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::kPan), pan); |
38 | 0 | encoder.Encode(to_underlying(Fields::kTilt), tilt); |
39 | 0 | encoder.Encode(to_underlying(Fields::kZoom), zoom); |
40 | 0 | return encoder.Finalize(); |
41 | 0 | } |
42 | | |
43 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
44 | 0 | { |
45 | 0 | detail::StructDecodeIterator __iterator(reader); |
46 | 0 | while (true) |
47 | 0 | { |
48 | 0 | uint8_t __context_tag = 0; |
49 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
50 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
51 | 0 | ReturnErrorOnFailure(err); |
52 | | |
53 | 0 | if (__context_tag == to_underlying(Fields::kPan)) |
54 | 0 | { |
55 | 0 | err = DataModel::Decode(reader, pan); |
56 | 0 | } |
57 | 0 | else if (__context_tag == to_underlying(Fields::kTilt)) |
58 | 0 | { |
59 | 0 | err = DataModel::Decode(reader, tilt); |
60 | 0 | } |
61 | 0 | else if (__context_tag == to_underlying(Fields::kZoom)) |
62 | 0 | { |
63 | 0 | err = DataModel::Decode(reader, zoom); |
64 | 0 | } |
65 | |
|
66 | 0 | ReturnErrorOnFailure(err); |
67 | 0 | } |
68 | 0 | } |
69 | | } // namespace MPTZSetPosition. |
70 | | namespace MPTZRelativeMove { |
71 | | |
72 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
73 | 0 | { |
74 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
75 | 0 | encoder.Encode(to_underlying(Fields::kPanDelta), panDelta); |
76 | 0 | encoder.Encode(to_underlying(Fields::kTiltDelta), tiltDelta); |
77 | 0 | encoder.Encode(to_underlying(Fields::kZoomDelta), zoomDelta); |
78 | 0 | return encoder.Finalize(); |
79 | 0 | } |
80 | | |
81 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
82 | 0 | { |
83 | 0 | detail::StructDecodeIterator __iterator(reader); |
84 | 0 | while (true) |
85 | 0 | { |
86 | 0 | uint8_t __context_tag = 0; |
87 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
88 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
89 | 0 | ReturnErrorOnFailure(err); |
90 | | |
91 | 0 | if (__context_tag == to_underlying(Fields::kPanDelta)) |
92 | 0 | { |
93 | 0 | err = DataModel::Decode(reader, panDelta); |
94 | 0 | } |
95 | 0 | else if (__context_tag == to_underlying(Fields::kTiltDelta)) |
96 | 0 | { |
97 | 0 | err = DataModel::Decode(reader, tiltDelta); |
98 | 0 | } |
99 | 0 | else if (__context_tag == to_underlying(Fields::kZoomDelta)) |
100 | 0 | { |
101 | 0 | err = DataModel::Decode(reader, zoomDelta); |
102 | 0 | } |
103 | |
|
104 | 0 | ReturnErrorOnFailure(err); |
105 | 0 | } |
106 | 0 | } |
107 | | } // namespace MPTZRelativeMove. |
108 | | namespace MPTZMoveToPreset { |
109 | | |
110 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
111 | 0 | { |
112 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
113 | 0 | encoder.Encode(to_underlying(Fields::kPresetID), presetID); |
114 | 0 | return encoder.Finalize(); |
115 | 0 | } |
116 | | |
117 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
118 | 0 | { |
119 | 0 | detail::StructDecodeIterator __iterator(reader); |
120 | 0 | while (true) |
121 | 0 | { |
122 | 0 | uint8_t __context_tag = 0; |
123 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
124 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
125 | 0 | ReturnErrorOnFailure(err); |
126 | | |
127 | 0 | if (__context_tag == to_underlying(Fields::kPresetID)) |
128 | 0 | { |
129 | 0 | err = DataModel::Decode(reader, presetID); |
130 | 0 | } |
131 | |
|
132 | 0 | ReturnErrorOnFailure(err); |
133 | 0 | } |
134 | 0 | } |
135 | | } // namespace MPTZMoveToPreset. |
136 | | namespace MPTZSavePreset { |
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::kPresetID), presetID); |
142 | 0 | encoder.Encode(to_underlying(Fields::kName), name); |
143 | 0 | return encoder.Finalize(); |
144 | 0 | } |
145 | | |
146 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
147 | 0 | { |
148 | 0 | detail::StructDecodeIterator __iterator(reader); |
149 | 0 | while (true) |
150 | 0 | { |
151 | 0 | uint8_t __context_tag = 0; |
152 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
153 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
154 | 0 | ReturnErrorOnFailure(err); |
155 | | |
156 | 0 | if (__context_tag == to_underlying(Fields::kPresetID)) |
157 | 0 | { |
158 | 0 | err = DataModel::Decode(reader, presetID); |
159 | 0 | } |
160 | 0 | else if (__context_tag == to_underlying(Fields::kName)) |
161 | 0 | { |
162 | 0 | err = DataModel::Decode(reader, name); |
163 | 0 | } |
164 | |
|
165 | 0 | ReturnErrorOnFailure(err); |
166 | 0 | } |
167 | 0 | } |
168 | | } // namespace MPTZSavePreset. |
169 | | namespace MPTZRemovePreset { |
170 | | |
171 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
172 | 0 | { |
173 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
174 | 0 | encoder.Encode(to_underlying(Fields::kPresetID), presetID); |
175 | 0 | return encoder.Finalize(); |
176 | 0 | } |
177 | | |
178 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
179 | 0 | { |
180 | 0 | detail::StructDecodeIterator __iterator(reader); |
181 | 0 | while (true) |
182 | 0 | { |
183 | 0 | uint8_t __context_tag = 0; |
184 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
185 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
186 | 0 | ReturnErrorOnFailure(err); |
187 | | |
188 | 0 | if (__context_tag == to_underlying(Fields::kPresetID)) |
189 | 0 | { |
190 | 0 | err = DataModel::Decode(reader, presetID); |
191 | 0 | } |
192 | |
|
193 | 0 | ReturnErrorOnFailure(err); |
194 | 0 | } |
195 | 0 | } |
196 | | } // namespace MPTZRemovePreset. |
197 | | namespace DPTZSetViewport { |
198 | | |
199 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
200 | 0 | { |
201 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
202 | 0 | encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); |
203 | 0 | encoder.Encode(to_underlying(Fields::kViewport), viewport); |
204 | 0 | return encoder.Finalize(); |
205 | 0 | } |
206 | | |
207 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
208 | 0 | { |
209 | 0 | detail::StructDecodeIterator __iterator(reader); |
210 | 0 | while (true) |
211 | 0 | { |
212 | 0 | uint8_t __context_tag = 0; |
213 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
214 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
215 | 0 | ReturnErrorOnFailure(err); |
216 | | |
217 | 0 | if (__context_tag == to_underlying(Fields::kVideoStreamID)) |
218 | 0 | { |
219 | 0 | err = DataModel::Decode(reader, videoStreamID); |
220 | 0 | } |
221 | 0 | else if (__context_tag == to_underlying(Fields::kViewport)) |
222 | 0 | { |
223 | 0 | err = DataModel::Decode(reader, viewport); |
224 | 0 | } |
225 | |
|
226 | 0 | ReturnErrorOnFailure(err); |
227 | 0 | } |
228 | 0 | } |
229 | | } // namespace DPTZSetViewport. |
230 | | namespace DPTZRelativeMove { |
231 | | |
232 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
233 | 0 | { |
234 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
235 | 0 | encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); |
236 | 0 | encoder.Encode(to_underlying(Fields::kDeltaX), deltaX); |
237 | 0 | encoder.Encode(to_underlying(Fields::kDeltaY), deltaY); |
238 | 0 | encoder.Encode(to_underlying(Fields::kZoomDelta), zoomDelta); |
239 | 0 | return encoder.Finalize(); |
240 | 0 | } |
241 | | |
242 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
243 | 0 | { |
244 | 0 | detail::StructDecodeIterator __iterator(reader); |
245 | 0 | while (true) |
246 | 0 | { |
247 | 0 | uint8_t __context_tag = 0; |
248 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
249 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
250 | 0 | ReturnErrorOnFailure(err); |
251 | | |
252 | 0 | if (__context_tag == to_underlying(Fields::kVideoStreamID)) |
253 | 0 | { |
254 | 0 | err = DataModel::Decode(reader, videoStreamID); |
255 | 0 | } |
256 | 0 | else if (__context_tag == to_underlying(Fields::kDeltaX)) |
257 | 0 | { |
258 | 0 | err = DataModel::Decode(reader, deltaX); |
259 | 0 | } |
260 | 0 | else if (__context_tag == to_underlying(Fields::kDeltaY)) |
261 | 0 | { |
262 | 0 | err = DataModel::Decode(reader, deltaY); |
263 | 0 | } |
264 | 0 | else if (__context_tag == to_underlying(Fields::kZoomDelta)) |
265 | 0 | { |
266 | 0 | err = DataModel::Decode(reader, zoomDelta); |
267 | 0 | } |
268 | |
|
269 | 0 | ReturnErrorOnFailure(err); |
270 | 0 | } |
271 | 0 | } |
272 | | } // namespace DPTZRelativeMove. |
273 | | } // namespace Commands |
274 | | } // namespace CameraAvSettingsUserLevelManagement |
275 | | } // namespace Clusters |
276 | | } // namespace app |
277 | | } // namespace chip |