/src/connectedhomeip/zzz_generated/app-common/clusters/GeneralCommissioning/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/GeneralCommissioning/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 GeneralCommissioning { |
31 | | namespace Commands { |
32 | | namespace ArmFailSafe { |
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::kExpiryLengthSeconds), expiryLengthSeconds); |
38 | 0 | encoder.Encode(to_underlying(Fields::kBreadcrumb), breadcrumb); |
39 | 0 | return encoder.Finalize(); |
40 | 0 | } |
41 | | |
42 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
43 | 0 | { |
44 | 0 | detail::StructDecodeIterator __iterator(reader); |
45 | 0 | while (true) |
46 | 0 | { |
47 | 0 | uint8_t __context_tag = 0; |
48 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
49 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
50 | 0 | ReturnErrorOnFailure(err); |
51 | | |
52 | 0 | if (__context_tag == to_underlying(Fields::kExpiryLengthSeconds)) |
53 | 0 | { |
54 | 0 | err = DataModel::Decode(reader, expiryLengthSeconds); |
55 | 0 | } |
56 | 0 | else if (__context_tag == to_underlying(Fields::kBreadcrumb)) |
57 | 0 | { |
58 | 0 | err = DataModel::Decode(reader, breadcrumb); |
59 | 0 | } |
60 | |
|
61 | 0 | ReturnErrorOnFailure(err); |
62 | 0 | } |
63 | 0 | } |
64 | | } // namespace ArmFailSafe |
65 | | namespace ArmFailSafeResponse { |
66 | | |
67 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
68 | 0 | { |
69 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
70 | 0 | encoder.Encode(to_underlying(Fields::kErrorCode), errorCode); |
71 | 0 | encoder.Encode(to_underlying(Fields::kDebugText), debugText); |
72 | 0 | return encoder.Finalize(); |
73 | 0 | } |
74 | | |
75 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
76 | 0 | { |
77 | 0 | detail::StructDecodeIterator __iterator(reader); |
78 | 0 | while (true) |
79 | 0 | { |
80 | 0 | uint8_t __context_tag = 0; |
81 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
82 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
83 | 0 | ReturnErrorOnFailure(err); |
84 | | |
85 | 0 | if (__context_tag == to_underlying(Fields::kErrorCode)) |
86 | 0 | { |
87 | 0 | err = DataModel::Decode(reader, errorCode); |
88 | 0 | } |
89 | 0 | else if (__context_tag == to_underlying(Fields::kDebugText)) |
90 | 0 | { |
91 | 0 | err = DataModel::Decode(reader, debugText); |
92 | 0 | } |
93 | |
|
94 | 0 | ReturnErrorOnFailure(err); |
95 | 0 | } |
96 | 0 | } |
97 | | } // namespace ArmFailSafeResponse |
98 | | namespace SetRegulatoryConfig { |
99 | | |
100 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
101 | 0 | { |
102 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
103 | 0 | encoder.Encode(to_underlying(Fields::kNewRegulatoryConfig), newRegulatoryConfig); |
104 | 0 | encoder.Encode(to_underlying(Fields::kCountryCode), countryCode); |
105 | 0 | encoder.Encode(to_underlying(Fields::kBreadcrumb), breadcrumb); |
106 | 0 | return encoder.Finalize(); |
107 | 0 | } |
108 | | |
109 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
110 | 0 | { |
111 | 0 | detail::StructDecodeIterator __iterator(reader); |
112 | 0 | while (true) |
113 | 0 | { |
114 | 0 | uint8_t __context_tag = 0; |
115 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
116 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
117 | 0 | ReturnErrorOnFailure(err); |
118 | | |
119 | 0 | if (__context_tag == to_underlying(Fields::kNewRegulatoryConfig)) |
120 | 0 | { |
121 | 0 | err = DataModel::Decode(reader, newRegulatoryConfig); |
122 | 0 | } |
123 | 0 | else if (__context_tag == to_underlying(Fields::kCountryCode)) |
124 | 0 | { |
125 | 0 | err = DataModel::Decode(reader, countryCode); |
126 | 0 | } |
127 | 0 | else if (__context_tag == to_underlying(Fields::kBreadcrumb)) |
128 | 0 | { |
129 | 0 | err = DataModel::Decode(reader, breadcrumb); |
130 | 0 | } |
131 | |
|
132 | 0 | ReturnErrorOnFailure(err); |
133 | 0 | } |
134 | 0 | } |
135 | | } // namespace SetRegulatoryConfig |
136 | | namespace SetRegulatoryConfigResponse { |
137 | | |
138 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
139 | 0 | { |
140 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
141 | 0 | encoder.Encode(to_underlying(Fields::kErrorCode), errorCode); |
142 | 0 | encoder.Encode(to_underlying(Fields::kDebugText), debugText); |
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::kErrorCode)) |
157 | 0 | { |
158 | 0 | err = DataModel::Decode(reader, errorCode); |
159 | 0 | } |
160 | 0 | else if (__context_tag == to_underlying(Fields::kDebugText)) |
161 | 0 | { |
162 | 0 | err = DataModel::Decode(reader, debugText); |
163 | 0 | } |
164 | |
|
165 | 0 | ReturnErrorOnFailure(err); |
166 | 0 | } |
167 | 0 | } |
168 | | } // namespace SetRegulatoryConfigResponse |
169 | | namespace CommissioningComplete { |
170 | | |
171 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
172 | 0 | { |
173 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
174 | 0 | return encoder.Finalize(); |
175 | 0 | } |
176 | | |
177 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex) |
178 | 0 | { |
179 | 0 | detail::StructDecodeIterator __iterator(reader); |
180 | 0 | while (true) |
181 | 0 | { |
182 | 0 | uint8_t __context_tag = 0; |
183 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
184 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
185 | 0 | ReturnErrorOnFailure(err); |
186 | | |
187 | 0 | ReturnErrorOnFailure(err); |
188 | 0 | } |
189 | 0 | } |
190 | | } // namespace CommissioningComplete |
191 | | namespace CommissioningCompleteResponse { |
192 | | |
193 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
194 | 0 | { |
195 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
196 | 0 | encoder.Encode(to_underlying(Fields::kErrorCode), errorCode); |
197 | 0 | encoder.Encode(to_underlying(Fields::kDebugText), debugText); |
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::kErrorCode)) |
212 | 0 | { |
213 | 0 | err = DataModel::Decode(reader, errorCode); |
214 | 0 | } |
215 | 0 | else if (__context_tag == to_underlying(Fields::kDebugText)) |
216 | 0 | { |
217 | 0 | err = DataModel::Decode(reader, debugText); |
218 | 0 | } |
219 | |
|
220 | 0 | ReturnErrorOnFailure(err); |
221 | 0 | } |
222 | 0 | } |
223 | | } // namespace CommissioningCompleteResponse |
224 | | namespace SetTCAcknowledgements { |
225 | | |
226 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
227 | 0 | { |
228 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
229 | 0 | encoder.Encode(to_underlying(Fields::kTCVersion), TCVersion); |
230 | 0 | encoder.Encode(to_underlying(Fields::kTCUserResponse), TCUserResponse); |
231 | 0 | return encoder.Finalize(); |
232 | 0 | } |
233 | | |
234 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
235 | 0 | { |
236 | 0 | detail::StructDecodeIterator __iterator(reader); |
237 | 0 | while (true) |
238 | 0 | { |
239 | 0 | uint8_t __context_tag = 0; |
240 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
241 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
242 | 0 | ReturnErrorOnFailure(err); |
243 | | |
244 | 0 | if (__context_tag == to_underlying(Fields::kTCVersion)) |
245 | 0 | { |
246 | 0 | err = DataModel::Decode(reader, TCVersion); |
247 | 0 | } |
248 | 0 | else if (__context_tag == to_underlying(Fields::kTCUserResponse)) |
249 | 0 | { |
250 | 0 | err = DataModel::Decode(reader, TCUserResponse); |
251 | 0 | } |
252 | |
|
253 | 0 | ReturnErrorOnFailure(err); |
254 | 0 | } |
255 | 0 | } |
256 | | } // namespace SetTCAcknowledgements |
257 | | namespace SetTCAcknowledgementsResponse { |
258 | | |
259 | | CHIP_ERROR Type::Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const |
260 | 0 | { |
261 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
262 | 0 | encoder.Encode(to_underlying(Fields::kErrorCode), errorCode); |
263 | 0 | return encoder.Finalize(); |
264 | 0 | } |
265 | | |
266 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
267 | 0 | { |
268 | 0 | detail::StructDecodeIterator __iterator(reader); |
269 | 0 | while (true) |
270 | 0 | { |
271 | 0 | uint8_t __context_tag = 0; |
272 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
273 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
274 | 0 | ReturnErrorOnFailure(err); |
275 | | |
276 | 0 | if (__context_tag == to_underlying(Fields::kErrorCode)) |
277 | 0 | { |
278 | 0 | err = DataModel::Decode(reader, errorCode); |
279 | 0 | } |
280 | |
|
281 | 0 | ReturnErrorOnFailure(err); |
282 | 0 | } |
283 | 0 | } |
284 | | } // namespace SetTCAcknowledgementsResponse |
285 | | } // namespace Commands |
286 | | } // namespace GeneralCommissioning |
287 | | } // namespace Clusters |
288 | | } // namespace app |
289 | | } // namespace chip |