/src/connectedhomeip/zzz_generated/app-common/clusters/Thermostat/Events.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-Events.ipp.zapt |
20 | | |
21 | | #include <clusters/Thermostat/Events.h> |
22 | | |
23 | | #include <app/data-model/Decode.h> |
24 | | #include <app/data-model/Encode.h> |
25 | | #include <app/data-model/StructDecodeIterator.h> |
26 | | #include <app/data-model/WrappedStructEncoder.h> |
27 | | |
28 | | namespace chip { |
29 | | namespace app { |
30 | | namespace Clusters { |
31 | | namespace Thermostat { |
32 | | namespace Events { |
33 | | namespace SystemModeChange { |
34 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
35 | 0 | { |
36 | 0 | TLV::TLVType outer; |
37 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
38 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousSystemMode), previousSystemMode)); |
39 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentSystemMode), currentSystemMode)); |
40 | 0 | return aWriter.EndContainer(outer); |
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::kPreviousSystemMode)) |
54 | 0 | { |
55 | 0 | err = DataModel::Decode(reader, previousSystemMode); |
56 | 0 | } |
57 | 0 | else if (__context_tag == to_underlying(Fields::kCurrentSystemMode)) |
58 | 0 | { |
59 | 0 | err = DataModel::Decode(reader, currentSystemMode); |
60 | 0 | } |
61 | 0 | else |
62 | 0 | { |
63 | 0 | } |
64 | |
|
65 | 0 | ReturnErrorOnFailure(err); |
66 | 0 | } |
67 | 0 | } |
68 | | } // namespace SystemModeChange |
69 | | namespace LocalTemperatureChange { |
70 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
71 | 0 | { |
72 | 0 | TLV::TLVType outer; |
73 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
74 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentLocalTemperature), currentLocalTemperature)); |
75 | 0 | return aWriter.EndContainer(outer); |
76 | 0 | } |
77 | | |
78 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
79 | 0 | { |
80 | 0 | detail::StructDecodeIterator __iterator(reader); |
81 | 0 | while (true) |
82 | 0 | { |
83 | 0 | uint8_t __context_tag = 0; |
84 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
85 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
86 | 0 | ReturnErrorOnFailure(err); |
87 | | |
88 | 0 | if (__context_tag == to_underlying(Fields::kCurrentLocalTemperature)) |
89 | 0 | { |
90 | 0 | err = DataModel::Decode(reader, currentLocalTemperature); |
91 | 0 | } |
92 | 0 | else |
93 | 0 | { |
94 | 0 | } |
95 | |
|
96 | 0 | ReturnErrorOnFailure(err); |
97 | 0 | } |
98 | 0 | } |
99 | | } // namespace LocalTemperatureChange |
100 | | namespace OccupancyChange { |
101 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
102 | 0 | { |
103 | 0 | TLV::TLVType outer; |
104 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
105 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousOccupancy), previousOccupancy)); |
106 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentOccupancy), currentOccupancy)); |
107 | 0 | return aWriter.EndContainer(outer); |
108 | 0 | } |
109 | | |
110 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
111 | 0 | { |
112 | 0 | detail::StructDecodeIterator __iterator(reader); |
113 | 0 | while (true) |
114 | 0 | { |
115 | 0 | uint8_t __context_tag = 0; |
116 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
117 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
118 | 0 | ReturnErrorOnFailure(err); |
119 | | |
120 | 0 | if (__context_tag == to_underlying(Fields::kPreviousOccupancy)) |
121 | 0 | { |
122 | 0 | err = DataModel::Decode(reader, previousOccupancy); |
123 | 0 | } |
124 | 0 | else if (__context_tag == to_underlying(Fields::kCurrentOccupancy)) |
125 | 0 | { |
126 | 0 | err = DataModel::Decode(reader, currentOccupancy); |
127 | 0 | } |
128 | 0 | else |
129 | 0 | { |
130 | 0 | } |
131 | |
|
132 | 0 | ReturnErrorOnFailure(err); |
133 | 0 | } |
134 | 0 | } |
135 | | } // namespace OccupancyChange |
136 | | namespace SetpointChange { |
137 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
138 | 0 | { |
139 | 0 | TLV::TLVType outer; |
140 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
141 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSystemMode), systemMode)); |
142 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kOccupancy), occupancy)); |
143 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousSetpoint), previousSetpoint)); |
144 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentSetpoint), currentSetpoint)); |
145 | 0 | return aWriter.EndContainer(outer); |
146 | 0 | } |
147 | | |
148 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
149 | 0 | { |
150 | 0 | detail::StructDecodeIterator __iterator(reader); |
151 | 0 | while (true) |
152 | 0 | { |
153 | 0 | uint8_t __context_tag = 0; |
154 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
155 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
156 | 0 | ReturnErrorOnFailure(err); |
157 | | |
158 | 0 | if (__context_tag == to_underlying(Fields::kSystemMode)) |
159 | 0 | { |
160 | 0 | err = DataModel::Decode(reader, systemMode); |
161 | 0 | } |
162 | 0 | else if (__context_tag == to_underlying(Fields::kOccupancy)) |
163 | 0 | { |
164 | 0 | err = DataModel::Decode(reader, occupancy); |
165 | 0 | } |
166 | 0 | else if (__context_tag == to_underlying(Fields::kPreviousSetpoint)) |
167 | 0 | { |
168 | 0 | err = DataModel::Decode(reader, previousSetpoint); |
169 | 0 | } |
170 | 0 | else if (__context_tag == to_underlying(Fields::kCurrentSetpoint)) |
171 | 0 | { |
172 | 0 | err = DataModel::Decode(reader, currentSetpoint); |
173 | 0 | } |
174 | 0 | else |
175 | 0 | { |
176 | 0 | } |
177 | |
|
178 | 0 | ReturnErrorOnFailure(err); |
179 | 0 | } |
180 | 0 | } |
181 | | } // namespace SetpointChange |
182 | | namespace RunningStateChange { |
183 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
184 | 0 | { |
185 | 0 | TLV::TLVType outer; |
186 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
187 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousRunningState), previousRunningState)); |
188 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentRunningState), currentRunningState)); |
189 | 0 | return aWriter.EndContainer(outer); |
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::kPreviousRunningState)) |
203 | 0 | { |
204 | 0 | err = DataModel::Decode(reader, previousRunningState); |
205 | 0 | } |
206 | 0 | else if (__context_tag == to_underlying(Fields::kCurrentRunningState)) |
207 | 0 | { |
208 | 0 | err = DataModel::Decode(reader, currentRunningState); |
209 | 0 | } |
210 | 0 | else |
211 | 0 | { |
212 | 0 | } |
213 | |
|
214 | 0 | ReturnErrorOnFailure(err); |
215 | 0 | } |
216 | 0 | } |
217 | | } // namespace RunningStateChange |
218 | | namespace RunningModeChange { |
219 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
220 | 0 | { |
221 | 0 | TLV::TLVType outer; |
222 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
223 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousRunningMode), previousRunningMode)); |
224 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentRunningMode), currentRunningMode)); |
225 | 0 | return aWriter.EndContainer(outer); |
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::kPreviousRunningMode)) |
239 | 0 | { |
240 | 0 | err = DataModel::Decode(reader, previousRunningMode); |
241 | 0 | } |
242 | 0 | else if (__context_tag == to_underlying(Fields::kCurrentRunningMode)) |
243 | 0 | { |
244 | 0 | err = DataModel::Decode(reader, currentRunningMode); |
245 | 0 | } |
246 | 0 | else |
247 | 0 | { |
248 | 0 | } |
249 | |
|
250 | 0 | ReturnErrorOnFailure(err); |
251 | 0 | } |
252 | 0 | } |
253 | | } // namespace RunningModeChange |
254 | | namespace ActiveScheduleChange { |
255 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
256 | 0 | { |
257 | 0 | TLV::TLVType outer; |
258 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
259 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousScheduleHandle), previousScheduleHandle)); |
260 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentScheduleHandle), currentScheduleHandle)); |
261 | 0 | return aWriter.EndContainer(outer); |
262 | 0 | } |
263 | | |
264 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
265 | 0 | { |
266 | 0 | detail::StructDecodeIterator __iterator(reader); |
267 | 0 | while (true) |
268 | 0 | { |
269 | 0 | uint8_t __context_tag = 0; |
270 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
271 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
272 | 0 | ReturnErrorOnFailure(err); |
273 | | |
274 | 0 | if (__context_tag == to_underlying(Fields::kPreviousScheduleHandle)) |
275 | 0 | { |
276 | 0 | err = DataModel::Decode(reader, previousScheduleHandle); |
277 | 0 | } |
278 | 0 | else if (__context_tag == to_underlying(Fields::kCurrentScheduleHandle)) |
279 | 0 | { |
280 | 0 | err = DataModel::Decode(reader, currentScheduleHandle); |
281 | 0 | } |
282 | 0 | else |
283 | 0 | { |
284 | 0 | } |
285 | |
|
286 | 0 | ReturnErrorOnFailure(err); |
287 | 0 | } |
288 | 0 | } |
289 | | } // namespace ActiveScheduleChange |
290 | | namespace ActivePresetChange { |
291 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
292 | 0 | { |
293 | 0 | TLV::TLVType outer; |
294 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
295 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousPresetHandle), previousPresetHandle)); |
296 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentPresetHandle), currentPresetHandle)); |
297 | 0 | return aWriter.EndContainer(outer); |
298 | 0 | } |
299 | | |
300 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
301 | 0 | { |
302 | 0 | detail::StructDecodeIterator __iterator(reader); |
303 | 0 | while (true) |
304 | 0 | { |
305 | 0 | uint8_t __context_tag = 0; |
306 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
307 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
308 | 0 | ReturnErrorOnFailure(err); |
309 | | |
310 | 0 | if (__context_tag == to_underlying(Fields::kPreviousPresetHandle)) |
311 | 0 | { |
312 | 0 | err = DataModel::Decode(reader, previousPresetHandle); |
313 | 0 | } |
314 | 0 | else if (__context_tag == to_underlying(Fields::kCurrentPresetHandle)) |
315 | 0 | { |
316 | 0 | err = DataModel::Decode(reader, currentPresetHandle); |
317 | 0 | } |
318 | 0 | else |
319 | 0 | { |
320 | 0 | } |
321 | |
|
322 | 0 | ReturnErrorOnFailure(err); |
323 | 0 | } |
324 | 0 | } |
325 | | } // namespace ActivePresetChange |
326 | | } // namespace Events |
327 | | } // namespace Thermostat |
328 | | } // namespace Clusters |
329 | | } // namespace app |
330 | | } // namespace chip |