3 * Copyright (c) 2021 Project CHIP Authors
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 // THIS FILE IS GENERATED BY ZAP
20 #include <core/CHIPCore.h>
22 #include <app/CommandSender.h>
23 #include <app/InteractionModelEngine.h>
24 #include <lib/support/Span.h>
25 #include <support/ReturnMacros.h>
27 #include <controller/CHIPClusters.h>
28 #include <controller/CHIPDevice.h>
31 using namespace chip::app;
35 // Cluster ApplicationBasic
36 // End of Cluster ApplicationBasic
38 // Cluster BarrierControl
39 CHIP_ERROR chip_ime_AppendCommand_BarrierControl_BarrierControlGoToPercent(chip::Controller::Device * device,
40 chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId,
43 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
44 chip::Controller::BarrierControlCluster clusterBarrierControl;
46 clusterBarrierControl.Associate(device, ZCLendpointId);
47 return clusterBarrierControl.BarrierControlGoToPercent(nullptr, nullptr, percentOpen);
49 CHIP_ERROR chip_ime_AppendCommand_BarrierControl_BarrierControlStop(chip::Controller::Device * device,
50 chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId)
52 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
53 chip::Controller::BarrierControlCluster clusterBarrierControl;
55 clusterBarrierControl.Associate(device, ZCLendpointId);
56 return clusterBarrierControl.BarrierControlStop(nullptr, nullptr);
58 // End of Cluster BarrierControl
61 CHIP_ERROR chip_ime_AppendCommand_Basic_MfgSpecificPing(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
62 chip::GroupId ZCLgroupId)
64 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
65 chip::Controller::BasicCluster clusterBasic;
67 clusterBasic.Associate(device, ZCLendpointId);
68 return clusterBasic.MfgSpecificPing(nullptr, nullptr);
70 // End of Cluster Basic
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)
77 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
78 chip::Controller::BindingCluster clusterBinding;
80 clusterBinding.Associate(device, ZCLendpointId);
81 return clusterBinding.Bind(nullptr, nullptr, nodeId, groupId, endpointId, clusterId);
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)
87 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
88 chip::Controller::BindingCluster clusterBinding;
90 clusterBinding.Associate(device, ZCLendpointId);
91 return clusterBinding.Unbind(nullptr, nullptr, nodeId, groupId, endpointId, clusterId);
93 // End of Cluster Binding
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)
100 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
101 chip::Controller::ColorControlCluster clusterColorControl;
103 clusterColorControl.Associate(device, ZCLendpointId);
104 return clusterColorControl.MoveColor(nullptr, nullptr, rateX, rateY, optionsMask, optionsOverride);
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)
110 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
111 chip::Controller::ColorControlCluster clusterColorControl;
113 clusterColorControl.Associate(device, ZCLendpointId);
114 return clusterColorControl.MoveColorTemperature(nullptr, nullptr, moveMode, rate, colorTemperatureMinimum,
115 colorTemperatureMaximum, optionsMask, optionsOverride);
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)
121 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
122 chip::Controller::ColorControlCluster clusterColorControl;
124 clusterColorControl.Associate(device, ZCLendpointId);
125 return clusterColorControl.MoveHue(nullptr, nullptr, moveMode, rate, optionsMask, optionsOverride);
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)
131 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
132 chip::Controller::ColorControlCluster clusterColorControl;
134 clusterColorControl.Associate(device, ZCLendpointId);
135 return clusterColorControl.MoveSaturation(nullptr, nullptr, moveMode, rate, optionsMask, optionsOverride);
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)
141 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
142 chip::Controller::ColorControlCluster clusterColorControl;
144 clusterColorControl.Associate(device, ZCLendpointId);
145 return clusterColorControl.MoveToColor(nullptr, nullptr, colorX, colorY, transitionTime, optionsMask, optionsOverride);
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)
152 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
153 chip::Controller::ColorControlCluster clusterColorControl;
155 clusterColorControl.Associate(device, ZCLendpointId);
156 return clusterColorControl.MoveToColorTemperature(nullptr, nullptr, colorTemperature, transitionTime, optionsMask,
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)
163 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
164 chip::Controller::ColorControlCluster clusterColorControl;
166 clusterColorControl.Associate(device, ZCLendpointId);
167 return clusterColorControl.MoveToHue(nullptr, nullptr, hue, direction, transitionTime, optionsMask, optionsOverride);
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)
174 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
175 chip::Controller::ColorControlCluster clusterColorControl;
177 clusterColorControl.Associate(device, ZCLendpointId);
178 return clusterColorControl.MoveToHueAndSaturation(nullptr, nullptr, hue, saturation, transitionTime, optionsMask,
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)
186 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
187 chip::Controller::ColorControlCluster clusterColorControl;
189 clusterColorControl.Associate(device, ZCLendpointId);
190 return clusterColorControl.MoveToSaturation(nullptr, nullptr, saturation, transitionTime, optionsMask, optionsOverride);
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)
196 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
197 chip::Controller::ColorControlCluster clusterColorControl;
199 clusterColorControl.Associate(device, ZCLendpointId);
200 return clusterColorControl.StepColor(nullptr, nullptr, stepX, stepY, transitionTime, optionsMask, optionsOverride);
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)
209 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
210 chip::Controller::ColorControlCluster clusterColorControl;
212 clusterColorControl.Associate(device, ZCLendpointId);
213 return clusterColorControl.StepColorTemperature(nullptr, nullptr, stepMode, stepSize, transitionTime, colorTemperatureMinimum,
214 colorTemperatureMaximum, optionsMask, optionsOverride);
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)
220 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
221 chip::Controller::ColorControlCluster clusterColorControl;
223 clusterColorControl.Associate(device, ZCLendpointId);
224 return clusterColorControl.StepHue(nullptr, nullptr, stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
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)
230 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
231 chip::Controller::ColorControlCluster clusterColorControl;
233 clusterColorControl.Associate(device, ZCLendpointId);
234 return clusterColorControl.StepSaturation(nullptr, nullptr, stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
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)
239 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
240 chip::Controller::ColorControlCluster clusterColorControl;
242 clusterColorControl.Associate(device, ZCLendpointId);
243 return clusterColorControl.StopMoveStep(nullptr, nullptr, optionsMask, optionsOverride);
245 // End of Cluster ColorControl
247 // Cluster ContentLaunch
248 CHIP_ERROR chip_ime_AppendCommand_ContentLaunch_LaunchContent(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
249 chip::GroupId ZCLgroupId)
251 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
252 chip::Controller::ContentLaunchCluster clusterContentLaunch;
254 clusterContentLaunch.Associate(device, ZCLendpointId);
255 return clusterContentLaunch.LaunchContent(nullptr, nullptr);
257 CHIP_ERROR chip_ime_AppendCommand_ContentLaunch_LaunchURL(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
258 chip::GroupId ZCLgroupId)
260 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
261 chip::Controller::ContentLaunchCluster clusterContentLaunch;
263 clusterContentLaunch.Associate(device, ZCLendpointId);
264 return clusterContentLaunch.LaunchURL(nullptr, nullptr);
266 // End of Cluster ContentLaunch
269 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearAllPins(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
270 chip::GroupId ZCLgroupId)
272 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
273 chip::Controller::DoorLockCluster clusterDoorLock;
275 clusterDoorLock.Associate(device, ZCLendpointId);
276 return clusterDoorLock.ClearAllPins(nullptr, nullptr);
278 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearAllRfids(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
279 chip::GroupId ZCLgroupId)
281 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
282 chip::Controller::DoorLockCluster clusterDoorLock;
284 clusterDoorLock.Associate(device, ZCLendpointId);
285 return clusterDoorLock.ClearAllRfids(nullptr, nullptr);
287 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearHolidaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
288 chip::GroupId ZCLgroupId, uint8_t scheduleId)
290 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
291 chip::Controller::DoorLockCluster clusterDoorLock;
293 clusterDoorLock.Associate(device, ZCLendpointId);
294 return clusterDoorLock.ClearHolidaySchedule(nullptr, nullptr, scheduleId);
296 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearPin(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
297 chip::GroupId ZCLgroupId, uint16_t userId)
299 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
300 chip::Controller::DoorLockCluster clusterDoorLock;
302 clusterDoorLock.Associate(device, ZCLendpointId);
303 return clusterDoorLock.ClearPin(nullptr, nullptr, userId);
305 CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearRfid(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
306 chip::GroupId ZCLgroupId, uint16_t userId)
308 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
309 chip::Controller::DoorLockCluster clusterDoorLock;
311 clusterDoorLock.Associate(device, ZCLendpointId);
312 return clusterDoorLock.ClearRfid(nullptr, nullptr, userId);
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)
317 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
318 chip::Controller::DoorLockCluster clusterDoorLock;
320 clusterDoorLock.Associate(device, ZCLendpointId);
321 return clusterDoorLock.ClearWeekdaySchedule(nullptr, nullptr, scheduleId, userId);
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)
326 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
327 chip::Controller::DoorLockCluster clusterDoorLock;
329 clusterDoorLock.Associate(device, ZCLendpointId);
330 return clusterDoorLock.ClearYeardaySchedule(nullptr, nullptr, scheduleId, userId);
332 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetHolidaySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
333 chip::GroupId ZCLgroupId, uint8_t scheduleId)
335 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
336 chip::Controller::DoorLockCluster clusterDoorLock;
338 clusterDoorLock.Associate(device, ZCLendpointId);
339 return clusterDoorLock.GetHolidaySchedule(nullptr, nullptr, scheduleId);
341 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetLogRecord(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
342 chip::GroupId ZCLgroupId, uint16_t logIndex)
344 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
345 chip::Controller::DoorLockCluster clusterDoorLock;
347 clusterDoorLock.Associate(device, ZCLendpointId);
348 return clusterDoorLock.GetLogRecord(nullptr, nullptr, logIndex);
350 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetPin(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
351 chip::GroupId ZCLgroupId, uint16_t userId)
353 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
354 chip::Controller::DoorLockCluster clusterDoorLock;
356 clusterDoorLock.Associate(device, ZCLendpointId);
357 return clusterDoorLock.GetPin(nullptr, nullptr, userId);
359 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetRfid(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
360 chip::GroupId ZCLgroupId, uint16_t userId)
362 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
363 chip::Controller::DoorLockCluster clusterDoorLock;
365 clusterDoorLock.Associate(device, ZCLendpointId);
366 return clusterDoorLock.GetRfid(nullptr, nullptr, userId);
368 CHIP_ERROR chip_ime_AppendCommand_DoorLock_GetUserType(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
369 chip::GroupId ZCLgroupId, uint16_t userId)
371 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
372 chip::Controller::DoorLockCluster clusterDoorLock;
374 clusterDoorLock.Associate(device, ZCLendpointId);
375 return clusterDoorLock.GetUserType(nullptr, nullptr, userId);
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)
380 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
381 chip::Controller::DoorLockCluster clusterDoorLock;
383 clusterDoorLock.Associate(device, ZCLendpointId);
384 return clusterDoorLock.GetWeekdaySchedule(nullptr, nullptr, scheduleId, userId);
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)
389 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
390 chip::Controller::DoorLockCluster clusterDoorLock;
392 clusterDoorLock.Associate(device, ZCLendpointId);
393 return clusterDoorLock.GetYeardaySchedule(nullptr, nullptr, scheduleId, userId);
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)
398 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
399 chip::Controller::DoorLockCluster clusterDoorLock;
401 clusterDoorLock.Associate(device, ZCLendpointId);
402 return clusterDoorLock.LockDoor(nullptr, nullptr, chip::ByteSpan(pin, pin_Len));
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)
408 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
409 chip::Controller::DoorLockCluster clusterDoorLock;
411 clusterDoorLock.Associate(device, ZCLendpointId);
412 return clusterDoorLock.SetHolidaySchedule(nullptr, nullptr, scheduleId, localStartTime, localEndTime,
413 operatingModeDuringHoliday);
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)
419 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
420 chip::Controller::DoorLockCluster clusterDoorLock;
422 clusterDoorLock.Associate(device, ZCLendpointId);
423 return clusterDoorLock.SetPin(nullptr, nullptr, userId, userStatus, userType, chip::ByteSpan(pin, pin_Len));
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)
429 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
430 chip::Controller::DoorLockCluster clusterDoorLock;
432 clusterDoorLock.Associate(device, ZCLendpointId);
433 return clusterDoorLock.SetRfid(nullptr, nullptr, userId, userStatus, userType, chip::ByteSpan(id, id_Len));
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)
438 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
439 chip::Controller::DoorLockCluster clusterDoorLock;
441 clusterDoorLock.Associate(device, ZCLendpointId);
442 return clusterDoorLock.SetUserType(nullptr, nullptr, userId, userType);
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)
449 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
450 chip::Controller::DoorLockCluster clusterDoorLock;
452 clusterDoorLock.Associate(device, ZCLendpointId);
453 return clusterDoorLock.SetWeekdaySchedule(nullptr, nullptr, scheduleId, userId, daysMask, startHour, startMinute, endHour,
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)
460 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
461 chip::Controller::DoorLockCluster clusterDoorLock;
463 clusterDoorLock.Associate(device, ZCLendpointId);
464 return clusterDoorLock.SetYeardaySchedule(nullptr, nullptr, scheduleId, userId, localStartTime, localEndTime);
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)
469 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
470 chip::Controller::DoorLockCluster clusterDoorLock;
472 clusterDoorLock.Associate(device, ZCLendpointId);
473 return clusterDoorLock.UnlockDoor(nullptr, nullptr, chip::ByteSpan(pin, pin_Len));
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)
479 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
480 chip::Controller::DoorLockCluster clusterDoorLock;
482 clusterDoorLock.Associate(device, ZCLendpointId);
483 return clusterDoorLock.UnlockWithTimeout(nullptr, nullptr, timeoutInSeconds, chip::ByteSpan(pin, pin_Len));
485 // End of Cluster DoorLock
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,
493 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
494 chip::Controller::GeneralCommissioningCluster clusterGeneralCommissioning;
496 clusterGeneralCommissioning.Associate(device, ZCLendpointId);
497 return clusterGeneralCommissioning.ArmFailSafe(nullptr, nullptr, expiryLengthSeconds, breadcrumb, timeoutMs);
499 CHIP_ERROR chip_ime_AppendCommand_GeneralCommissioning_CommissioningComplete(chip::Controller::Device * device,
500 chip::EndpointId ZCLendpointId,
501 chip::GroupId ZCLgroupId)
503 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
504 chip::Controller::GeneralCommissioningCluster clusterGeneralCommissioning;
506 clusterGeneralCommissioning.Associate(device, ZCLendpointId);
507 return clusterGeneralCommissioning.CommissioningComplete(nullptr, nullptr);
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)
514 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
515 chip::Controller::GeneralCommissioningCluster clusterGeneralCommissioning;
517 clusterGeneralCommissioning.Associate(device, ZCLendpointId);
518 return clusterGeneralCommissioning.SetFabric(nullptr, nullptr, chip::ByteSpan(fabricId, fabricId_Len),
519 chip::ByteSpan(fabricSecret, fabricSecret_Len), breadcrumb, timeoutMs);
521 // End of Cluster GeneralCommissioning
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)
528 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
529 chip::Controller::GroupsCluster clusterGroups;
531 clusterGroups.Associate(device, ZCLendpointId);
532 return clusterGroups.AddGroup(nullptr, nullptr, groupId, chip::ByteSpan(groupName, groupName_Len));
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)
538 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
539 chip::Controller::GroupsCluster clusterGroups;
541 clusterGroups.Associate(device, ZCLendpointId);
542 return clusterGroups.AddGroupIfIdentifying(nullptr, nullptr, groupId, chip::ByteSpan(groupName, groupName_Len));
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)
547 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
548 chip::Controller::GroupsCluster clusterGroups;
550 clusterGroups.Associate(device, ZCLendpointId);
551 return clusterGroups.GetGroupMembership(nullptr, nullptr, groupCount, groupList);
553 CHIP_ERROR chip_ime_AppendCommand_Groups_RemoveAllGroups(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
554 chip::GroupId ZCLgroupId)
556 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
557 chip::Controller::GroupsCluster clusterGroups;
559 clusterGroups.Associate(device, ZCLendpointId);
560 return clusterGroups.RemoveAllGroups(nullptr, nullptr);
562 CHIP_ERROR chip_ime_AppendCommand_Groups_RemoveGroup(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
563 chip::GroupId ZCLgroupId, uint16_t groupId)
565 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
566 chip::Controller::GroupsCluster clusterGroups;
568 clusterGroups.Associate(device, ZCLendpointId);
569 return clusterGroups.RemoveGroup(nullptr, nullptr, groupId);
571 CHIP_ERROR chip_ime_AppendCommand_Groups_ViewGroup(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
572 chip::GroupId ZCLgroupId, uint16_t groupId)
574 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
575 chip::Controller::GroupsCluster clusterGroups;
577 clusterGroups.Associate(device, ZCLendpointId);
578 return clusterGroups.ViewGroup(nullptr, nullptr, groupId);
580 // End of Cluster Groups
583 // End of Cluster IasZone
586 CHIP_ERROR chip_ime_AppendCommand_Identify_Identify(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
587 chip::GroupId ZCLgroupId, uint16_t identifyTime)
589 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
590 chip::Controller::IdentifyCluster clusterIdentify;
592 clusterIdentify.Associate(device, ZCLendpointId);
593 return clusterIdentify.Identify(nullptr, nullptr, identifyTime);
595 CHIP_ERROR chip_ime_AppendCommand_Identify_IdentifyQuery(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
596 chip::GroupId ZCLgroupId)
598 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
599 chip::Controller::IdentifyCluster clusterIdentify;
601 clusterIdentify.Associate(device, ZCLendpointId);
602 return clusterIdentify.IdentifyQuery(nullptr, nullptr);
604 // End of Cluster Identify
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)
611 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
612 chip::Controller::LevelControlCluster clusterLevelControl;
614 clusterLevelControl.Associate(device, ZCLendpointId);
615 return clusterLevelControl.Move(nullptr, nullptr, moveMode, rate, optionMask, optionOverride);
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)
621 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
622 chip::Controller::LevelControlCluster clusterLevelControl;
624 clusterLevelControl.Associate(device, ZCLendpointId);
625 return clusterLevelControl.MoveToLevel(nullptr, nullptr, level, transitionTime, optionMask, optionOverride);
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)
631 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
632 chip::Controller::LevelControlCluster clusterLevelControl;
634 clusterLevelControl.Associate(device, ZCLendpointId);
635 return clusterLevelControl.MoveToLevelWithOnOff(nullptr, nullptr, level, transitionTime);
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)
640 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
641 chip::Controller::LevelControlCluster clusterLevelControl;
643 clusterLevelControl.Associate(device, ZCLendpointId);
644 return clusterLevelControl.MoveWithOnOff(nullptr, nullptr, moveMode, rate);
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)
650 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
651 chip::Controller::LevelControlCluster clusterLevelControl;
653 clusterLevelControl.Associate(device, ZCLendpointId);
654 return clusterLevelControl.Step(nullptr, nullptr, stepMode, stepSize, transitionTime, optionMask, optionOverride);
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)
660 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
661 chip::Controller::LevelControlCluster clusterLevelControl;
663 clusterLevelControl.Associate(device, ZCLendpointId);
664 return clusterLevelControl.StepWithOnOff(nullptr, nullptr, stepMode, stepSize, transitionTime);
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)
669 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
670 chip::Controller::LevelControlCluster clusterLevelControl;
672 clusterLevelControl.Associate(device, ZCLendpointId);
673 return clusterLevelControl.Stop(nullptr, nullptr, optionMask, optionOverride);
675 CHIP_ERROR chip_ime_AppendCommand_LevelControl_StopWithOnOff(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
676 chip::GroupId ZCLgroupId)
678 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
679 chip::Controller::LevelControlCluster clusterLevelControl;
681 clusterLevelControl.Associate(device, ZCLendpointId);
682 return clusterLevelControl.StopWithOnOff(nullptr, nullptr);
684 // End of Cluster LevelControl
687 CHIP_ERROR chip_ime_AppendCommand_LowPower_Sleep(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
688 chip::GroupId ZCLgroupId)
690 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
691 chip::Controller::LowPowerCluster clusterLowPower;
693 clusterLowPower.Associate(device, ZCLendpointId);
694 return clusterLowPower.Sleep(nullptr, nullptr);
696 // End of Cluster LowPower
698 // Cluster MediaPlayback
699 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_FastForwardRequest(chip::Controller::Device * device,
700 chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId)
702 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
703 chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
705 clusterMediaPlayback.Associate(device, ZCLendpointId);
706 return clusterMediaPlayback.FastForwardRequest(nullptr, nullptr);
708 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_NextRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
709 chip::GroupId ZCLgroupId)
711 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
712 chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
714 clusterMediaPlayback.Associate(device, ZCLendpointId);
715 return clusterMediaPlayback.NextRequest(nullptr, nullptr);
717 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_PauseRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
718 chip::GroupId ZCLgroupId)
720 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
721 chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
723 clusterMediaPlayback.Associate(device, ZCLendpointId);
724 return clusterMediaPlayback.PauseRequest(nullptr, nullptr);
726 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_PlayRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
727 chip::GroupId ZCLgroupId)
729 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
730 chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
732 clusterMediaPlayback.Associate(device, ZCLendpointId);
733 return clusterMediaPlayback.PlayRequest(nullptr, nullptr);
735 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_PreviousRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
736 chip::GroupId ZCLgroupId)
738 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
739 chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
741 clusterMediaPlayback.Associate(device, ZCLendpointId);
742 return clusterMediaPlayback.PreviousRequest(nullptr, nullptr);
744 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_RewindRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
745 chip::GroupId ZCLgroupId)
747 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
748 chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
750 clusterMediaPlayback.Associate(device, ZCLendpointId);
751 return clusterMediaPlayback.RewindRequest(nullptr, nullptr);
753 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_SkipBackwardRequest(chip::Controller::Device * device,
754 chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId)
756 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
757 chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
759 clusterMediaPlayback.Associate(device, ZCLendpointId);
760 return clusterMediaPlayback.SkipBackwardRequest(nullptr, nullptr);
762 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_SkipForwardRequest(chip::Controller::Device * device,
763 chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId)
765 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
766 chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
768 clusterMediaPlayback.Associate(device, ZCLendpointId);
769 return clusterMediaPlayback.SkipForwardRequest(nullptr, nullptr);
771 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_StartOverRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
772 chip::GroupId ZCLgroupId)
774 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
775 chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
777 clusterMediaPlayback.Associate(device, ZCLendpointId);
778 return clusterMediaPlayback.StartOverRequest(nullptr, nullptr);
780 CHIP_ERROR chip_ime_AppendCommand_MediaPlayback_StopRequest(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
781 chip::GroupId ZCLgroupId)
783 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
784 chip::Controller::MediaPlaybackCluster clusterMediaPlayback;
786 clusterMediaPlayback.Associate(device, ZCLendpointId);
787 return clusterMediaPlayback.StopRequest(nullptr, nullptr);
789 // End of Cluster MediaPlayback
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,
798 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
799 chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
801 clusterNetworkCommissioning.Associate(device, ZCLendpointId);
802 return clusterNetworkCommissioning.AddThreadNetwork(
803 nullptr, nullptr, chip::ByteSpan(operationalDataset, operationalDataset_Len), breadcrumb, timeoutMs);
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)
811 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
812 chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
814 clusterNetworkCommissioning.Associate(device, ZCLendpointId);
815 return clusterNetworkCommissioning.AddWiFiNetwork(nullptr, nullptr, chip::ByteSpan(ssid, ssid_Len),
816 chip::ByteSpan(credentials, credentials_Len), breadcrumb, timeoutMs);
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)
823 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
824 chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
826 clusterNetworkCommissioning.Associate(device, ZCLendpointId);
827 return clusterNetworkCommissioning.DisableNetwork(nullptr, nullptr, chip::ByteSpan(networkID, networkID_Len), breadcrumb,
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)
835 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
836 chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
838 clusterNetworkCommissioning.Associate(device, ZCLendpointId);
839 return clusterNetworkCommissioning.EnableNetwork(nullptr, nullptr, chip::ByteSpan(networkID, networkID_Len), breadcrumb,
842 CHIP_ERROR chip_ime_AppendCommand_NetworkCommissioning_GetLastNetworkCommissioningResult(chip::Controller::Device * device,
843 chip::EndpointId ZCLendpointId,
844 chip::GroupId ZCLgroupId,
847 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
848 chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
850 clusterNetworkCommissioning.Associate(device, ZCLendpointId);
851 return clusterNetworkCommissioning.GetLastNetworkCommissioningResult(nullptr, nullptr, timeoutMs);
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)
858 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
859 chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
861 clusterNetworkCommissioning.Associate(device, ZCLendpointId);
862 return clusterNetworkCommissioning.RemoveNetwork(nullptr, nullptr, chip::ByteSpan(networkID, networkID_Len), breadcrumb,
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,
870 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
871 chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
873 clusterNetworkCommissioning.Associate(device, ZCLendpointId);
874 return clusterNetworkCommissioning.ScanNetworks(nullptr, nullptr, chip::ByteSpan(ssid, ssid_Len), breadcrumb, timeoutMs);
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,
882 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
883 chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
885 clusterNetworkCommissioning.Associate(device, ZCLendpointId);
886 return clusterNetworkCommissioning.UpdateThreadNetwork(
887 nullptr, nullptr, chip::ByteSpan(operationalDataset, operationalDataset_Len), breadcrumb, timeoutMs);
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)
895 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
896 chip::Controller::NetworkCommissioningCluster clusterNetworkCommissioning;
898 clusterNetworkCommissioning.Associate(device, ZCLendpointId);
899 return clusterNetworkCommissioning.UpdateWiFiNetwork(nullptr, nullptr, chip::ByteSpan(ssid, ssid_Len),
900 chip::ByteSpan(credentials, credentials_Len), breadcrumb, timeoutMs);
902 // End of Cluster NetworkCommissioning
905 CHIP_ERROR chip_ime_AppendCommand_OnOff_Off(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
906 chip::GroupId ZCLgroupId)
908 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
909 chip::Controller::OnOffCluster clusterOnOff;
911 clusterOnOff.Associate(device, ZCLendpointId);
912 return clusterOnOff.Off(nullptr, nullptr);
914 CHIP_ERROR chip_ime_AppendCommand_OnOff_On(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
915 chip::GroupId ZCLgroupId)
917 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
918 chip::Controller::OnOffCluster clusterOnOff;
920 clusterOnOff.Associate(device, ZCLendpointId);
921 return clusterOnOff.On(nullptr, nullptr);
923 CHIP_ERROR chip_ime_AppendCommand_OnOff_Toggle(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
924 chip::GroupId ZCLgroupId)
926 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
927 chip::Controller::OnOffCluster clusterOnOff;
929 clusterOnOff.Associate(device, ZCLendpointId);
930 return clusterOnOff.Toggle(nullptr, nullptr);
932 // End of Cluster OnOff
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)
940 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
941 chip::Controller::ScenesCluster clusterScenes;
943 clusterScenes.Associate(device, ZCLendpointId);
944 return clusterScenes.AddScene(nullptr, nullptr, groupId, sceneId, transitionTime, chip::ByteSpan(sceneName, sceneName_Len),
945 clusterId, length, value);
947 CHIP_ERROR chip_ime_AppendCommand_Scenes_GetSceneMembership(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
948 chip::GroupId ZCLgroupId, uint16_t groupId)
950 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
951 chip::Controller::ScenesCluster clusterScenes;
953 clusterScenes.Associate(device, ZCLendpointId);
954 return clusterScenes.GetSceneMembership(nullptr, nullptr, groupId);
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)
960 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
961 chip::Controller::ScenesCluster clusterScenes;
963 clusterScenes.Associate(device, ZCLendpointId);
964 return clusterScenes.RecallScene(nullptr, nullptr, groupId, sceneId, transitionTime);
966 CHIP_ERROR chip_ime_AppendCommand_Scenes_RemoveAllScenes(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,
967 chip::GroupId ZCLgroupId, uint16_t groupId)
969 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
970 chip::Controller::ScenesCluster clusterScenes;
972 clusterScenes.Associate(device, ZCLendpointId);
973 return clusterScenes.RemoveAllScenes(nullptr, nullptr, groupId);
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)
978 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
979 chip::Controller::ScenesCluster clusterScenes;
981 clusterScenes.Associate(device, ZCLendpointId);
982 return clusterScenes.RemoveScene(nullptr, nullptr, groupId, sceneId);
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)
987 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
988 chip::Controller::ScenesCluster clusterScenes;
990 clusterScenes.Associate(device, ZCLendpointId);
991 return clusterScenes.StoreScene(nullptr, nullptr, groupId, sceneId);
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)
996 VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
997 chip::Controller::ScenesCluster clusterScenes;
999 clusterScenes.Associate(device, ZCLendpointId);
1000 return clusterScenes.ViewScene(nullptr, nullptr, groupId, sceneId);
1002 // End of Cluster Scenes
1004 // Cluster TemperatureMeasurement
1005 // End of Cluster TemperatureMeasurement