/src/connectedhomeip/zzz_generated/app-common/clusters/OperationalCredentials/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/OperationalCredentials/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 OperationalCredentials { |
31 | | namespace Commands { |
32 | | namespace AttestationRequest { |
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::kAttestationNonce), attestationNonce); |
38 | 0 | return encoder.Finalize(); |
39 | 0 | } |
40 | | |
41 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
42 | 0 | { |
43 | 0 | detail::StructDecodeIterator __iterator(reader); |
44 | 0 | while (true) |
45 | 0 | { |
46 | 0 | uint8_t __context_tag = 0; |
47 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
48 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
49 | 0 | ReturnErrorOnFailure(err); |
50 | | |
51 | 0 | if (__context_tag == to_underlying(Fields::kAttestationNonce)) |
52 | 0 | { |
53 | 0 | err = DataModel::Decode(reader, attestationNonce); |
54 | 0 | } |
55 | |
|
56 | 0 | ReturnErrorOnFailure(err); |
57 | 0 | } |
58 | 0 | } |
59 | | } // namespace AttestationRequest |
60 | | namespace AttestationResponse { |
61 | | |
62 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
63 | 0 | { |
64 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
65 | 0 | encoder.Encode(to_underlying(Fields::kAttestationElements), attestationElements); |
66 | 0 | encoder.Encode(to_underlying(Fields::kAttestationSignature), attestationSignature); |
67 | 0 | return encoder.Finalize(); |
68 | 0 | } |
69 | | |
70 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
71 | 0 | { |
72 | 0 | detail::StructDecodeIterator __iterator(reader); |
73 | 0 | while (true) |
74 | 0 | { |
75 | 0 | uint8_t __context_tag = 0; |
76 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
77 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
78 | 0 | ReturnErrorOnFailure(err); |
79 | | |
80 | 0 | if (__context_tag == to_underlying(Fields::kAttestationElements)) |
81 | 0 | { |
82 | 0 | err = DataModel::Decode(reader, attestationElements); |
83 | 0 | } |
84 | 0 | else if (__context_tag == to_underlying(Fields::kAttestationSignature)) |
85 | 0 | { |
86 | 0 | err = DataModel::Decode(reader, attestationSignature); |
87 | 0 | } |
88 | |
|
89 | 0 | ReturnErrorOnFailure(err); |
90 | 0 | } |
91 | 0 | } |
92 | | } // namespace AttestationResponse |
93 | | namespace CertificateChainRequest { |
94 | | |
95 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
96 | 0 | { |
97 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
98 | 0 | encoder.Encode(to_underlying(Fields::kCertificateType), certificateType); |
99 | 0 | return encoder.Finalize(); |
100 | 0 | } |
101 | | |
102 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
103 | 0 | { |
104 | 0 | detail::StructDecodeIterator __iterator(reader); |
105 | 0 | while (true) |
106 | 0 | { |
107 | 0 | uint8_t __context_tag = 0; |
108 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
109 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
110 | 0 | ReturnErrorOnFailure(err); |
111 | | |
112 | 0 | if (__context_tag == to_underlying(Fields::kCertificateType)) |
113 | 0 | { |
114 | 0 | err = DataModel::Decode(reader, certificateType); |
115 | 0 | } |
116 | |
|
117 | 0 | ReturnErrorOnFailure(err); |
118 | 0 | } |
119 | 0 | } |
120 | | } // namespace CertificateChainRequest |
121 | | namespace CertificateChainResponse { |
122 | | |
123 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
124 | 0 | { |
125 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
126 | 0 | encoder.Encode(to_underlying(Fields::kCertificate), certificate); |
127 | 0 | return encoder.Finalize(); |
128 | 0 | } |
129 | | |
130 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
131 | 0 | { |
132 | 0 | detail::StructDecodeIterator __iterator(reader); |
133 | 0 | while (true) |
134 | 0 | { |
135 | 0 | uint8_t __context_tag = 0; |
136 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
137 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
138 | 0 | ReturnErrorOnFailure(err); |
139 | | |
140 | 0 | if (__context_tag == to_underlying(Fields::kCertificate)) |
141 | 0 | { |
142 | 0 | err = DataModel::Decode(reader, certificate); |
143 | 0 | } |
144 | |
|
145 | 0 | ReturnErrorOnFailure(err); |
146 | 0 | } |
147 | 0 | } |
148 | | } // namespace CertificateChainResponse |
149 | | namespace CSRRequest { |
150 | | |
151 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
152 | 0 | { |
153 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
154 | 0 | encoder.Encode(to_underlying(Fields::kCSRNonce), CSRNonce); |
155 | 0 | encoder.Encode(to_underlying(Fields::kIsForUpdateNOC), isForUpdateNOC); |
156 | 0 | return encoder.Finalize(); |
157 | 0 | } |
158 | | |
159 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
160 | 0 | { |
161 | 0 | detail::StructDecodeIterator __iterator(reader); |
162 | 0 | while (true) |
163 | 0 | { |
164 | 0 | uint8_t __context_tag = 0; |
165 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
166 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
167 | 0 | ReturnErrorOnFailure(err); |
168 | | |
169 | 0 | if (__context_tag == to_underlying(Fields::kCSRNonce)) |
170 | 0 | { |
171 | 0 | err = DataModel::Decode(reader, CSRNonce); |
172 | 0 | } |
173 | 0 | else if (__context_tag == to_underlying(Fields::kIsForUpdateNOC)) |
174 | 0 | { |
175 | 0 | err = DataModel::Decode(reader, isForUpdateNOC); |
176 | 0 | } |
177 | |
|
178 | 0 | ReturnErrorOnFailure(err); |
179 | 0 | } |
180 | 0 | } |
181 | | } // namespace CSRRequest |
182 | | namespace CSRResponse { |
183 | | |
184 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
185 | 0 | { |
186 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
187 | 0 | encoder.Encode(to_underlying(Fields::kNOCSRElements), NOCSRElements); |
188 | 0 | encoder.Encode(to_underlying(Fields::kAttestationSignature), attestationSignature); |
189 | 0 | return encoder.Finalize(); |
190 | 0 | } |
191 | | |
192 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
193 | 0 | { |
194 | 0 | detail::StructDecodeIterator __iterator(reader); |
195 | 0 | while (true) |
196 | 0 | { |
197 | 0 | uint8_t __context_tag = 0; |
198 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
199 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
200 | 0 | ReturnErrorOnFailure(err); |
201 | | |
202 | 0 | if (__context_tag == to_underlying(Fields::kNOCSRElements)) |
203 | 0 | { |
204 | 0 | err = DataModel::Decode(reader, NOCSRElements); |
205 | 0 | } |
206 | 0 | else if (__context_tag == to_underlying(Fields::kAttestationSignature)) |
207 | 0 | { |
208 | 0 | err = DataModel::Decode(reader, attestationSignature); |
209 | 0 | } |
210 | |
|
211 | 0 | ReturnErrorOnFailure(err); |
212 | 0 | } |
213 | 0 | } |
214 | | } // namespace CSRResponse |
215 | | namespace AddNOC { |
216 | | |
217 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
218 | 0 | { |
219 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
220 | 0 | encoder.Encode(to_underlying(Fields::kNOCValue), NOCValue); |
221 | 0 | encoder.Encode(to_underlying(Fields::kICACValue), ICACValue); |
222 | 0 | encoder.Encode(to_underlying(Fields::kIPKValue), IPKValue); |
223 | 0 | encoder.Encode(to_underlying(Fields::kCaseAdminSubject), caseAdminSubject); |
224 | 0 | encoder.Encode(to_underlying(Fields::kAdminVendorId), adminVendorId); |
225 | 0 | return encoder.Finalize(); |
226 | 0 | } |
227 | | |
228 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
229 | 0 | { |
230 | 0 | detail::StructDecodeIterator __iterator(reader); |
231 | 0 | while (true) |
232 | 0 | { |
233 | 0 | uint8_t __context_tag = 0; |
234 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
235 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
236 | 0 | ReturnErrorOnFailure(err); |
237 | | |
238 | 0 | if (__context_tag == to_underlying(Fields::kNOCValue)) |
239 | 0 | { |
240 | 0 | err = DataModel::Decode(reader, NOCValue); |
241 | 0 | } |
242 | 0 | else if (__context_tag == to_underlying(Fields::kICACValue)) |
243 | 0 | { |
244 | 0 | err = DataModel::Decode(reader, ICACValue); |
245 | 0 | } |
246 | 0 | else if (__context_tag == to_underlying(Fields::kIPKValue)) |
247 | 0 | { |
248 | 0 | err = DataModel::Decode(reader, IPKValue); |
249 | 0 | } |
250 | 0 | else if (__context_tag == to_underlying(Fields::kCaseAdminSubject)) |
251 | 0 | { |
252 | 0 | err = DataModel::Decode(reader, caseAdminSubject); |
253 | 0 | } |
254 | 0 | else if (__context_tag == to_underlying(Fields::kAdminVendorId)) |
255 | 0 | { |
256 | 0 | err = DataModel::Decode(reader, adminVendorId); |
257 | 0 | } |
258 | |
|
259 | 0 | ReturnErrorOnFailure(err); |
260 | 0 | } |
261 | 0 | } |
262 | | } // namespace AddNOC |
263 | | namespace UpdateNOC { |
264 | | |
265 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
266 | 0 | { |
267 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
268 | 0 | encoder.Encode(to_underlying(Fields::kNOCValue), NOCValue); |
269 | 0 | encoder.Encode(to_underlying(Fields::kICACValue), ICACValue); |
270 | 0 | return encoder.Finalize(); |
271 | 0 | } |
272 | | |
273 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
274 | 0 | { |
275 | 0 | detail::StructDecodeIterator __iterator(reader); |
276 | 0 | while (true) |
277 | 0 | { |
278 | 0 | uint8_t __context_tag = 0; |
279 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
280 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
281 | 0 | ReturnErrorOnFailure(err); |
282 | | |
283 | 0 | if (__context_tag == to_underlying(Fields::kNOCValue)) |
284 | 0 | { |
285 | 0 | err = DataModel::Decode(reader, NOCValue); |
286 | 0 | } |
287 | 0 | else if (__context_tag == to_underlying(Fields::kICACValue)) |
288 | 0 | { |
289 | 0 | err = DataModel::Decode(reader, ICACValue); |
290 | 0 | } |
291 | |
|
292 | 0 | ReturnErrorOnFailure(err); |
293 | 0 | } |
294 | 0 | } |
295 | | } // namespace UpdateNOC |
296 | | namespace NOCResponse { |
297 | | |
298 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
299 | 0 | { |
300 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
301 | 0 | encoder.Encode(to_underlying(Fields::kStatusCode), statusCode); |
302 | 0 | encoder.Encode(to_underlying(Fields::kFabricIndex), fabricIndex); |
303 | 0 | encoder.Encode(to_underlying(Fields::kDebugText), debugText); |
304 | 0 | return encoder.Finalize(); |
305 | 0 | } |
306 | | |
307 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
308 | 0 | { |
309 | 0 | detail::StructDecodeIterator __iterator(reader); |
310 | 0 | while (true) |
311 | 0 | { |
312 | 0 | uint8_t __context_tag = 0; |
313 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
314 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
315 | 0 | ReturnErrorOnFailure(err); |
316 | | |
317 | 0 | if (__context_tag == to_underlying(Fields::kStatusCode)) |
318 | 0 | { |
319 | 0 | err = DataModel::Decode(reader, statusCode); |
320 | 0 | } |
321 | 0 | else if (__context_tag == to_underlying(Fields::kFabricIndex)) |
322 | 0 | { |
323 | 0 | err = DataModel::Decode(reader, fabricIndex); |
324 | 0 | } |
325 | 0 | else if (__context_tag == to_underlying(Fields::kDebugText)) |
326 | 0 | { |
327 | 0 | err = DataModel::Decode(reader, debugText); |
328 | 0 | } |
329 | |
|
330 | 0 | ReturnErrorOnFailure(err); |
331 | 0 | } |
332 | 0 | } |
333 | | } // namespace NOCResponse |
334 | | namespace UpdateFabricLabel { |
335 | | |
336 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
337 | 0 | { |
338 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
339 | 0 | encoder.Encode(to_underlying(Fields::kLabel), label); |
340 | 0 | return encoder.Finalize(); |
341 | 0 | } |
342 | | |
343 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
344 | 0 | { |
345 | 0 | detail::StructDecodeIterator __iterator(reader); |
346 | 0 | while (true) |
347 | 0 | { |
348 | 0 | uint8_t __context_tag = 0; |
349 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
350 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
351 | 0 | ReturnErrorOnFailure(err); |
352 | | |
353 | 0 | if (__context_tag == to_underlying(Fields::kLabel)) |
354 | 0 | { |
355 | 0 | err = DataModel::Decode(reader, label); |
356 | 0 | } |
357 | |
|
358 | 0 | ReturnErrorOnFailure(err); |
359 | 0 | } |
360 | 0 | } |
361 | | } // namespace UpdateFabricLabel |
362 | | namespace RemoveFabric { |
363 | | |
364 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
365 | 0 | { |
366 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
367 | 0 | encoder.Encode(to_underlying(Fields::kFabricIndex), fabricIndex); |
368 | 0 | return encoder.Finalize(); |
369 | 0 | } |
370 | | |
371 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
372 | 0 | { |
373 | 0 | detail::StructDecodeIterator __iterator(reader); |
374 | 0 | while (true) |
375 | 0 | { |
376 | 0 | uint8_t __context_tag = 0; |
377 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
378 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
379 | 0 | ReturnErrorOnFailure(err); |
380 | | |
381 | 0 | if (__context_tag == to_underlying(Fields::kFabricIndex)) |
382 | 0 | { |
383 | 0 | err = DataModel::Decode(reader, fabricIndex); |
384 | 0 | } |
385 | |
|
386 | 0 | ReturnErrorOnFailure(err); |
387 | 0 | } |
388 | 0 | } |
389 | | } // namespace RemoveFabric |
390 | | namespace AddTrustedRootCertificate { |
391 | | |
392 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
393 | 0 | { |
394 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
395 | 0 | encoder.Encode(to_underlying(Fields::kRootCACertificate), rootCACertificate); |
396 | 0 | return encoder.Finalize(); |
397 | 0 | } |
398 | | |
399 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
400 | 0 | { |
401 | 0 | detail::StructDecodeIterator __iterator(reader); |
402 | 0 | while (true) |
403 | 0 | { |
404 | 0 | uint8_t __context_tag = 0; |
405 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
406 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
407 | 0 | ReturnErrorOnFailure(err); |
408 | | |
409 | 0 | if (__context_tag == to_underlying(Fields::kRootCACertificate)) |
410 | 0 | { |
411 | 0 | err = DataModel::Decode(reader, rootCACertificate); |
412 | 0 | } |
413 | |
|
414 | 0 | ReturnErrorOnFailure(err); |
415 | 0 | } |
416 | 0 | } |
417 | | } // namespace AddTrustedRootCertificate |
418 | | namespace SetVIDVerificationStatement { |
419 | | |
420 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
421 | 0 | { |
422 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
423 | 0 | encoder.Encode(to_underlying(Fields::kVendorID), vendorID); |
424 | 0 | encoder.Encode(to_underlying(Fields::kVIDVerificationStatement), VIDVerificationStatement); |
425 | 0 | encoder.Encode(to_underlying(Fields::kVvsc), vvsc); |
426 | 0 | return encoder.Finalize(); |
427 | 0 | } |
428 | | |
429 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
430 | 0 | { |
431 | 0 | detail::StructDecodeIterator __iterator(reader); |
432 | 0 | while (true) |
433 | 0 | { |
434 | 0 | uint8_t __context_tag = 0; |
435 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
436 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
437 | 0 | ReturnErrorOnFailure(err); |
438 | | |
439 | 0 | if (__context_tag == to_underlying(Fields::kVendorID)) |
440 | 0 | { |
441 | 0 | err = DataModel::Decode(reader, vendorID); |
442 | 0 | } |
443 | 0 | else if (__context_tag == to_underlying(Fields::kVIDVerificationStatement)) |
444 | 0 | { |
445 | 0 | err = DataModel::Decode(reader, VIDVerificationStatement); |
446 | 0 | } |
447 | 0 | else if (__context_tag == to_underlying(Fields::kVvsc)) |
448 | 0 | { |
449 | 0 | err = DataModel::Decode(reader, vvsc); |
450 | 0 | } |
451 | |
|
452 | 0 | ReturnErrorOnFailure(err); |
453 | 0 | } |
454 | 0 | } |
455 | | } // namespace SetVIDVerificationStatement |
456 | | namespace SignVIDVerificationRequest { |
457 | | |
458 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
459 | 0 | { |
460 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
461 | 0 | encoder.Encode(to_underlying(Fields::kFabricIndex), fabricIndex); |
462 | 0 | encoder.Encode(to_underlying(Fields::kClientChallenge), clientChallenge); |
463 | 0 | return encoder.Finalize(); |
464 | 0 | } |
465 | | |
466 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
467 | 0 | { |
468 | 0 | detail::StructDecodeIterator __iterator(reader); |
469 | 0 | while (true) |
470 | 0 | { |
471 | 0 | uint8_t __context_tag = 0; |
472 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
473 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
474 | 0 | ReturnErrorOnFailure(err); |
475 | | |
476 | 0 | if (__context_tag == to_underlying(Fields::kFabricIndex)) |
477 | 0 | { |
478 | 0 | err = DataModel::Decode(reader, fabricIndex); |
479 | 0 | } |
480 | 0 | else if (__context_tag == to_underlying(Fields::kClientChallenge)) |
481 | 0 | { |
482 | 0 | err = DataModel::Decode(reader, clientChallenge); |
483 | 0 | } |
484 | |
|
485 | 0 | ReturnErrorOnFailure(err); |
486 | 0 | } |
487 | 0 | } |
488 | | } // namespace SignVIDVerificationRequest |
489 | | namespace SignVIDVerificationResponse { |
490 | | |
491 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
492 | 0 | { |
493 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
494 | 0 | encoder.Encode(to_underlying(Fields::kFabricIndex), fabricIndex); |
495 | 0 | encoder.Encode(to_underlying(Fields::kFabricBindingVersion), fabricBindingVersion); |
496 | 0 | encoder.Encode(to_underlying(Fields::kSignature), signature); |
497 | 0 | return encoder.Finalize(); |
498 | 0 | } |
499 | | |
500 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
501 | 0 | { |
502 | 0 | detail::StructDecodeIterator __iterator(reader); |
503 | 0 | while (true) |
504 | 0 | { |
505 | 0 | uint8_t __context_tag = 0; |
506 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
507 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
508 | 0 | ReturnErrorOnFailure(err); |
509 | | |
510 | 0 | if (__context_tag == to_underlying(Fields::kFabricIndex)) |
511 | 0 | { |
512 | 0 | err = DataModel::Decode(reader, fabricIndex); |
513 | 0 | } |
514 | 0 | else if (__context_tag == to_underlying(Fields::kFabricBindingVersion)) |
515 | 0 | { |
516 | 0 | err = DataModel::Decode(reader, fabricBindingVersion); |
517 | 0 | } |
518 | 0 | else if (__context_tag == to_underlying(Fields::kSignature)) |
519 | 0 | { |
520 | 0 | err = DataModel::Decode(reader, signature); |
521 | 0 | } |
522 | |
|
523 | 0 | ReturnErrorOnFailure(err); |
524 | 0 | } |
525 | 0 | } |
526 | | } // namespace SignVIDVerificationResponse |
527 | | } // namespace Commands |
528 | | } // namespace OperationalCredentials |
529 | | } // namespace Clusters |
530 | | } // namespace app |
531 | | } // namespace chip |