/src/connectedhomeip/zzz_generated/app-common/clusters/CommissioningProxy/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/CommissioningProxy/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 CommissioningProxy { |
31 | | namespace Commands { |
32 | | namespace ProxyConnectRequest { |
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::kAddress), address); |
38 | 0 | encoder.Encode(to_underlying(Fields::kTransport), transport); |
39 | 0 | encoder.Encode(to_underlying(Fields::kDiscriminator), discriminator); |
40 | 0 | encoder.Encode(to_underlying(Fields::kVendorID), vendorID); |
41 | 0 | encoder.Encode(to_underlying(Fields::kProductID), productID); |
42 | 0 | encoder.Encode(to_underlying(Fields::kTimeout), timeout); |
43 | 0 | encoder.Encode(to_underlying(Fields::kWiFiBand), wiFiBand); |
44 | 0 | return encoder.Finalize(); |
45 | 0 | } |
46 | | |
47 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
48 | 0 | { |
49 | 0 | detail::StructDecodeIterator __iterator(reader); |
50 | 0 | while (true) |
51 | 0 | { |
52 | 0 | uint8_t __context_tag = 0; |
53 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
54 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
55 | 0 | ReturnErrorOnFailure(err); |
56 | | |
57 | 0 | if (__context_tag == to_underlying(Fields::kAddress)) |
58 | 0 | { |
59 | 0 | err = DataModel::Decode(reader, address); |
60 | 0 | } |
61 | 0 | else if (__context_tag == to_underlying(Fields::kTransport)) |
62 | 0 | { |
63 | 0 | err = DataModel::Decode(reader, transport); |
64 | 0 | } |
65 | 0 | else if (__context_tag == to_underlying(Fields::kDiscriminator)) |
66 | 0 | { |
67 | 0 | err = DataModel::Decode(reader, discriminator); |
68 | 0 | } |
69 | 0 | else if (__context_tag == to_underlying(Fields::kVendorID)) |
70 | 0 | { |
71 | 0 | err = DataModel::Decode(reader, vendorID); |
72 | 0 | } |
73 | 0 | else if (__context_tag == to_underlying(Fields::kProductID)) |
74 | 0 | { |
75 | 0 | err = DataModel::Decode(reader, productID); |
76 | 0 | } |
77 | 0 | else if (__context_tag == to_underlying(Fields::kTimeout)) |
78 | 0 | { |
79 | 0 | err = DataModel::Decode(reader, timeout); |
80 | 0 | } |
81 | 0 | else if (__context_tag == to_underlying(Fields::kWiFiBand)) |
82 | 0 | { |
83 | 0 | err = DataModel::Decode(reader, wiFiBand); |
84 | 0 | } |
85 | |
|
86 | 0 | ReturnErrorOnFailure(err); |
87 | 0 | } |
88 | 0 | } |
89 | | } // namespace ProxyConnectRequest |
90 | | namespace ProxyConnectResponse { |
91 | | |
92 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
93 | 0 | { |
94 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
95 | 0 | encoder.Encode(to_underlying(Fields::kSessionID), sessionID); |
96 | 0 | return encoder.Finalize(); |
97 | 0 | } |
98 | | |
99 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
100 | 0 | { |
101 | 0 | detail::StructDecodeIterator __iterator(reader); |
102 | 0 | while (true) |
103 | 0 | { |
104 | 0 | uint8_t __context_tag = 0; |
105 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
106 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
107 | 0 | ReturnErrorOnFailure(err); |
108 | | |
109 | 0 | if (__context_tag == to_underlying(Fields::kSessionID)) |
110 | 0 | { |
111 | 0 | err = DataModel::Decode(reader, sessionID); |
112 | 0 | } |
113 | |
|
114 | 0 | ReturnErrorOnFailure(err); |
115 | 0 | } |
116 | 0 | } |
117 | | } // namespace ProxyConnectResponse |
118 | | namespace ProxyDisconnectRequest { |
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::kSessionID), sessionID); |
124 | 0 | return encoder.Finalize(); |
125 | 0 | } |
126 | | |
127 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
128 | 0 | { |
129 | 0 | detail::StructDecodeIterator __iterator(reader); |
130 | 0 | while (true) |
131 | 0 | { |
132 | 0 | uint8_t __context_tag = 0; |
133 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
134 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
135 | 0 | ReturnErrorOnFailure(err); |
136 | | |
137 | 0 | if (__context_tag == to_underlying(Fields::kSessionID)) |
138 | 0 | { |
139 | 0 | err = DataModel::Decode(reader, sessionID); |
140 | 0 | } |
141 | |
|
142 | 0 | ReturnErrorOnFailure(err); |
143 | 0 | } |
144 | 0 | } |
145 | | } // namespace ProxyDisconnectRequest |
146 | | namespace ProxyScanRequest { |
147 | | |
148 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
149 | 0 | { |
150 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
151 | 0 | encoder.Encode(to_underlying(Fields::kTransport), transport); |
152 | 0 | encoder.Encode(to_underlying(Fields::kWiFiBands), wiFiBands); |
153 | 0 | return encoder.Finalize(); |
154 | 0 | } |
155 | | |
156 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
157 | 0 | { |
158 | 0 | detail::StructDecodeIterator __iterator(reader); |
159 | 0 | while (true) |
160 | 0 | { |
161 | 0 | uint8_t __context_tag = 0; |
162 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
163 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
164 | 0 | ReturnErrorOnFailure(err); |
165 | | |
166 | 0 | if (__context_tag == to_underlying(Fields::kTransport)) |
167 | 0 | { |
168 | 0 | err = DataModel::Decode(reader, transport); |
169 | 0 | } |
170 | 0 | else if (__context_tag == to_underlying(Fields::kWiFiBands)) |
171 | 0 | { |
172 | 0 | err = DataModel::Decode(reader, wiFiBands); |
173 | 0 | } |
174 | |
|
175 | 0 | ReturnErrorOnFailure(err); |
176 | 0 | } |
177 | 0 | } |
178 | | } // namespace ProxyScanRequest |
179 | | namespace ProxyScanResponse { |
180 | | |
181 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
182 | 0 | { |
183 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
184 | 0 | encoder.Encode(to_underlying(Fields::kNumberOfResults), numberOfResults); |
185 | 0 | encoder.Encode(to_underlying(Fields::kProxyScanResult), proxyScanResult); |
186 | 0 | return encoder.Finalize(); |
187 | 0 | } |
188 | | |
189 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
190 | 0 | { |
191 | 0 | detail::StructDecodeIterator __iterator(reader); |
192 | 0 | while (true) |
193 | 0 | { |
194 | 0 | uint8_t __context_tag = 0; |
195 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
196 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
197 | 0 | ReturnErrorOnFailure(err); |
198 | | |
199 | 0 | if (__context_tag == to_underlying(Fields::kNumberOfResults)) |
200 | 0 | { |
201 | 0 | err = DataModel::Decode(reader, numberOfResults); |
202 | 0 | } |
203 | 0 | else if (__context_tag == to_underlying(Fields::kProxyScanResult)) |
204 | 0 | { |
205 | 0 | err = DataModel::Decode(reader, proxyScanResult); |
206 | 0 | } |
207 | |
|
208 | 0 | ReturnErrorOnFailure(err); |
209 | 0 | } |
210 | 0 | } |
211 | | } // namespace ProxyScanResponse |
212 | | namespace ProxyBackGroundScanStartRequest { |
213 | | |
214 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
215 | 0 | { |
216 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
217 | 0 | encoder.Encode(to_underlying(Fields::kTransport), transport); |
218 | 0 | encoder.Encode(to_underlying(Fields::kTimeout), timeout); |
219 | 0 | encoder.Encode(to_underlying(Fields::kWiFiBands), wiFiBands); |
220 | 0 | return encoder.Finalize(); |
221 | 0 | } |
222 | | |
223 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
224 | 0 | { |
225 | 0 | detail::StructDecodeIterator __iterator(reader); |
226 | 0 | while (true) |
227 | 0 | { |
228 | 0 | uint8_t __context_tag = 0; |
229 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
230 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
231 | 0 | ReturnErrorOnFailure(err); |
232 | | |
233 | 0 | if (__context_tag == to_underlying(Fields::kTransport)) |
234 | 0 | { |
235 | 0 | err = DataModel::Decode(reader, transport); |
236 | 0 | } |
237 | 0 | else if (__context_tag == to_underlying(Fields::kTimeout)) |
238 | 0 | { |
239 | 0 | err = DataModel::Decode(reader, timeout); |
240 | 0 | } |
241 | 0 | else if (__context_tag == to_underlying(Fields::kWiFiBands)) |
242 | 0 | { |
243 | 0 | err = DataModel::Decode(reader, wiFiBands); |
244 | 0 | } |
245 | |
|
246 | 0 | ReturnErrorOnFailure(err); |
247 | 0 | } |
248 | 0 | } |
249 | | } // namespace ProxyBackGroundScanStartRequest |
250 | | namespace ProxyBackGroundScanStopRequest { |
251 | | |
252 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
253 | 0 | { |
254 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
255 | 0 | encoder.Encode(to_underlying(Fields::kTransport), transport); |
256 | 0 | encoder.Encode(to_underlying(Fields::kWiFiBands), wiFiBands); |
257 | 0 | return encoder.Finalize(); |
258 | 0 | } |
259 | | |
260 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
261 | 0 | { |
262 | 0 | detail::StructDecodeIterator __iterator(reader); |
263 | 0 | while (true) |
264 | 0 | { |
265 | 0 | uint8_t __context_tag = 0; |
266 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
267 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
268 | 0 | ReturnErrorOnFailure(err); |
269 | | |
270 | 0 | if (__context_tag == to_underlying(Fields::kTransport)) |
271 | 0 | { |
272 | 0 | err = DataModel::Decode(reader, transport); |
273 | 0 | } |
274 | 0 | else if (__context_tag == to_underlying(Fields::kWiFiBands)) |
275 | 0 | { |
276 | 0 | err = DataModel::Decode(reader, wiFiBands); |
277 | 0 | } |
278 | |
|
279 | 0 | ReturnErrorOnFailure(err); |
280 | 0 | } |
281 | 0 | } |
282 | | } // namespace ProxyBackGroundScanStopRequest |
283 | | namespace ProxyMessageRequest { |
284 | | |
285 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
286 | 0 | { |
287 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
288 | 0 | encoder.Encode(to_underlying(Fields::kSessionID), sessionID); |
289 | 0 | encoder.Encode(to_underlying(Fields::kResponseTimeout), responseTimeout); |
290 | 0 | encoder.Encode(to_underlying(Fields::kMessage), message); |
291 | 0 | return encoder.Finalize(); |
292 | 0 | } |
293 | | |
294 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
295 | 0 | { |
296 | 0 | detail::StructDecodeIterator __iterator(reader); |
297 | 0 | while (true) |
298 | 0 | { |
299 | 0 | uint8_t __context_tag = 0; |
300 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
301 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
302 | 0 | ReturnErrorOnFailure(err); |
303 | | |
304 | 0 | if (__context_tag == to_underlying(Fields::kSessionID)) |
305 | 0 | { |
306 | 0 | err = DataModel::Decode(reader, sessionID); |
307 | 0 | } |
308 | 0 | else if (__context_tag == to_underlying(Fields::kResponseTimeout)) |
309 | 0 | { |
310 | 0 | err = DataModel::Decode(reader, responseTimeout); |
311 | 0 | } |
312 | 0 | else if (__context_tag == to_underlying(Fields::kMessage)) |
313 | 0 | { |
314 | 0 | err = DataModel::Decode(reader, message); |
315 | 0 | } |
316 | |
|
317 | 0 | ReturnErrorOnFailure(err); |
318 | 0 | } |
319 | 0 | } |
320 | | } // namespace ProxyMessageRequest |
321 | | namespace ProxyMessageResponse { |
322 | | |
323 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
324 | 0 | { |
325 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
326 | 0 | encoder.Encode(to_underlying(Fields::kSessionID), sessionID); |
327 | 0 | encoder.Encode(to_underlying(Fields::kMessage), message); |
328 | 0 | return encoder.Finalize(); |
329 | 0 | } |
330 | | |
331 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
332 | 0 | { |
333 | 0 | detail::StructDecodeIterator __iterator(reader); |
334 | 0 | while (true) |
335 | 0 | { |
336 | 0 | uint8_t __context_tag = 0; |
337 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
338 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
339 | 0 | ReturnErrorOnFailure(err); |
340 | | |
341 | 0 | if (__context_tag == to_underlying(Fields::kSessionID)) |
342 | 0 | { |
343 | 0 | err = DataModel::Decode(reader, sessionID); |
344 | 0 | } |
345 | 0 | else if (__context_tag == to_underlying(Fields::kMessage)) |
346 | 0 | { |
347 | 0 | err = DataModel::Decode(reader, message); |
348 | 0 | } |
349 | |
|
350 | 0 | ReturnErrorOnFailure(err); |
351 | 0 | } |
352 | 0 | } |
353 | | } // namespace ProxyMessageResponse |
354 | | } // namespace Commands |
355 | | } // namespace CommissioningProxy |
356 | | } // namespace Clusters |
357 | | } // namespace app |
358 | | } // namespace chip |