Apply Upstream code (2021-03-15)
[platform/upstream/connectedhomeip.git] / src / controller / python / ChipDeviceController-ClusterCommands.cpp
1 /*
2  *
3  *    Copyright (c) 2021 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
20 #include <core/CHIPCore.h>
21
22 #include <app/CommandSender.h>
23 #include <app/InteractionModelEngine.h>
24 #include <lib/support/Span.h>
25 #include <support/ReturnMacros.h>
26
27 #include <controller/CHIPClusters.h>
28 #include <controller/CHIPDevice.h>
29
30 using namespace chip;
31 using namespace chip::app;
32
33 extern "C" {
34
35 // Cluster ApplicationBasic
36 // End of Cluster ApplicationBasic
37
38 // Cluster BarrierControl
39 CHIP_ERROR chip_ime_AppendCommand_BarrierControl_BarrierControlGoToPercent(chip::Controller::Device * device,
40                                                                            chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
41                                                                            uint8_t percentOpen)
42 {
43     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
44     chip::Controller::BarrierControlCluster clusterBarrierControl;
45     (void) ZCLgroupId;
46     clusterBarrierControl.Associate(device, ZCLendpointId);
47     return clusterBarrierControl.BarrierControlGoToPercent(nullptr, nullptr, percentOpen);
48 }
49 CHIP_ERROR chip_ime_AppendCommand_BarrierControl_BarrierControlStop(chip::Controller::Device * device,
50                                                                     chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId)
51 {
52     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
53     chip::Controller::BarrierControlCluster clusterBarrierControl;
54     (void) ZCLgroupId;
55     clusterBarrierControl.Associate(device, ZCLendpointId);
56     return clusterBarrierControl.BarrierControlStop(nullptr, nullptr);
57 }
58 // End of Cluster BarrierControl
59
60 // Cluster Basic
61 CHIP_ERROR chip_ime_AppendCommand_Basic_MfgSpecificPing(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
62                                                         chip::GroupId ZCLgroupId)
63 {
64     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
65     chip::Controller::BasicCluster clusterBasic;
66     (void) ZCLgroupId;
67     clusterBasic.Associate(device, ZCLendpointId);
68     return clusterBasic.MfgSpecificPing(nullptr, nullptr);
69 }
70 // End of Cluster Basic
71
72 // Cluster Binding
73 CHIP_ERROR chip_ime_AppendCommand_Binding_Bind(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
74                                                chip::GroupId ZCLgroupId, chip::NodeId nodeId, chip::GroupId groupId,
75                                                chip::EndpointId endpointId, chip::ClusterId clusterId)
76 {
77     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
78     chip::Controller::BindingCluster clusterBinding;
79     (void) ZCLgroupId;
80     clusterBinding.Associate(device, ZCLendpointId);
81     return clusterBinding.Bind(nullptr, nullptr, nodeId, groupId, endpointId, clusterId);
82 }
83 CHIP_ERROR chip_ime_AppendCommand_Binding_Unbind(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
84                                                  chip::GroupId ZCLgroupId, chip::NodeId nodeId, chip::GroupId groupId,
85                                                  chip::EndpointId endpointId, chip::ClusterId clusterId)
86 {
87     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
88     chip::Controller::BindingCluster clusterBinding;
89     (void) ZCLgroupId;
90     clusterBinding.Associate(device, ZCLendpointId);
91     return clusterBinding.Unbind(nullptr, nullptr, nodeId, groupId, endpointId, clusterId);
92 }
93 // End of Cluster Binding
94
95 // Cluster ColorControl
96 CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveColor(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
97                                                          chip::GroupId ZCLgroupId, int16_t rateX, int16_t rateY,
98                                                          uint8_t optionsMask, uint8_t optionsOverride)
99 {
100     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
101     chip::Controller::ColorControlCluster clusterColorControl;
102     (void) ZCLgroupId;
103     clusterColorControl.Associate(device, ZCLendpointId);
104     return clusterColorControl.MoveColor(nullptr, nullptr, rateX, rateY, optionsMask, optionsOverride);
105 }
106 CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveColorTemperature(
107     chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId, uint8_t moveMode, uint16_t rate,
108     uint16_t colorTemperatureMinimum, uint16_t colorTemperatureMaximum, uint8_t optionsMask, uint8_t optionsOverride)
109 {
110     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
111     chip::Controller::ColorControlCluster clusterColorControl;
112     (void) ZCLgroupId;
113     clusterColorControl.Associate(device, ZCLendpointId);
114     return clusterColorControl.MoveColorTemperature(nullptr, nullptr, moveMode, rate, colorTemperatureMinimum,
115                                                     colorTemperatureMaximum, optionsMask, optionsOverride);
116 }
117 CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
118                                                        chip::GroupId ZCLgroupId, uint8_t moveMode, uint8_t rate,
119                                                        uint8_t optionsMask, uint8_t optionsOverride)
120 {
121     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
122     chip::Controller::ColorControlCluster clusterColorControl;
123     (void) ZCLgroupId;
124     clusterColorControl.Associate(device, ZCLendpointId);
125     return clusterColorControl.MoveHue(nullptr, nullptr, moveMode, rate, optionsMask, optionsOverride);
126 }
127 CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveSaturation(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
128                                                               chip::GroupId ZCLgroupId, uint8_t moveMode, uint8_t rate,
129                                                               uint8_t optionsMask, uint8_t optionsOverride)
130 {
131     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
132     chip::Controller::ColorControlCluster clusterColorControl;
133     (void) ZCLgroupId;
134     clusterColorControl.Associate(device, ZCLendpointId);
135     return clusterColorControl.MoveSaturation(nullptr, nullptr, moveMode, rate, optionsMask, optionsOverride);
136 }
137 CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveToColor(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
138                                                            chip::GroupId ZCLgroupId, uint16_t colorX, uint16_t colorY,
139                                                            uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride)
140 {
141     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
142     chip::Controller::ColorControlCluster clusterColorControl;
143     (void) ZCLgroupId;
144     clusterColorControl.Associate(device, ZCLendpointId);
145     return clusterColorControl.MoveToColor(nullptr, nullptr, colorX, colorY, transitionTime, optionsMask, optionsOverride);
146 }
147 CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveToColorTemperature(chip::Controller::Device * device,
148                                                                       chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
149                                                                       uint16_t colorTemperature, uint16_t transitionTime,
150                                                                       uint8_t optionsMask, uint8_t optionsOverride)
151 {
152     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
153     chip::Controller::ColorControlCluster clusterColorControl;
154     (void) ZCLgroupId;
155     clusterColorControl.Associate(device, ZCLendpointId);
156     return clusterColorControl.MoveToColorTemperature(nullptr, nullptr, colorTemperature, transitionTime, optionsMask,
157                                                       optionsOverride);
158 }
159 CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveToHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
160                                                          chip::GroupId ZCLgroupId, uint8_t hue, uint8_t direction,
161                                                          uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride)
162 {
163     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
164     chip::Controller::ColorControlCluster clusterColorControl;
165     (void) ZCLgroupId;
166     clusterColorControl.Associate(device, ZCLendpointId);
167     return clusterColorControl.MoveToHue(nullptr, nullptr, hue, direction, transitionTime, optionsMask, optionsOverride);
168 }
169 CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveToHueAndSaturation(chip::Controller::Device * device,
170                                                                       chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
171                                                                       uint8_t hue, uint8_t saturation, uint16_t transitionTime,
172                                                                       uint8_t optionsMask, uint8_t optionsOverride)
173 {
174     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
175     chip::Controller::ColorControlCluster clusterColorControl;
176     (void) ZCLgroupId;
177     clusterColorControl.Associate(device, ZCLendpointId);
178     return clusterColorControl.MoveToHueAndSaturation(nullptr, nullptr, hue, saturation, transitionTime, optionsMask,
179                                                       optionsOverride);
180 }
181 CHIP_ERROR chip_ime_AppendCommand_ColorControl_MoveToSaturation(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
182                                                                 chip::GroupId ZCLgroupId, uint8_t saturation,
183                                                                 uint16_t transitionTime, uint8_t optionsMask,
184                                                                 uint8_t optionsOverride)
185 {
186     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
187     chip::Controller::ColorControlCluster clusterColorControl;
188     (void) ZCLgroupId;
189     clusterColorControl.Associate(device, ZCLendpointId);
190     return clusterColorControl.MoveToSaturation(nullptr, nullptr, saturation, transitionTime, optionsMask, optionsOverride);
191 }
192 CHIP_ERROR chip_ime_AppendCommand_ColorControl_StepColor(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
193                                                          chip::GroupId ZCLgroupId, int16_t stepX, int16_t stepY,
194                                                          uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride)
195 {
196     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
197     chip::Controller::ColorControlCluster clusterColorControl;
198     (void) ZCLgroupId;
199     clusterColorControl.Associate(device, ZCLendpointId);
200     return clusterColorControl.StepColor(nullptr, nullptr, stepX, stepY, transitionTime, optionsMask, optionsOverride);
201 }
202 CHIP_ERROR chip_ime_AppendCommand_ColorControl_StepColorTemperature(chip::Controller::Device * device,
203                                                                     chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
204                                                                     uint8_t stepMode, uint16_t stepSize, uint16_t transitionTime,
205                                                                     uint16_t colorTemperatureMinimum,
206                                                                     uint16_t colorTemperatureMaximum, uint8_t optionsMask,
207                                                                     uint8_t optionsOverride)
208 {
209     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
210     chip::Controller::ColorControlCluster clusterColorControl;
211     (void) ZCLgroupId;
212     clusterColorControl.Associate(device, ZCLendpointId);
213     return clusterColorControl.StepColorTemperature(nullptr, nullptr, stepMode, stepSize, transitionTime, colorTemperatureMinimum,
214                                                     colorTemperatureMaximum, optionsMask, optionsOverride);
215 }
216 CHIP_ERROR chip_ime_AppendCommand_ColorControl_StepHue(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
217                                                        chip::GroupId ZCLgroupId, uint8_t stepMode, uint8_t stepSize,
218                                                        uint8_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride)
219 {
220     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
221     chip::Controller::ColorControlCluster clusterColorControl;
222     (void) ZCLgroupId;
223     clusterColorControl.Associate(device, ZCLendpointId);
224     return clusterColorControl.StepHue(nullptr, nullptr, stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
225 }
226 CHIP_ERROR chip_ime_AppendCommand_ColorControl_StepSaturation(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
227                                                               chip::GroupId ZCLgroupId, uint8_t stepMode, uint8_t stepSize,
228                                                               uint8_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride)
229 {
230     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
231     chip::Controller::ColorControlCluster clusterColorControl;
232     (void) ZCLgroupId;
233     clusterColorControl.Associate(device, ZCLendpointId);
234     return clusterColorControl.StepSaturation(nullptr, nullptr, stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
235 }
236 CHIP_ERROR chip_ime_AppendCommand_ColorControl_StopMoveStep(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
237                                                             chip::GroupId ZCLgroupId, uint8_t optionsMask, uint8_t optionsOverride)
238 {
239     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
240     chip::Controller::ColorControlCluster clusterColorControl;
241     (void) ZCLgroupId;
242     clusterColorControl.Associate(device, ZCLendpointId);
243     return clusterColorControl.StopMoveStep(nullptr, nullptr, optionsMask, optionsOverride);
244 }
245 // End of Cluster ColorControl
246
247 // Cluster ContentLaunch
248 CHIP_ERROR chip_ime_AppendCommand_ContentLaunch_LaunchContent(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
249                                                               chip::GroupId ZCLgroupId)
250 {
251     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
252     chip::Controller::ContentLaunchCluster clusterContentLaunch;
253     (void) ZCLgroupId;
254     clusterContentLaunch.Associate(device, ZCLendpointId);
255     return clusterContentLaunch.LaunchContent(nullptr, nullptr);
256 }
257 CHIP_ERROR chip_ime_AppendCommand_ContentLaunch_LaunchURL(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
258                                                           chip::GroupId ZCLgroupId)
259 {
260     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
261     chip::Controller::ContentLaunchCluster clusterContentLaunch;
262     (void) ZCLgroupId;
263     clusterContentLaunch.Associate(device, ZCLendpointId);
264     return clusterContentLaunch.LaunchURL(nullptr, nullptr);
265 }
266 // End of Cluster ContentLaunch
267
268 // Cluster DoorLock
269 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearAllPins(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
270                                                         chip::GroupId ZCLgroupId)
271 {
272     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
273     chip::Controller::DoorLockCluster clusterDoorLock;
274     (void) ZCLgroupId;
275     clusterDoorLock.Associate(device, ZCLendpointId);
276     return clusterDoorLock.ClearAllPins(nullptr, nullptr);
277 }
278 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearAllRfids(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
279                                                          chip::GroupId ZCLgroupId)
280 {
281     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
282     chip::Controller::DoorLockCluster clusterDoorLock;
283     (void) ZCLgroupId;
284     clusterDoorLock.Associate(device, ZCLendpointId);
285     return clusterDoorLock.ClearAllRfids(nullptr, nullptr);
286 }
287 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearHolidaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
288                                                                 chip::GroupId ZCLgroupId, uint8_t scheduleId)
289 {
290     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
291     chip::Controller::DoorLockCluster clusterDoorLock;
292     (void) ZCLgroupId;
293     clusterDoorLock.Associate(device, ZCLendpointId);
294     return clusterDoorLock.ClearHolidaySchedule(nullptr, nullptr, scheduleId);
295 }
296 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearPin(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
297                                                     chip::GroupId ZCLgroupId, uint16_t userId)
298 {
299     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
300     chip::Controller::DoorLockCluster clusterDoorLock;
301     (void) ZCLgroupId;
302     clusterDoorLock.Associate(device, ZCLendpointId);
303     return clusterDoorLock.ClearPin(nullptr, nullptr, userId);
304 }
305 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearRfid(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
306                                                      chip::GroupId ZCLgroupId, uint16_t userId)
307 {
308     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
309     chip::Controller::DoorLockCluster clusterDoorLock;
310     (void) ZCLgroupId;
311     clusterDoorLock.Associate(device, ZCLendpointId);
312     return clusterDoorLock.ClearRfid(nullptr, nullptr, userId);
313 }
314 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearWeekdaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
315                                                                 chip::GroupId ZCLgroupId, uint8_t scheduleId, uint16_t userId)
316 {
317     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
318     chip::Controller::DoorLockCluster clusterDoorLock;
319     (void) ZCLgroupId;
320     clusterDoorLock.Associate(device, ZCLendpointId);
321     return clusterDoorLock.ClearWeekdaySchedule(nullptr, nullptr, scheduleId, userId);
322 }
323 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearYeardaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
324                                                                 chip::GroupId ZCLgroupId, uint8_t scheduleId, uint16_t userId)
325 {
326     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
327     chip::Controller::DoorLockCluster clusterDoorLock;
328     (void) ZCLgroupId;
329     clusterDoorLock.Associate(device, ZCLendpointId);
330     return clusterDoorLock.ClearYeardaySchedule(nullptr, nullptr, scheduleId, userId);
331 }
332 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetHolidaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
333                                                               chip::GroupId ZCLgroupId, uint8_t scheduleId)
334 {
335     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
336     chip::Controller::DoorLockCluster clusterDoorLock;
337     (void) ZCLgroupId;
338     clusterDoorLock.Associate(device, ZCLendpointId);
339     return clusterDoorLock.GetHolidaySchedule(nullptr, nullptr, scheduleId);
340 }
341 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetLogRecord(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
342                                                         chip::GroupId ZCLgroupId, uint16_t logIndex)
343 {
344     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
345     chip::Controller::DoorLockCluster clusterDoorLock;
346     (void) ZCLgroupId;
347     clusterDoorLock.Associate(device, ZCLendpointId);
348     return clusterDoorLock.GetLogRecord(nullptr, nullptr, logIndex);
349 }
350 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetPin(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
351                                                   chip::GroupId ZCLgroupId, uint16_t userId)
352 {
353     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
354     chip::Controller::DoorLockCluster clusterDoorLock;
355     (void) ZCLgroupId;
356     clusterDoorLock.Associate(device, ZCLendpointId);
357     return clusterDoorLock.GetPin(nullptr, nullptr, userId);
358 }
359 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetRfid(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
360                                                    chip::GroupId ZCLgroupId, uint16_t userId)
361 {
362     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
363     chip::Controller::DoorLockCluster clusterDoorLock;
364     (void) ZCLgroupId;
365     clusterDoorLock.Associate(device, ZCLendpointId);
366     return clusterDoorLock.GetRfid(nullptr, nullptr, userId);
367 }
368 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetUserType(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
369                                                        chip::GroupId ZCLgroupId, uint16_t userId)
370 {
371     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
372     chip::Controller::DoorLockCluster clusterDoorLock;
373     (void) ZCLgroupId;
374     clusterDoorLock.Associate(device, ZCLendpointId);
375     return clusterDoorLock.GetUserType(nullptr, nullptr, userId);
376 }
377 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetWeekdaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
378                                                               chip::GroupId ZCLgroupId, uint8_t scheduleId, uint16_t userId)
379 {
380     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
381     chip::Controller::DoorLockCluster clusterDoorLock;
382     (void) ZCLgroupId;
383     clusterDoorLock.Associate(device, ZCLendpointId);
384     return clusterDoorLock.GetWeekdaySchedule(nullptr, nullptr, scheduleId, userId);
385 }
386 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetYeardaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
387                                                               chip::GroupId ZCLgroupId, uint8_t scheduleId, uint16_t userId)
388 {
389     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
390     chip::Controller::DoorLockCluster clusterDoorLock;
391     (void) ZCLgroupId;
392     clusterDoorLock.Associate(device, ZCLendpointId);
393     return clusterDoorLock.GetYeardaySchedule(nullptr, nullptr, scheduleId, userId);
394 }
395 CHIP_ERROR chip_ime_AppendCommand_DoorLock_LockDoor(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
396                                                     chip::GroupId ZCLgroupId, const uint8_t * pin, uint32_t pin_Len)
397 {
398     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
399     chip::Controller::DoorLockCluster clusterDoorLock;
400     (void) ZCLgroupId;
401     clusterDoorLock.Associate(device, ZCLendpointId);
402     return clusterDoorLock.LockDoor(nullptr, nullptr, chip::ByteSpan(pin, pin_Len));
403 }
404 CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetHolidaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
405                                                               chip::GroupId ZCLgroupId, uint8_t scheduleId, uint32_t localStartTime,
406                                                               uint32_t localEndTime, uint8_t operatingModeDuringHoliday)
407 {
408     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
409     chip::Controller::DoorLockCluster clusterDoorLock;
410     (void) ZCLgroupId;
411     clusterDoorLock.Associate(device, ZCLendpointId);
412     return clusterDoorLock.SetHolidaySchedule(nullptr, nullptr, scheduleId, localStartTime, localEndTime,
413                                               operatingModeDuringHoliday);
414 }
415 CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetPin(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
416                                                   chip::GroupId ZCLgroupId, uint16_t userId, uint8_t userStatus, uint8_t userType,
417                                                   const uint8_t * pin, uint32_t pin_Len)
418 {
419     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
420     chip::Controller::DoorLockCluster clusterDoorLock;
421     (void) ZCLgroupId;
422     clusterDoorLock.Associate(device, ZCLendpointId);
423     return clusterDoorLock.SetPin(nullptr, nullptr, userId, userStatus, userType, chip::ByteSpan(pin, pin_Len));
424 }
425 CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetRfid(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
426                                                    chip::GroupId ZCLgroupId, uint16_t userId, uint8_t userStatus, uint8_t userType,
427                                                    const uint8_t * id, uint32_t id_Len)
428 {
429     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
430     chip::Controller::DoorLockCluster clusterDoorLock;
431     (void) ZCLgroupId;
432     clusterDoorLock.Associate(device, ZCLendpointId);
433     return clusterDoorLock.SetRfid(nullptr, nullptr, userId, userStatus, userType, chip::ByteSpan(id, id_Len));
434 }
435 CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetUserType(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
436                                                        chip::GroupId ZCLgroupId, uint16_t userId, uint8_t userType)
437 {
438     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
439     chip::Controller::DoorLockCluster clusterDoorLock;
440     (void) ZCLgroupId;
441     clusterDoorLock.Associate(device, ZCLendpointId);
442     return clusterDoorLock.SetUserType(nullptr, nullptr, userId, userType);
443 }
444 CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetWeekdaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
445                                                               chip::GroupId ZCLgroupId, uint8_t scheduleId, uint16_t userId,
446                                                               uint8_t daysMask, uint8_t startHour, uint8_t startMinute,
447                                                               uint8_t endHour, uint8_t endMinute)
448 {
449     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
450     chip::Controller::DoorLockCluster clusterDoorLock;
451     (void) ZCLgroupId;
452     clusterDoorLock.Associate(device, ZCLendpointId);
453     return clusterDoorLock.SetWeekdaySchedule(nullptr, nullptr, scheduleId, userId, daysMask, startHour, startMinute, endHour,
454                                               endMinute);
455 }
456 CHIP_ERROR chip_ime_AppendCommand_DoorLock_SetYeardaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
457                                                               chip::GroupId ZCLgroupId, uint8_t scheduleId, uint16_t userId,
458                                                               uint32_t localStartTime, uint32_t localEndTime)
459 {
460     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
461     chip::Controller::DoorLockCluster clusterDoorLock;
462     (void) ZCLgroupId;
463     clusterDoorLock.Associate(device, ZCLendpointId);
464     return clusterDoorLock.SetYeardaySchedule(nullptr, nullptr, scheduleId, userId, localStartTime, localEndTime);
465 }
466 CHIP_ERROR chip_ime_AppendCommand_DoorLock_UnlockDoor(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
467                                                       chip::GroupId ZCLgroupId, const uint8_t * pin, uint32_t pin_Len)
468 {
469     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
470     chip::Controller::DoorLockCluster clusterDoorLock;
471     (void) ZCLgroupId;
472     clusterDoorLock.Associate(device, ZCLendpointId);
473     return clusterDoorLock.UnlockDoor(nullptr, nullptr, chip::ByteSpan(pin, pin_Len));
474 }
475 CHIP_ERROR chip_ime_AppendCommand_DoorLock_UnlockWithTimeout(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
476                                                              chip::GroupId ZCLgroupId, uint16_t timeoutInSeconds,
477                                                              const uint8_t * pin, uint32_t pin_Len)
478 {
479     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
480     chip::Controller::DoorLockCluster clusterDoorLock;
481     (void) ZCLgroupId;
482     clusterDoorLock.Associate(device, ZCLendpointId);
483     return clusterDoorLock.UnlockWithTimeout(nullptr, nullptr, timeoutInSeconds, chip::ByteSpan(pin, pin_Len));
484 }
485 // End of Cluster DoorLock
486
487 // Cluster GeneralCommissioning
488 CHIP_ERROR chip_ime_AppendCommand_GeneralCommissioning_ArmFailSafe(chip::Controller::Device * device,
489                                                                    chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
490                                                                    uint16_t expiryLengthSeconds, uint64_t breadcrumb,
491                                                                    uint32_t timeoutMs)
492 {
493     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
494     chip::Controller::GeneralCommissioningCluster clusterGeneralCommissioning;
495     (void) ZCLgroupId;
496     clusterGeneralCommissioning.Associate(device, ZCLendpointId);
497     return clusterGeneralCommissioning.ArmFailSafe(nullptr, nullptr, expiryLengthSeconds, breadcrumb, timeoutMs);
498 }
499 CHIP_ERROR chip_ime_AppendCommand_GeneralCommissioning_CommissioningComplete(chip::Controller::Device * device,
500                                                                              chip::EndpointId ZCLendpointId,
501                                                                              chip::GroupId ZCLgroupId)
502 {
503     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
504     chip::Controller::GeneralCommissioningCluster clusterGeneralCommissioning;
505     (void) ZCLgroupId;
506     clusterGeneralCommissioning.Associate(device, ZCLendpointId);
507     return clusterGeneralCommissioning.CommissioningComplete(nullptr, nullptr);
508 }
509 CHIP_ERROR chip_ime_AppendCommand_GeneralCommissioning_SetFabric(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
510                                                                  chip::GroupId ZCLgroupId, const uint8_t * fabricId,
511                                                                  uint32_t fabricId_Len, const uint8_t * fabricSecret,
512                                                                  uint32_t fabricSecret_Len, uint64_t breadcrumb, uint32_t timeoutMs)
513 {
514     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
515     chip::Controller::GeneralCommissioningCluster clusterGeneralCommissioning;
516     (void) ZCLgroupId;
517     clusterGeneralCommissioning.Associate(device, ZCLendpointId);
518     return clusterGeneralCommissioning.SetFabric(nullptr, nullptr, chip::ByteSpan(fabricId, fabricId_Len),
519                                                  chip::ByteSpan(fabricSecret, fabricSecret_Len), breadcrumb, timeoutMs);
520 }
521 // End of Cluster GeneralCommissioning
522
523 // Cluster Groups
524 CHIP_ERROR chip_ime_AppendCommand_Groups_AddGroup(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
525                                                   chip::GroupId ZCLgroupId, uint16_t groupId, const uint8_t * groupName,
526                                                   uint32_t groupName_Len)
527 {
528     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
529     chip::Controller::GroupsCluster clusterGroups;
530     (void) ZCLgroupId;
531     clusterGroups.Associate(device, ZCLendpointId);
532     return clusterGroups.AddGroup(nullptr, nullptr, groupId, chip::ByteSpan(groupName, groupName_Len));
533 }
534 CHIP_ERROR chip_ime_AppendCommand_Groups_AddGroupIfIdentifying(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
535                                                                chip::GroupId ZCLgroupId, uint16_t groupId,
536                                                                const uint8_t * groupName, uint32_t groupName_Len)
537 {
538     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
539     chip::Controller::GroupsCluster clusterGroups;
540     (void) ZCLgroupId;
541     clusterGroups.Associate(device, ZCLendpointId);
542     return clusterGroups.AddGroupIfIdentifying(nullptr, nullptr, groupId, chip::ByteSpan(groupName, groupName_Len));
543 }
544 CHIP_ERROR chip_ime_AppendCommand_Groups_GetGroupMembership(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
545                                                             chip::GroupId ZCLgroupId, uint8_t groupCount, uint16_t groupList)
546 {
547     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
548     chip::Controller::GroupsCluster clusterGroups;
549     (void) ZCLgroupId;
550     clusterGroups.Associate(device, ZCLendpointId);
551     return clusterGroups.GetGroupMembership(nullptr, nullptr, groupCount, groupList);
552 }
553 CHIP_ERROR chip_ime_AppendCommand_Groups_RemoveAllGroups(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
554                                                          chip::GroupId ZCLgroupId)
555 {
556     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
557     chip::Controller::GroupsCluster clusterGroups;
558     (void) ZCLgroupId;
559     clusterGroups.Associate(device, ZCLendpointId);
560     return clusterGroups.RemoveAllGroups(nullptr, nullptr);
561 }
562 CHIP_ERROR chip_ime_AppendCommand_Groups_RemoveGroup(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
563                                                      chip::GroupId ZCLgroupId, uint16_t groupId)
564 {
565     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
566     chip::Controller::GroupsCluster clusterGroups;
567     (void) ZCLgroupId;
568     clusterGroups.Associate(device, ZCLendpointId);
569     return clusterGroups.RemoveGroup(nullptr, nullptr, groupId);
570 }
571 CHIP_ERROR chip_ime_AppendCommand_Groups_ViewGroup(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
572                                                    chip::GroupId ZCLgroupId, uint16_t groupId)
573 {
574     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
575     chip::Controller::GroupsCluster clusterGroups;
576     (void) ZCLgroupId;
577     clusterGroups.Associate(device, ZCLendpointId);
578     return clusterGroups.ViewGroup(nullptr, nullptr, groupId);
579 }
580 // End of Cluster Groups
581
582 // Cluster IasZone
583 // End of Cluster IasZone
584
585 // Cluster Identify
586 CHIP_ERROR chip_ime_AppendCommand_Identify_Identify(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
587                                                     chip::GroupId ZCLgroupId, uint16_t identifyTime)
588 {
589     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
590     chip::Controller::IdentifyCluster clusterIdentify;
591     (void) ZCLgroupId;
592     clusterIdentify.Associate(device, ZCLendpointId);
593     return clusterIdentify.Identify(nullptr, nullptr, identifyTime);
594 }
595 CHIP_ERROR chip_ime_AppendCommand_Identify_IdentifyQuery(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
596                                                          chip::GroupId ZCLgroupId)
597 {
598     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
599     chip::Controller::IdentifyCluster clusterIdentify;
600     (void) ZCLgroupId;
601     clusterIdentify.Associate(device, ZCLendpointId);
602     return clusterIdentify.IdentifyQuery(nullptr, nullptr);
603 }
604 // End of Cluster Identify
605
606 // Cluster LevelControl
607 CHIP_ERROR chip_ime_AppendCommand_LevelControl_Move(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
608                                                     chip::GroupId ZCLgroupId, uint8_t moveMode, uint8_t rate, uint8_t optionMask,
609                                                     uint8_t optionOverride)
610 {
611     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
612     chip::Controller::LevelControlCluster clusterLevelControl;
613     (void) ZCLgroupId;
614     clusterLevelControl.Associate(device, ZCLendpointId);
615     return clusterLevelControl.Move(nullptr, nullptr, moveMode, rate, optionMask, optionOverride);
616 }
617 CHIP_ERROR chip_ime_AppendCommand_LevelControl_MoveToLevel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
618                                                            chip::GroupId ZCLgroupId, uint8_t level, uint16_t transitionTime,
619                                                            uint8_t optionMask, uint8_t optionOverride)
620 {
621     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
622     chip::Controller::LevelControlCluster clusterLevelControl;
623     (void) ZCLgroupId;
624     clusterLevelControl.Associate(device, ZCLendpointId);
625     return clusterLevelControl.MoveToLevel(nullptr, nullptr, level, transitionTime, optionMask, optionOverride);
626 }
627 CHIP_ERROR chip_ime_AppendCommand_LevelControl_MoveToLevelWithOnOff(chip::Controller::Device * device,
628                                                                     chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
629                                                                     uint8_t level, uint16_t transitionTime)
630 {
631     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
632     chip::Controller::LevelControlCluster clusterLevelControl;
633     (void) ZCLgroupId;
634     clusterLevelControl.Associate(device, ZCLendpointId);
635     return clusterLevelControl.MoveToLevelWithOnOff(nullptr, nullptr, level, transitionTime);
636 }
637 CHIP_ERROR chip_ime_AppendCommand_LevelControl_MoveWithOnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
638                                                              chip::GroupId ZCLgroupId, uint8_t moveMode, uint8_t rate)
639 {
640     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
641     chip::Controller::LevelControlCluster clusterLevelControl;
642     (void) ZCLgroupId;
643     clusterLevelControl.Associate(device, ZCLendpointId);
644     return clusterLevelControl.MoveWithOnOff(nullptr, nullptr, moveMode, rate);
645 }
646 CHIP_ERROR chip_ime_AppendCommand_LevelControl_Step(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
647                                                     chip::GroupId ZCLgroupId, uint8_t stepMode, uint8_t stepSize,
648                                                     uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride)
649 {
650     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
651     chip::Controller::LevelControlCluster clusterLevelControl;
652     (void) ZCLgroupId;
653     clusterLevelControl.Associate(device, ZCLendpointId);
654     return clusterLevelControl.Step(nullptr, nullptr, stepMode, stepSize, transitionTime, optionMask, optionOverride);
655 }
656 CHIP_ERROR chip_ime_AppendCommand_LevelControl_StepWithOnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
657                                                              chip::GroupId ZCLgroupId, uint8_t stepMode, uint8_t stepSize,
658                                                              uint16_t transitionTime)
659 {
660     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
661     chip::Controller::LevelControlCluster clusterLevelControl;
662     (void) ZCLgroupId;
663     clusterLevelControl.Associate(device, ZCLendpointId);
664     return clusterLevelControl.StepWithOnOff(nullptr, nullptr, stepMode, stepSize, transitionTime);
665 }
666 CHIP_ERROR chip_ime_AppendCommand_LevelControl_Stop(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
667                                                     chip::GroupId ZCLgroupId, uint8_t optionMask, uint8_t optionOverride)
668 {
669     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
670     chip::Controller::LevelControlCluster clusterLevelControl;
671     (void) ZCLgroupId;
672     clusterLevelControl.Associate(device, ZCLendpointId);
673     return clusterLevelControl.Stop(nullptr, nullptr, optionMask, optionOverride);
674 }
675 CHIP_ERROR chip_ime_AppendCommand_LevelControl_StopWithOnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
676                                                              chip::GroupId ZCLgroupId)
677 {
678     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
679     chip::Controller::LevelControlCluster clusterLevelControl;
680     (void) ZCLgroupId;
681     clusterLevelControl.Associate(device, ZCLendpointId);
682     return clusterLevelControl.StopWithOnOff(nullptr, nullptr);
683 }
684 // End of Cluster LevelControl
685
686 // Cluster LowPower
687 CHIP_ERROR chip_ime_AppendCommand_LowPower_Sleep(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
688                                                  chip::GroupId ZCLgroupId)
689 {
690     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
691     chip::Controller::LowPowerCluster clusterLowPower;
692     (void) ZCLgroupId;
693     clusterLowPower.Associate(device, ZCLendpointId);
694     return clusterLowPower.Sleep(nullptr, nullptr);
695 }
696 // End of Cluster LowPower
697
698 // Cluster MediaPlayback
699 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_FastForwardRequest(chip::Controller::Device * device,
700                                                                    chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId)
701 {
702     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
703     chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
704     (void) ZCLgroupId;
705     clusterMediaPlayback.Associate(device, ZCLendpointId);
706     return clusterMediaPlayback.FastForwardRequest(nullptr, nullptr);
707 }
708 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_NextRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
709                                                             chip::GroupId ZCLgroupId)
710 {
711     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
712     chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
713     (void) ZCLgroupId;
714     clusterMediaPlayback.Associate(device, ZCLendpointId);
715     return clusterMediaPlayback.NextRequest(nullptr, nullptr);
716 }
717 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_PauseRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
718                                                              chip::GroupId ZCLgroupId)
719 {
720     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
721     chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
722     (void) ZCLgroupId;
723     clusterMediaPlayback.Associate(device, ZCLendpointId);
724     return clusterMediaPlayback.PauseRequest(nullptr, nullptr);
725 }
726 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_PlayRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
727                                                             chip::GroupId ZCLgroupId)
728 {
729     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
730     chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
731     (void) ZCLgroupId;
732     clusterMediaPlayback.Associate(device, ZCLendpointId);
733     return clusterMediaPlayback.PlayRequest(nullptr, nullptr);
734 }
735 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_PreviousRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
736                                                                 chip::GroupId ZCLgroupId)
737 {
738     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
739     chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
740     (void) ZCLgroupId;
741     clusterMediaPlayback.Associate(device, ZCLendpointId);
742     return clusterMediaPlayback.PreviousRequest(nullptr, nullptr);
743 }
744 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_RewindRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
745                                                               chip::GroupId ZCLgroupId)
746 {
747     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
748     chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
749     (void) ZCLgroupId;
750     clusterMediaPlayback.Associate(device, ZCLendpointId);
751     return clusterMediaPlayback.RewindRequest(nullptr, nullptr);
752 }
753 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_SkipBackwardRequest(chip::Controller::Device * device,
754                                                                     chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId)
755 {
756     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
757     chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
758     (void) ZCLgroupId;
759     clusterMediaPlayback.Associate(device, ZCLendpointId);
760     return clusterMediaPlayback.SkipBackwardRequest(nullptr, nullptr);
761 }
762 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_SkipForwardRequest(chip::Controller::Device * device,
763                                                                    chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId)
764 {
765     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
766     chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
767     (void) ZCLgroupId;
768     clusterMediaPlayback.Associate(device, ZCLendpointId);
769     return clusterMediaPlayback.SkipForwardRequest(nullptr, nullptr);
770 }
771 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_StartOverRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
772                                                                  chip::GroupId ZCLgroupId)
773 {
774     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
775     chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
776     (void) ZCLgroupId;
777     clusterMediaPlayback.Associate(device, ZCLendpointId);
778     return clusterMediaPlayback.StartOverRequest(nullptr, nullptr);
779 }
780 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_StopRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
781                                                             chip::GroupId ZCLgroupId)
782 {
783     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
784     chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
785     (void) ZCLgroupId;
786     clusterMediaPlayback.Associate(device, ZCLendpointId);
787     return clusterMediaPlayback.StopRequest(nullptr, nullptr);
788 }
789 // End of Cluster MediaPlayback
790
791 // Cluster NetworkCommissioning
792 CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_AddThreadNetwork(chip::Controller::Device * device,
793                                                                         chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
794                                                                         const uint8_t * operationalDataset,
795                                                                         uint32_t operationalDataset_Len, uint64_t breadcrumb,
796                                                                         uint32_t timeoutMs)
797 {
798     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
799     chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
800     (void) ZCLgroupId;
801     clusterNetworkCommissioning.Associate(device, ZCLendpointId);
802     return clusterNetworkCommissioning.AddThreadNetwork(
803         nullptr, nullptr, chip::ByteSpan(operationalDataset, operationalDataset_Len), breadcrumb, timeoutMs);
804 }
805 CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_AddWiFiNetwork(chip::Controller::Device * device,
806                                                                       chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
807                                                                       const uint8_t * ssid, uint32_t ssid_Len,
808                                                                       const uint8_t * credentials, uint32_t credentials_Len,
809                                                                       uint64_t breadcrumb, uint32_t timeoutMs)
810 {
811     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
812     chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
813     (void) ZCLgroupId;
814     clusterNetworkCommissioning.Associate(device, ZCLendpointId);
815     return clusterNetworkCommissioning.AddWiFiNetwork(nullptr, nullptr, chip::ByteSpan(ssid, ssid_Len),
816                                                       chip::ByteSpan(credentials, credentials_Len), breadcrumb, timeoutMs);
817 }
818 CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_DisableNetwork(chip::Controller::Device * device,
819                                                                       chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
820                                                                       const uint8_t * networkID, uint32_t networkID_Len,
821                                                                       uint64_t breadcrumb, uint32_t timeoutMs)
822 {
823     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
824     chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
825     (void) ZCLgroupId;
826     clusterNetworkCommissioning.Associate(device, ZCLendpointId);
827     return clusterNetworkCommissioning.DisableNetwork(nullptr, nullptr, chip::ByteSpan(networkID, networkID_Len), breadcrumb,
828                                                       timeoutMs);
829 }
830 CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_EnableNetwork(chip::Controller::Device * device,
831                                                                      chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
832                                                                      const uint8_t * networkID, uint32_t networkID_Len,
833                                                                      uint64_t breadcrumb, uint32_t timeoutMs)
834 {
835     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
836     chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
837     (void) ZCLgroupId;
838     clusterNetworkCommissioning.Associate(device, ZCLendpointId);
839     return clusterNetworkCommissioning.EnableNetwork(nullptr, nullptr, chip::ByteSpan(networkID, networkID_Len), breadcrumb,
840                                                      timeoutMs);
841 }
842 CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_GetLastNetworkCommissioningResult(chip::Controller::Device * device,
843                                                                                          chip::EndpointId ZCLendpointId,
844                                                                                          chip::GroupId ZCLgroupId,
845                                                                                          uint32_t timeoutMs)
846 {
847     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
848     chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
849     (void) ZCLgroupId;
850     clusterNetworkCommissioning.Associate(device, ZCLendpointId);
851     return clusterNetworkCommissioning.GetLastNetworkCommissioningResult(nullptr, nullptr, timeoutMs);
852 }
853 CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_RemoveNetwork(chip::Controller::Device * device,
854                                                                      chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
855                                                                      const uint8_t * networkID, uint32_t networkID_Len,
856                                                                      uint64_t breadcrumb, uint32_t timeoutMs)
857 {
858     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
859     chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
860     (void) ZCLgroupId;
861     clusterNetworkCommissioning.Associate(device, ZCLendpointId);
862     return clusterNetworkCommissioning.RemoveNetwork(nullptr, nullptr, chip::ByteSpan(networkID, networkID_Len), breadcrumb,
863                                                      timeoutMs);
864 }
865 CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_ScanNetworks(chip::Controller::Device * device,
866                                                                     chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
867                                                                     const uint8_t * ssid, uint32_t ssid_Len, uint64_t breadcrumb,
868                                                                     uint32_t timeoutMs)
869 {
870     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
871     chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
872     (void) ZCLgroupId;
873     clusterNetworkCommissioning.Associate(device, ZCLendpointId);
874     return clusterNetworkCommissioning.ScanNetworks(nullptr, nullptr, chip::ByteSpan(ssid, ssid_Len), breadcrumb, timeoutMs);
875 }
876 CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_UpdateThreadNetwork(chip::Controller::Device * device,
877                                                                            chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
878                                                                            const uint8_t * operationalDataset,
879                                                                            uint32_t operationalDataset_Len, uint64_t breadcrumb,
880                                                                            uint32_t timeoutMs)
881 {
882     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
883     chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
884     (void) ZCLgroupId;
885     clusterNetworkCommissioning.Associate(device, ZCLendpointId);
886     return clusterNetworkCommissioning.UpdateThreadNetwork(
887         nullptr, nullptr, chip::ByteSpan(operationalDataset, operationalDataset_Len), breadcrumb, timeoutMs);
888 }
889 CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_UpdateWiFiNetwork(chip::Controller::Device * device,
890                                                                          chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
891                                                                          const uint8_t * ssid, uint32_t ssid_Len,
892                                                                          const uint8_t * credentials, uint32_t credentials_Len,
893                                                                          uint64_t breadcrumb, uint32_t timeoutMs)
894 {
895     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
896     chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
897     (void) ZCLgroupId;
898     clusterNetworkCommissioning.Associate(device, ZCLendpointId);
899     return clusterNetworkCommissioning.UpdateWiFiNetwork(nullptr, nullptr, chip::ByteSpan(ssid, ssid_Len),
900                                                          chip::ByteSpan(credentials, credentials_Len), breadcrumb, timeoutMs);
901 }
902 // End of Cluster NetworkCommissioning
903
904 // Cluster OnOff
905 CHIP_ERROR chip_ime_AppendCommand_OnOff_Off(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
906                                             chip::GroupId ZCLgroupId)
907 {
908     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
909     chip::Controller::OnOffCluster clusterOnOff;
910     (void) ZCLgroupId;
911     clusterOnOff.Associate(device, ZCLendpointId);
912     return clusterOnOff.Off(nullptr, nullptr);
913 }
914 CHIP_ERROR chip_ime_AppendCommand_OnOff_On(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
915                                            chip::GroupId ZCLgroupId)
916 {
917     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
918     chip::Controller::OnOffCluster clusterOnOff;
919     (void) ZCLgroupId;
920     clusterOnOff.Associate(device, ZCLendpointId);
921     return clusterOnOff.On(nullptr, nullptr);
922 }
923 CHIP_ERROR chip_ime_AppendCommand_OnOff_Toggle(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
924                                                chip::GroupId ZCLgroupId)
925 {
926     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
927     chip::Controller::OnOffCluster clusterOnOff;
928     (void) ZCLgroupId;
929     clusterOnOff.Associate(device, ZCLendpointId);
930     return clusterOnOff.Toggle(nullptr, nullptr);
931 }
932 // End of Cluster OnOff
933
934 // Cluster Scenes
935 CHIP_ERROR chip_ime_AppendCommand_Scenes_AddScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
936                                                   chip::GroupId ZCLgroupId, uint16_t groupId, uint8_t sceneId,
937                                                   uint16_t transitionTime, const uint8_t * sceneName, uint32_t sceneName_Len,
938                                                   chip::ClusterId clusterId, uint8_t length, uint8_t value)
939 {
940     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
941     chip::Controller::ScenesCluster clusterScenes;
942     (void) ZCLgroupId;
943     clusterScenes.Associate(device, ZCLendpointId);
944     return clusterScenes.AddScene(nullptr, nullptr, groupId, sceneId, transitionTime, chip::ByteSpan(sceneName, sceneName_Len),
945                                   clusterId, length, value);
946 }
947 CHIP_ERROR chip_ime_AppendCommand_Scenes_GetSceneMembership(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
948                                                             chip::GroupId ZCLgroupId, uint16_t groupId)
949 {
950     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
951     chip::Controller::ScenesCluster clusterScenes;
952     (void) ZCLgroupId;
953     clusterScenes.Associate(device, ZCLendpointId);
954     return clusterScenes.GetSceneMembership(nullptr, nullptr, groupId);
955 }
956 CHIP_ERROR chip_ime_AppendCommand_Scenes_RecallScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
957                                                      chip::GroupId ZCLgroupId, uint16_t groupId, uint8_t sceneId,
958                                                      uint16_t transitionTime)
959 {
960     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
961     chip::Controller::ScenesCluster clusterScenes;
962     (void) ZCLgroupId;
963     clusterScenes.Associate(device, ZCLendpointId);
964     return clusterScenes.RecallScene(nullptr, nullptr, groupId, sceneId, transitionTime);
965 }
966 CHIP_ERROR chip_ime_AppendCommand_Scenes_RemoveAllScenes(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
967                                                          chip::GroupId ZCLgroupId, uint16_t groupId)
968 {
969     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
970     chip::Controller::ScenesCluster clusterScenes;
971     (void) ZCLgroupId;
972     clusterScenes.Associate(device, ZCLendpointId);
973     return clusterScenes.RemoveAllScenes(nullptr, nullptr, groupId);
974 }
975 CHIP_ERROR chip_ime_AppendCommand_Scenes_RemoveScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
976                                                      chip::GroupId ZCLgroupId, uint16_t groupId, uint8_t sceneId)
977 {
978     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
979     chip::Controller::ScenesCluster clusterScenes;
980     (void) ZCLgroupId;
981     clusterScenes.Associate(device, ZCLendpointId);
982     return clusterScenes.RemoveScene(nullptr, nullptr, groupId, sceneId);
983 }
984 CHIP_ERROR chip_ime_AppendCommand_Scenes_StoreScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
985                                                     chip::GroupId ZCLgroupId, uint16_t groupId, uint8_t sceneId)
986 {
987     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
988     chip::Controller::ScenesCluster clusterScenes;
989     (void) ZCLgroupId;
990     clusterScenes.Associate(device, ZCLendpointId);
991     return clusterScenes.StoreScene(nullptr, nullptr, groupId, sceneId);
992 }
993 CHIP_ERROR chip_ime_AppendCommand_Scenes_ViewScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
994                                                    chip::GroupId ZCLgroupId, uint16_t groupId, uint8_t sceneId)
995 {
996     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
997     chip::Controller::ScenesCluster clusterScenes;
998     (void) ZCLgroupId;
999     clusterScenes.Associate(device, ZCLendpointId);
1000     return clusterScenes.ViewScene(nullptr, nullptr, groupId, sceneId);
1001 }
1002 // End of Cluster Scenes
1003
1004 // Cluster TemperatureMeasurement
1005 // End of Cluster TemperatureMeasurement
1006 }