/src/connectedhomeip/zzz_generated/app-common/clusters/TimeSynchronization/Commands.h
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.h.zapt |
20 | | |
21 | | #pragma once |
22 | | |
23 | | #include <app/data-model/DecodableList.h> |
24 | | #include <app/data-model/Encode.h> |
25 | | #include <app/data-model/List.h> |
26 | | #include <app/data-model/NullObject.h> |
27 | | #include <app/data-model/Nullable.h> |
28 | | #include <lib/core/DataModelTypes.h> |
29 | | #include <lib/core/Optional.h> |
30 | | #include <lib/core/TLV.h> |
31 | | #include <lib/support/BitMask.h> |
32 | | |
33 | | #include <clusters/shared/Enums.h> |
34 | | #include <clusters/shared/Structs.h> |
35 | | |
36 | | #include <clusters/TimeSynchronization/ClusterId.h> |
37 | | #include <clusters/TimeSynchronization/CommandIds.h> |
38 | | #include <clusters/TimeSynchronization/Enums.h> |
39 | | #include <clusters/TimeSynchronization/Structs.h> |
40 | | |
41 | | #include <cstdint> |
42 | | |
43 | | namespace chip { |
44 | | namespace app { |
45 | | namespace Clusters { |
46 | | namespace TimeSynchronization { |
47 | | namespace Commands { |
48 | | // Forward-declarations so we can reference these later. |
49 | | |
50 | | namespace SetUTCTime { |
51 | | struct Type; |
52 | | struct DecodableType; |
53 | | } // namespace SetUTCTime |
54 | | |
55 | | namespace SetTrustedTimeSource { |
56 | | struct Type; |
57 | | struct DecodableType; |
58 | | } // namespace SetTrustedTimeSource |
59 | | |
60 | | namespace SetTimeZone { |
61 | | struct Type; |
62 | | struct DecodableType; |
63 | | } // namespace SetTimeZone |
64 | | |
65 | | namespace SetTimeZoneResponse { |
66 | | struct Type; |
67 | | struct DecodableType; |
68 | | } // namespace SetTimeZoneResponse |
69 | | |
70 | | namespace SetDSTOffset { |
71 | | struct Type; |
72 | | struct DecodableType; |
73 | | } // namespace SetDSTOffset |
74 | | |
75 | | namespace SetDefaultNTP { |
76 | | struct Type; |
77 | | struct DecodableType; |
78 | | } // namespace SetDefaultNTP |
79 | | |
80 | | } // namespace Commands |
81 | | |
82 | | namespace Commands { |
83 | | namespace SetUTCTime { |
84 | | enum class Fields : uint8_t |
85 | | { |
86 | | kUTCTime = 0, |
87 | | kGranularity = 1, |
88 | | kTimeSource = 2, |
89 | | }; |
90 | | |
91 | | struct Type |
92 | | { |
93 | | public: |
94 | | // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
95 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetUTCTime::Id; } |
96 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
97 | | |
98 | | uint64_t UTCTime = static_cast<uint64_t>(0); |
99 | | GranularityEnum granularity = static_cast<GranularityEnum>(0); |
100 | | Optional<TimeSourceEnum> timeSource; |
101 | | |
102 | | CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
103 | | |
104 | | using ResponseType = DataModel::NullObjectType; |
105 | | |
106 | 0 | static constexpr bool MustUseTimedInvoke() { return false; } |
107 | | }; |
108 | | |
109 | | struct DecodableType |
110 | | { |
111 | | public: |
112 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetUTCTime::Id; } |
113 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
114 | | static constexpr bool kIsFabricScoped = false; |
115 | | |
116 | | uint64_t UTCTime = static_cast<uint64_t>(0); |
117 | | GranularityEnum granularity = static_cast<GranularityEnum>(0); |
118 | | Optional<TimeSourceEnum> timeSource; |
119 | | |
120 | | CHIP_ERROR Decode(TLV::TLVReader & reader); |
121 | | }; |
122 | | }; // namespace SetUTCTime |
123 | | namespace SetTrustedTimeSource { |
124 | | enum class Fields : uint8_t |
125 | | { |
126 | | kTrustedTimeSource = 0, |
127 | | }; |
128 | | |
129 | | struct Type |
130 | | { |
131 | | public: |
132 | | // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
133 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetTrustedTimeSource::Id; } |
134 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
135 | | |
136 | | DataModel::Nullable<Structs::FabricScopedTrustedTimeSourceStruct::Type> trustedTimeSource; |
137 | | |
138 | | CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
139 | | |
140 | | using ResponseType = DataModel::NullObjectType; |
141 | | |
142 | 0 | static constexpr bool MustUseTimedInvoke() { return false; } |
143 | | }; |
144 | | |
145 | | struct DecodableType |
146 | | { |
147 | | public: |
148 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetTrustedTimeSource::Id; } |
149 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
150 | | static constexpr bool kIsFabricScoped = true; |
151 | | |
152 | | DataModel::Nullable<Structs::FabricScopedTrustedTimeSourceStruct::DecodableType> trustedTimeSource; |
153 | | |
154 | | CHIP_ERROR Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex); |
155 | | }; |
156 | | }; // namespace SetTrustedTimeSource |
157 | | namespace SetTimeZone { |
158 | | enum class Fields : uint8_t |
159 | | { |
160 | | kTimeZone = 0, |
161 | | }; |
162 | | |
163 | | struct Type |
164 | | { |
165 | | public: |
166 | | // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
167 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetTimeZone::Id; } |
168 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
169 | | |
170 | | DataModel::List<const Structs::TimeZoneStruct::Type> timeZone; |
171 | | |
172 | | CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
173 | | |
174 | | using ResponseType = Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType; |
175 | | |
176 | 0 | static constexpr bool MustUseTimedInvoke() { return false; } |
177 | | }; |
178 | | |
179 | | struct DecodableType |
180 | | { |
181 | | public: |
182 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetTimeZone::Id; } |
183 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
184 | | static constexpr bool kIsFabricScoped = false; |
185 | | |
186 | | DataModel::DecodableList<Structs::TimeZoneStruct::DecodableType> timeZone; |
187 | | |
188 | | CHIP_ERROR Decode(TLV::TLVReader & reader); |
189 | | }; |
190 | | }; // namespace SetTimeZone |
191 | | namespace SetTimeZoneResponse { |
192 | | enum class Fields : uint8_t |
193 | | { |
194 | | kDSTOffsetRequired = 0, |
195 | | }; |
196 | | |
197 | | struct Type |
198 | | { |
199 | | public: |
200 | | // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
201 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetTimeZoneResponse::Id; } |
202 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
203 | | |
204 | | bool DSTOffsetRequired = static_cast<bool>(0); |
205 | | |
206 | | CHIP_ERROR Encode(DataModel::FabricAwareTLVWriter & aWriter, TLV::Tag aTag) const; |
207 | | |
208 | | using ResponseType = DataModel::NullObjectType; |
209 | | |
210 | 0 | static constexpr bool MustUseTimedInvoke() { return false; } |
211 | | }; |
212 | | |
213 | | struct DecodableType |
214 | | { |
215 | | public: |
216 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetTimeZoneResponse::Id; } |
217 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
218 | | |
219 | | bool DSTOffsetRequired = static_cast<bool>(0); |
220 | | |
221 | | CHIP_ERROR Decode(TLV::TLVReader & reader); |
222 | | }; |
223 | | }; // namespace SetTimeZoneResponse |
224 | | namespace SetDSTOffset { |
225 | | enum class Fields : uint8_t |
226 | | { |
227 | | kDSTOffset = 0, |
228 | | }; |
229 | | |
230 | | struct Type |
231 | | { |
232 | | public: |
233 | | // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
234 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetDSTOffset::Id; } |
235 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
236 | | |
237 | | DataModel::List<const Structs::DSTOffsetStruct::Type> DSTOffset; |
238 | | |
239 | | CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
240 | | |
241 | | using ResponseType = DataModel::NullObjectType; |
242 | | |
243 | 0 | static constexpr bool MustUseTimedInvoke() { return false; } |
244 | | }; |
245 | | |
246 | | struct DecodableType |
247 | | { |
248 | | public: |
249 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetDSTOffset::Id; } |
250 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
251 | | static constexpr bool kIsFabricScoped = false; |
252 | | |
253 | | DataModel::DecodableList<Structs::DSTOffsetStruct::DecodableType> DSTOffset; |
254 | | |
255 | | CHIP_ERROR Decode(TLV::TLVReader & reader); |
256 | | }; |
257 | | }; // namespace SetDSTOffset |
258 | | namespace SetDefaultNTP { |
259 | | enum class Fields : uint8_t |
260 | | { |
261 | | kDefaultNTP = 0, |
262 | | }; |
263 | | |
264 | | struct Type |
265 | | { |
266 | | public: |
267 | | // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
268 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetDefaultNTP::Id; } |
269 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
270 | | |
271 | | DataModel::Nullable<chip::CharSpan> defaultNTP; |
272 | | |
273 | | CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
274 | | |
275 | | using ResponseType = DataModel::NullObjectType; |
276 | | |
277 | 0 | static constexpr bool MustUseTimedInvoke() { return false; } |
278 | | }; |
279 | | |
280 | | struct DecodableType |
281 | | { |
282 | | public: |
283 | 0 | static constexpr CommandId GetCommandId() { return Commands::SetDefaultNTP::Id; } |
284 | 0 | static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } |
285 | | static constexpr bool kIsFabricScoped = false; |
286 | | |
287 | | DataModel::Nullable<chip::CharSpan> defaultNTP; |
288 | | |
289 | | CHIP_ERROR Decode(TLV::TLVReader & reader); |
290 | | }; |
291 | | }; // namespace SetDefaultNTP |
292 | | } // namespace Commands |
293 | | } // namespace TimeSynchronization |
294 | | } // namespace Clusters |
295 | | } // namespace app |
296 | | } // namespace chip |