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
24 #include "ModelCommand.h"
25 #include "gen/CHIPClientCallbacks.h"
26 #include <controller/CHIPClusters.h>
27 #include <lib/core/CHIPSafeCasts.h>
29 static void OnDefaultSuccessResponse(void * context)
31 ChipLogProgress(chipTool, "Default Success Response");
33 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
34 command->SetCommandExitStatus(true);
37 static void OnDefaultFailureResponse(void * context, uint8_t status)
39 ChipLogProgress(chipTool, "Default Failure Response: 0x%02x", status);
41 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
42 command->SetCommandExitStatus(false);
45 static void OnBooleanAttributeResponse(void * context, bool value)
47 ChipLogProgress(chipTool, "Boolean attribute Response: %d", value);
49 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
50 command->SetCommandExitStatus(true);
53 static void OnInt8uAttributeResponse(void * context, uint8_t value)
55 ChipLogProgress(chipTool, "Int8u attribute Response: %" PRIu8, value);
57 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
58 command->SetCommandExitStatus(true);
61 static void OnInt16uAttributeResponse(void * context, uint16_t value)
63 ChipLogProgress(chipTool, "Int16u attribute Response: %" PRIu16, value);
65 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
66 command->SetCommandExitStatus(true);
69 static void OnInt32uAttributeResponse(void * context, uint32_t value)
71 ChipLogProgress(chipTool, "Int32u attribute Response: %" PRIu32, value);
73 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
74 command->SetCommandExitStatus(true);
77 static void OnInt64uAttributeResponse(void * context, uint64_t value)
79 ChipLogProgress(chipTool, "Int64u attribute Response: %" PRIu64, value);
81 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
82 command->SetCommandExitStatus(true);
85 static void OnInt16sAttributeResponse(void * context, int16_t value)
87 ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value);
89 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
90 command->SetCommandExitStatus(true);
93 static void OnStringAttributeResponse(void * context, const chip::ByteSpan value)
95 char * str = (char *) malloc(value.size() * sizeof(char));
96 memmove(str, value.data(), value.size());
97 str[value.size()] = '\0';
100 ChipLogProgress(chipTool, "String attribute Response: %s (%" PRIu16 ")", str, strlen(str));
102 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
103 command->SetCommandExitStatus(true);
106 static void OnContentLaunchClusterLaunchContentResponse(void * context, uint8_t contentLaunchStatus)
108 ChipLogProgress(chipTool, "ContentLaunchClusterLaunchContentResponse");
110 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
111 command->SetCommandExitStatus(true);
114 static void OnContentLaunchClusterLaunchURLResponse(void * context, uint8_t contentLaunchStatus)
116 ChipLogProgress(chipTool, "ContentLaunchClusterLaunchURLResponse");
118 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
119 command->SetCommandExitStatus(true);
122 static void OnDoorLockClusterClearAllPinsResponse(void * context)
124 ChipLogProgress(chipTool, "DoorLockClusterClearAllPinsResponse");
126 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
127 command->SetCommandExitStatus(true);
130 static void OnDoorLockClusterClearAllRfidsResponse(void * context)
132 ChipLogProgress(chipTool, "DoorLockClusterClearAllRfidsResponse");
134 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
135 command->SetCommandExitStatus(true);
138 static void OnDoorLockClusterClearHolidayScheduleResponse(void * context)
140 ChipLogProgress(chipTool, "DoorLockClusterClearHolidayScheduleResponse");
142 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
143 command->SetCommandExitStatus(true);
146 static void OnDoorLockClusterClearPinResponse(void * context)
148 ChipLogProgress(chipTool, "DoorLockClusterClearPinResponse");
150 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
151 command->SetCommandExitStatus(true);
154 static void OnDoorLockClusterClearRfidResponse(void * context)
156 ChipLogProgress(chipTool, "DoorLockClusterClearRfidResponse");
158 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
159 command->SetCommandExitStatus(true);
162 static void OnDoorLockClusterClearWeekdayScheduleResponse(void * context)
164 ChipLogProgress(chipTool, "DoorLockClusterClearWeekdayScheduleResponse");
166 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
167 command->SetCommandExitStatus(true);
170 static void OnDoorLockClusterClearYeardayScheduleResponse(void * context)
172 ChipLogProgress(chipTool, "DoorLockClusterClearYeardayScheduleResponse");
174 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
175 command->SetCommandExitStatus(true);
178 static void OnDoorLockClusterGetHolidayScheduleResponse(void * context, uint8_t scheduleId, uint32_t localStartTime,
179 uint32_t localEndTime, uint8_t operatingModeDuringHoliday)
181 ChipLogProgress(chipTool, "DoorLockClusterGetHolidayScheduleResponse");
183 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
184 command->SetCommandExitStatus(true);
187 static void OnDoorLockClusterGetLogRecordResponse(void * context, uint16_t logEntryId, uint32_t timestamp, uint8_t eventType,
188 uint8_t source, uint8_t eventIdOrAlarmCode, uint16_t userId, uint8_t * pin)
190 ChipLogProgress(chipTool, "DoorLockClusterGetLogRecordResponse");
192 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
193 command->SetCommandExitStatus(true);
196 static void OnDoorLockClusterGetPinResponse(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * pin)
198 ChipLogProgress(chipTool, "DoorLockClusterGetPinResponse");
200 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
201 command->SetCommandExitStatus(true);
204 static void OnDoorLockClusterGetRfidResponse(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * rfid)
206 ChipLogProgress(chipTool, "DoorLockClusterGetRfidResponse");
208 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
209 command->SetCommandExitStatus(true);
212 static void OnDoorLockClusterGetUserTypeResponse(void * context, uint16_t userId, uint8_t userType)
214 ChipLogProgress(chipTool, "DoorLockClusterGetUserTypeResponse");
216 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
217 command->SetCommandExitStatus(true);
220 static void OnDoorLockClusterGetWeekdayScheduleResponse(void * context, uint8_t scheduleId, uint16_t userId, uint8_t daysMask,
221 uint8_t startHour, uint8_t startMinute, uint8_t endHour, uint8_t endMinute)
223 ChipLogProgress(chipTool, "DoorLockClusterGetWeekdayScheduleResponse");
225 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
226 command->SetCommandExitStatus(true);
229 static void OnDoorLockClusterGetYeardayScheduleResponse(void * context, uint8_t scheduleId, uint16_t userId,
230 uint32_t localStartTime, uint32_t localEndTime)
232 ChipLogProgress(chipTool, "DoorLockClusterGetYeardayScheduleResponse");
234 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
235 command->SetCommandExitStatus(true);
238 static void OnDoorLockClusterLockDoorResponse(void * context)
240 ChipLogProgress(chipTool, "DoorLockClusterLockDoorResponse");
242 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
243 command->SetCommandExitStatus(true);
246 static void OnDoorLockClusterSetHolidayScheduleResponse(void * context)
248 ChipLogProgress(chipTool, "DoorLockClusterSetHolidayScheduleResponse");
250 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
251 command->SetCommandExitStatus(true);
254 static void OnDoorLockClusterSetPinResponse(void * context)
256 ChipLogProgress(chipTool, "DoorLockClusterSetPinResponse");
258 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
259 command->SetCommandExitStatus(true);
262 static void OnDoorLockClusterSetRfidResponse(void * context)
264 ChipLogProgress(chipTool, "DoorLockClusterSetRfidResponse");
266 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
267 command->SetCommandExitStatus(true);
270 static void OnDoorLockClusterSetUserTypeResponse(void * context)
272 ChipLogProgress(chipTool, "DoorLockClusterSetUserTypeResponse");
274 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
275 command->SetCommandExitStatus(true);
278 static void OnDoorLockClusterSetWeekdayScheduleResponse(void * context)
280 ChipLogProgress(chipTool, "DoorLockClusterSetWeekdayScheduleResponse");
282 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
283 command->SetCommandExitStatus(true);
286 static void OnDoorLockClusterSetYeardayScheduleResponse(void * context)
288 ChipLogProgress(chipTool, "DoorLockClusterSetYeardayScheduleResponse");
290 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
291 command->SetCommandExitStatus(true);
294 static void OnDoorLockClusterUnlockDoorResponse(void * context)
296 ChipLogProgress(chipTool, "DoorLockClusterUnlockDoorResponse");
298 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
299 command->SetCommandExitStatus(true);
302 static void OnDoorLockClusterUnlockWithTimeoutResponse(void * context)
304 ChipLogProgress(chipTool, "DoorLockClusterUnlockWithTimeoutResponse");
306 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
307 command->SetCommandExitStatus(true);
310 static void OnGeneralCommissioningClusterArmFailSafeResponse(void * context, uint8_t errorCode, uint8_t * debugText)
312 ChipLogProgress(chipTool, "GeneralCommissioningClusterArmFailSafeResponse");
314 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
315 command->SetCommandExitStatus(true);
318 static void OnGeneralCommissioningClusterCommissioningCompleteResponse(void * context, uint8_t errorCode, uint8_t * debugText)
320 ChipLogProgress(chipTool, "GeneralCommissioningClusterCommissioningCompleteResponse");
322 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
323 command->SetCommandExitStatus(true);
326 static void OnGeneralCommissioningClusterSetFabricResponse(void * context, uint8_t errorCode, uint8_t * debugText)
328 ChipLogProgress(chipTool, "GeneralCommissioningClusterSetFabricResponse");
330 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
331 command->SetCommandExitStatus(true);
334 static void OnGroupsClusterAddGroupResponse(void * context, uint16_t groupId)
336 ChipLogProgress(chipTool, "GroupsClusterAddGroupResponse");
338 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
339 command->SetCommandExitStatus(true);
342 static void OnGroupsClusterGetGroupMembershipResponse(void * context, uint8_t capacity, uint8_t groupCount,
343 /* TYPE WARNING: array array defaults to */ uint8_t * groupList)
345 ChipLogProgress(chipTool, "GroupsClusterGetGroupMembershipResponse");
347 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
348 command->SetCommandExitStatus(true);
351 static void OnGroupsClusterRemoveGroupResponse(void * context, uint16_t groupId)
353 ChipLogProgress(chipTool, "GroupsClusterRemoveGroupResponse");
355 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
356 command->SetCommandExitStatus(true);
359 static void OnGroupsClusterViewGroupResponse(void * context, uint16_t groupId, uint8_t * groupName)
361 ChipLogProgress(chipTool, "GroupsClusterViewGroupResponse");
363 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
364 command->SetCommandExitStatus(true);
367 static void OnIdentifyClusterIdentifyQueryResponse(void * context, uint16_t timeout)
369 ChipLogProgress(chipTool, "IdentifyClusterIdentifyQueryResponse");
371 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
372 command->SetCommandExitStatus(true);
375 static void OnScenesClusterAddSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
377 ChipLogProgress(chipTool, "ScenesClusterAddSceneResponse");
379 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
380 command->SetCommandExitStatus(true);
383 static void OnScenesClusterGetSceneMembershipResponse(void * context, uint8_t capacity, uint16_t groupId, uint8_t sceneCount,
384 /* TYPE WARNING: array array defaults to */ uint8_t * sceneList)
386 ChipLogProgress(chipTool, "ScenesClusterGetSceneMembershipResponse");
388 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
389 command->SetCommandExitStatus(true);
392 static void OnScenesClusterRemoveAllScenesResponse(void * context, uint16_t groupId)
394 ChipLogProgress(chipTool, "ScenesClusterRemoveAllScenesResponse");
396 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
397 command->SetCommandExitStatus(true);
400 static void OnScenesClusterRemoveSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
402 ChipLogProgress(chipTool, "ScenesClusterRemoveSceneResponse");
404 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
405 command->SetCommandExitStatus(true);
408 static void OnScenesClusterStoreSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
410 ChipLogProgress(chipTool, "ScenesClusterStoreSceneResponse");
412 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
413 command->SetCommandExitStatus(true);
416 static void OnScenesClusterViewSceneResponse(void * context, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime,
418 /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets)
420 ChipLogProgress(chipTool, "ScenesClusterViewSceneResponse");
422 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
423 command->SetCommandExitStatus(true);
426 /*----------------------------------------------------------------------------*\
427 | Cluster Name | ID |
428 |---------------------------------------------------------------------+--------|
429 | ApplicationBasic | 0x050D |
430 | BarrierControl | 0x0103 |
433 | ColorControl | 0x0300 |
434 | ContentLaunch | 0xF002 |
435 | DoorLock | 0x0101 |
436 | GeneralCommissioning | 0x0030 |
438 | Identify | 0x0003 |
439 | LevelControl | 0x0008 |
440 | LowPower | 0x0508 |
441 | MediaPlayback | 0xF001 |
444 | TemperatureMeasurement | 0x0402 |
445 \*----------------------------------------------------------------------------*/
447 constexpr chip::ClusterId kApplicationBasicClusterId = 0x050D;
448 constexpr chip::ClusterId kBarrierControlClusterId = 0x0103;
449 constexpr chip::ClusterId kBasicClusterId = 0x0028;
450 constexpr chip::ClusterId kBindingClusterId = 0xF000;
451 constexpr chip::ClusterId kColorControlClusterId = 0x0300;
452 constexpr chip::ClusterId kContentLaunchClusterId = 0xF002;
453 constexpr chip::ClusterId kDoorLockClusterId = 0x0101;
454 constexpr chip::ClusterId kGeneralCommissioningClusterId = 0x0030;
455 constexpr chip::ClusterId kGroupsClusterId = 0x0004;
456 constexpr chip::ClusterId kIdentifyClusterId = 0x0003;
457 constexpr chip::ClusterId kLevelControlClusterId = 0x0008;
458 constexpr chip::ClusterId kLowPowerClusterId = 0x0508;
459 constexpr chip::ClusterId kMediaPlaybackClusterId = 0xF001;
460 constexpr chip::ClusterId kOnOffClusterId = 0x0006;
461 constexpr chip::ClusterId kScenesClusterId = 0x0005;
462 constexpr chip::ClusterId kTemperatureMeasurementClusterId = 0x0402;
464 /*----------------------------------------------------------------------------*\
465 | Cluster ApplicationBasic | 0x050D |
466 |------------------------------------------------------------------------------|
468 |------------------------------------------------------------------------------|
470 | * VendorName | 0x0000 |
471 | * VendorId | 0x0001 |
472 | * ApplicationName | 0x0002 |
473 | * ProductId | 0x0003 |
474 | * ApplicationId | 0x0005 |
475 | * CatalogVendorId | 0x0006 |
476 | * ApplicationSatus | 0x0007 |
477 | * ClusterRevision | 0xFFFD |
478 \*----------------------------------------------------------------------------*/
481 * Discover Attributes
483 class DiscoverApplicationBasicAttributes : public ModelCommand
486 DiscoverApplicationBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
488 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
490 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
492 chip::Controller::ApplicationBasicCluster cluster;
493 cluster.Associate(device, endpointId);
494 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
498 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
499 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
500 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
501 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
505 * Attribute VendorName
507 class ReadApplicationBasicVendorName : public ModelCommand
510 ReadApplicationBasicVendorName() : ModelCommand("read")
512 AddArgument("attr-name", "vendor-name");
513 ModelCommand::AddArguments();
516 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
518 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
520 chip::Controller::ApplicationBasicCluster cluster;
521 cluster.Associate(device, endpointId);
522 return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
526 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
527 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
528 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
529 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
535 class ReadApplicationBasicVendorId : public ModelCommand
538 ReadApplicationBasicVendorId() : ModelCommand("read")
540 AddArgument("attr-name", "vendor-id");
541 ModelCommand::AddArguments();
544 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
546 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
548 chip::Controller::ApplicationBasicCluster cluster;
549 cluster.Associate(device, endpointId);
550 return cluster.ReadAttributeVendorId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
554 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
555 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
556 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
557 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
561 * Attribute ApplicationName
563 class ReadApplicationBasicApplicationName : public ModelCommand
566 ReadApplicationBasicApplicationName() : ModelCommand("read")
568 AddArgument("attr-name", "application-name");
569 ModelCommand::AddArguments();
572 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
574 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
576 chip::Controller::ApplicationBasicCluster cluster;
577 cluster.Associate(device, endpointId);
578 return cluster.ReadAttributeApplicationName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
582 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
583 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
584 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
585 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
589 * Attribute ProductId
591 class ReadApplicationBasicProductId : public ModelCommand
594 ReadApplicationBasicProductId() : ModelCommand("read")
596 AddArgument("attr-name", "product-id");
597 ModelCommand::AddArguments();
600 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
602 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
604 chip::Controller::ApplicationBasicCluster cluster;
605 cluster.Associate(device, endpointId);
606 return cluster.ReadAttributeProductId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
610 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
611 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
612 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
613 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
617 * Attribute ApplicationId
619 class ReadApplicationBasicApplicationId : public ModelCommand
622 ReadApplicationBasicApplicationId() : ModelCommand("read")
624 AddArgument("attr-name", "application-id");
625 ModelCommand::AddArguments();
628 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
630 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
632 chip::Controller::ApplicationBasicCluster cluster;
633 cluster.Associate(device, endpointId);
634 return cluster.ReadAttributeApplicationId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
638 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
639 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
640 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
641 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
645 * Attribute CatalogVendorId
647 class ReadApplicationBasicCatalogVendorId : public ModelCommand
650 ReadApplicationBasicCatalogVendorId() : ModelCommand("read")
652 AddArgument("attr-name", "catalog-vendor-id");
653 ModelCommand::AddArguments();
656 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
658 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
660 chip::Controller::ApplicationBasicCluster cluster;
661 cluster.Associate(device, endpointId);
662 return cluster.ReadAttributeCatalogVendorId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
666 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
667 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
668 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
669 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
673 * Attribute ApplicationSatus
675 class ReadApplicationBasicApplicationSatus : public ModelCommand
678 ReadApplicationBasicApplicationSatus() : ModelCommand("read")
680 AddArgument("attr-name", "application-satus");
681 ModelCommand::AddArguments();
684 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
686 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
688 chip::Controller::ApplicationBasicCluster cluster;
689 cluster.Associate(device, endpointId);
690 return cluster.ReadAttributeApplicationSatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
694 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
695 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
696 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
697 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
701 * Attribute ClusterRevision
703 class ReadApplicationBasicClusterRevision : public ModelCommand
706 ReadApplicationBasicClusterRevision() : ModelCommand("read")
708 AddArgument("attr-name", "cluster-revision");
709 ModelCommand::AddArguments();
712 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
714 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
716 chip::Controller::ApplicationBasicCluster cluster;
717 cluster.Associate(device, endpointId);
718 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
722 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
723 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
724 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
725 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
728 /*----------------------------------------------------------------------------*\
729 | Cluster BarrierControl | 0x0103 |
730 |------------------------------------------------------------------------------|
732 | * BarrierControlGoToPercent | 0x00 |
733 | * BarrierControlStop | 0x01 |
734 |------------------------------------------------------------------------------|
736 | * BarrierMovingState | 0x0001 |
737 | * BarrierSafetyStatus | 0x0002 |
738 | * BarrierCapabilities | 0x0003 |
739 | * BarrierPosition | 0x000A |
740 | * ClusterRevision | 0xFFFD |
741 \*----------------------------------------------------------------------------*/
744 * Command BarrierControlGoToPercent
746 class BarrierControlBarrierControlGoToPercent : public ModelCommand
749 BarrierControlBarrierControlGoToPercent() : ModelCommand("barrier-control-go-to-percent")
751 AddArgument("percentOpen", 0, UINT8_MAX, &mPercentOpen);
752 ModelCommand::AddArguments();
755 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
757 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
759 chip::Controller::BarrierControlCluster cluster;
760 cluster.Associate(device, endpointId);
761 return cluster.BarrierControlGoToPercent(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPercentOpen);
765 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
766 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
767 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
768 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
769 uint8_t mPercentOpen;
773 * Command BarrierControlStop
775 class BarrierControlBarrierControlStop : public ModelCommand
778 BarrierControlBarrierControlStop() : ModelCommand("barrier-control-stop") { ModelCommand::AddArguments(); }
780 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
782 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x01) on endpoint %" PRIu16, endpointId);
784 chip::Controller::BarrierControlCluster cluster;
785 cluster.Associate(device, endpointId);
786 return cluster.BarrierControlStop(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
790 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
791 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
792 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
793 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
797 * Discover Attributes
799 class DiscoverBarrierControlAttributes : public ModelCommand
802 DiscoverBarrierControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
804 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
806 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
808 chip::Controller::BarrierControlCluster cluster;
809 cluster.Associate(device, endpointId);
810 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
814 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
815 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
816 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
817 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
821 * Attribute BarrierMovingState
823 class ReadBarrierControlBarrierMovingState : public ModelCommand
826 ReadBarrierControlBarrierMovingState() : ModelCommand("read")
828 AddArgument("attr-name", "barrier-moving-state");
829 ModelCommand::AddArguments();
832 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
834 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
836 chip::Controller::BarrierControlCluster cluster;
837 cluster.Associate(device, endpointId);
838 return cluster.ReadAttributeBarrierMovingState(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
842 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
843 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
844 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
845 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
849 * Attribute BarrierSafetyStatus
851 class ReadBarrierControlBarrierSafetyStatus : public ModelCommand
854 ReadBarrierControlBarrierSafetyStatus() : ModelCommand("read")
856 AddArgument("attr-name", "barrier-safety-status");
857 ModelCommand::AddArguments();
860 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
862 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
864 chip::Controller::BarrierControlCluster cluster;
865 cluster.Associate(device, endpointId);
866 return cluster.ReadAttributeBarrierSafetyStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
870 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
871 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
872 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
873 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
877 * Attribute BarrierCapabilities
879 class ReadBarrierControlBarrierCapabilities : public ModelCommand
882 ReadBarrierControlBarrierCapabilities() : ModelCommand("read")
884 AddArgument("attr-name", "barrier-capabilities");
885 ModelCommand::AddArguments();
888 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
890 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
892 chip::Controller::BarrierControlCluster cluster;
893 cluster.Associate(device, endpointId);
894 return cluster.ReadAttributeBarrierCapabilities(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
898 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
899 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
900 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
901 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
905 * Attribute BarrierPosition
907 class ReadBarrierControlBarrierPosition : public ModelCommand
910 ReadBarrierControlBarrierPosition() : ModelCommand("read")
912 AddArgument("attr-name", "barrier-position");
913 ModelCommand::AddArguments();
916 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
918 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
920 chip::Controller::BarrierControlCluster cluster;
921 cluster.Associate(device, endpointId);
922 return cluster.ReadAttributeBarrierPosition(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
926 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
927 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
928 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
929 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
933 * Attribute ClusterRevision
935 class ReadBarrierControlClusterRevision : public ModelCommand
938 ReadBarrierControlClusterRevision() : ModelCommand("read")
940 AddArgument("attr-name", "cluster-revision");
941 ModelCommand::AddArguments();
944 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
946 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
948 chip::Controller::BarrierControlCluster cluster;
949 cluster.Associate(device, endpointId);
950 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
954 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
955 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
956 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
957 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
960 /*----------------------------------------------------------------------------*\
961 | Cluster Basic | 0x0028 |
962 |------------------------------------------------------------------------------|
964 | * MfgSpecificPing | 0x00 |
965 |------------------------------------------------------------------------------|
967 | * InteractionModelVersion | 0x0000 |
968 | * VendorName | 0x0001 |
969 | * VendorID | 0x0002 |
970 | * ProductName | 0x0003 |
971 | * ProductID | 0x0004 |
972 | * UserLabel | 0x0005 |
973 | * Location | 0x0006 |
974 | * HardwareVersion | 0x0007 |
975 | * HardwareVersionString | 0x0008 |
976 | * SoftwareVersion | 0x0009 |
977 | * SoftwareVersionString | 0x000A |
978 | * ClusterRevision | 0xFFFD |
979 \*----------------------------------------------------------------------------*/
982 * Command MfgSpecificPing
984 class BasicMfgSpecificPing : public ModelCommand
987 BasicMfgSpecificPing() : ModelCommand("mfg-specific-ping") { ModelCommand::AddArguments(); }
989 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
991 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
993 chip::Controller::BasicCluster cluster;
994 cluster.Associate(device, endpointId);
995 return cluster.MfgSpecificPing(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
999 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1000 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1001 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1002 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1006 * Discover Attributes
1008 class DiscoverBasicAttributes : public ModelCommand
1011 DiscoverBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
1013 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1015 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
1017 chip::Controller::BasicCluster cluster;
1018 cluster.Associate(device, endpointId);
1019 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1023 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1024 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1025 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1026 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1030 * Attribute InteractionModelVersion
1032 class ReadBasicInteractionModelVersion : public ModelCommand
1035 ReadBasicInteractionModelVersion() : ModelCommand("read")
1037 AddArgument("attr-name", "interaction-model-version");
1038 ModelCommand::AddArguments();
1041 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1043 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1045 chip::Controller::BasicCluster cluster;
1046 cluster.Associate(device, endpointId);
1047 return cluster.ReadAttributeInteractionModelVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1051 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1052 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1053 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1054 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1058 * Attribute VendorName
1060 class ReadBasicVendorName : public ModelCommand
1063 ReadBasicVendorName() : ModelCommand("read")
1065 AddArgument("attr-name", "vendor-name");
1066 ModelCommand::AddArguments();
1069 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1071 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1073 chip::Controller::BasicCluster cluster;
1074 cluster.Associate(device, endpointId);
1075 return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1079 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1080 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1081 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1082 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1086 * Attribute VendorID
1088 class ReadBasicVendorID : public ModelCommand
1091 ReadBasicVendorID() : ModelCommand("read")
1093 AddArgument("attr-name", "vendor-id");
1094 ModelCommand::AddArguments();
1097 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1099 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1101 chip::Controller::BasicCluster cluster;
1102 cluster.Associate(device, endpointId);
1103 return cluster.ReadAttributeVendorID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1107 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1108 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1109 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1110 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1114 * Attribute ProductName
1116 class ReadBasicProductName : public ModelCommand
1119 ReadBasicProductName() : ModelCommand("read")
1121 AddArgument("attr-name", "product-name");
1122 ModelCommand::AddArguments();
1125 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1127 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1129 chip::Controller::BasicCluster cluster;
1130 cluster.Associate(device, endpointId);
1131 return cluster.ReadAttributeProductName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1135 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1136 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1137 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1138 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1142 * Attribute ProductID
1144 class ReadBasicProductID : public ModelCommand
1147 ReadBasicProductID() : ModelCommand("read")
1149 AddArgument("attr-name", "product-id");
1150 ModelCommand::AddArguments();
1153 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1155 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1157 chip::Controller::BasicCluster cluster;
1158 cluster.Associate(device, endpointId);
1159 return cluster.ReadAttributeProductID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1163 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1164 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1165 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1166 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1170 * Attribute UserLabel
1172 class ReadBasicUserLabel : public ModelCommand
1175 ReadBasicUserLabel() : ModelCommand("read")
1177 AddArgument("attr-name", "user-label");
1178 ModelCommand::AddArguments();
1181 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1183 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1185 chip::Controller::BasicCluster cluster;
1186 cluster.Associate(device, endpointId);
1187 return cluster.ReadAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1191 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1192 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1193 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1194 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1197 class WriteBasicUserLabel : public ModelCommand
1200 WriteBasicUserLabel() : ModelCommand("write")
1202 AddArgument("attr-name", "user-label");
1203 AddArgument("attr-value", &mValue);
1204 ModelCommand::AddArguments();
1207 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1209 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);
1211 chip::Controller::BasicCluster cluster;
1212 cluster.Associate(device, endpointId);
1213 return cluster.WriteAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
1214 chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
1218 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1219 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1220 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1221 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1226 * Attribute Location
1228 class ReadBasicLocation : public ModelCommand
1231 ReadBasicLocation() : ModelCommand("read")
1233 AddArgument("attr-name", "location");
1234 ModelCommand::AddArguments();
1237 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1239 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1241 chip::Controller::BasicCluster cluster;
1242 cluster.Associate(device, endpointId);
1243 return cluster.ReadAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1247 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1248 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1249 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1250 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1253 class WriteBasicLocation : public ModelCommand
1256 WriteBasicLocation() : ModelCommand("write")
1258 AddArgument("attr-name", "location");
1259 AddArgument("attr-value", &mValue);
1260 ModelCommand::AddArguments();
1263 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1265 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);
1267 chip::Controller::BasicCluster cluster;
1268 cluster.Associate(device, endpointId);
1269 return cluster.WriteAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
1270 chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
1274 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1275 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1276 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1277 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1282 * Attribute HardwareVersion
1284 class ReadBasicHardwareVersion : public ModelCommand
1287 ReadBasicHardwareVersion() : ModelCommand("read")
1289 AddArgument("attr-name", "hardware-version");
1290 ModelCommand::AddArguments();
1293 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1295 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1297 chip::Controller::BasicCluster cluster;
1298 cluster.Associate(device, endpointId);
1299 return cluster.ReadAttributeHardwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1303 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1304 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1305 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1306 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1310 * Attribute HardwareVersionString
1312 class ReadBasicHardwareVersionString : public ModelCommand
1315 ReadBasicHardwareVersionString() : ModelCommand("read")
1317 AddArgument("attr-name", "hardware-version-string");
1318 ModelCommand::AddArguments();
1321 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1323 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1325 chip::Controller::BasicCluster cluster;
1326 cluster.Associate(device, endpointId);
1327 return cluster.ReadAttributeHardwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1331 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1332 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1333 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1334 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1338 * Attribute SoftwareVersion
1340 class ReadBasicSoftwareVersion : public ModelCommand
1343 ReadBasicSoftwareVersion() : ModelCommand("read")
1345 AddArgument("attr-name", "software-version");
1346 ModelCommand::AddArguments();
1349 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1351 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1353 chip::Controller::BasicCluster cluster;
1354 cluster.Associate(device, endpointId);
1355 return cluster.ReadAttributeSoftwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1359 chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
1360 new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
1361 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1362 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1366 * Attribute SoftwareVersionString
1368 class ReadBasicSoftwareVersionString : public ModelCommand
1371 ReadBasicSoftwareVersionString() : ModelCommand("read")
1373 AddArgument("attr-name", "software-version-string");
1374 ModelCommand::AddArguments();
1377 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1379 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1381 chip::Controller::BasicCluster cluster;
1382 cluster.Associate(device, endpointId);
1383 return cluster.ReadAttributeSoftwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1387 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1388 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1389 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1390 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1394 * Attribute ClusterRevision
1396 class ReadBasicClusterRevision : public ModelCommand
1399 ReadBasicClusterRevision() : ModelCommand("read")
1401 AddArgument("attr-name", "cluster-revision");
1402 ModelCommand::AddArguments();
1405 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1407 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1409 chip::Controller::BasicCluster cluster;
1410 cluster.Associate(device, endpointId);
1411 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1415 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1416 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1417 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1418 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1421 /*----------------------------------------------------------------------------*\
1422 | Cluster Binding | 0xF000 |
1423 |------------------------------------------------------------------------------|
1427 |------------------------------------------------------------------------------|
1429 | * ClusterRevision | 0xFFFD |
1430 \*----------------------------------------------------------------------------*/
1435 class BindingBind : public ModelCommand
1438 BindingBind() : ModelCommand("bind")
1440 AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
1441 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
1442 AddArgument("endpointId", 0, UINT8_MAX, &mEndpointId);
1443 AddArgument("clusterId", 0, UINT16_MAX, &mClusterId);
1444 ModelCommand::AddArguments();
1447 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1449 ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x00) on endpoint %" PRIu16, endpointId);
1451 chip::Controller::BindingCluster cluster;
1452 cluster.Associate(device, endpointId);
1453 return cluster.Bind(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNodeId, mGroupId, mEndpointId, mClusterId);
1457 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1458 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1459 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1460 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1461 chip::NodeId mNodeId;
1462 chip::GroupId mGroupId;
1463 chip::EndpointId mEndpointId;
1464 chip::ClusterId mClusterId;
1470 class BindingUnbind : public ModelCommand
1473 BindingUnbind() : ModelCommand("unbind")
1475 AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
1476 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
1477 AddArgument("endpointId", 0, UINT8_MAX, &mEndpointId);
1478 AddArgument("clusterId", 0, UINT16_MAX, &mClusterId);
1479 ModelCommand::AddArguments();
1482 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1484 ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x01) on endpoint %" PRIu16, endpointId);
1486 chip::Controller::BindingCluster cluster;
1487 cluster.Associate(device, endpointId);
1488 return cluster.Unbind(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNodeId, mGroupId, mEndpointId, mClusterId);
1492 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1493 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1494 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1495 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1496 chip::NodeId mNodeId;
1497 chip::GroupId mGroupId;
1498 chip::EndpointId mEndpointId;
1499 chip::ClusterId mClusterId;
1503 * Discover Attributes
1505 class DiscoverBindingAttributes : public ModelCommand
1508 DiscoverBindingAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
1510 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1512 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
1514 chip::Controller::BindingCluster cluster;
1515 cluster.Associate(device, endpointId);
1516 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1520 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1521 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1522 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1523 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1527 * Attribute ClusterRevision
1529 class ReadBindingClusterRevision : public ModelCommand
1532 ReadBindingClusterRevision() : ModelCommand("read")
1534 AddArgument("attr-name", "cluster-revision");
1535 ModelCommand::AddArguments();
1538 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1540 ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x00) on endpoint %" PRIu16, endpointId);
1542 chip::Controller::BindingCluster cluster;
1543 cluster.Associate(device, endpointId);
1544 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1548 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1549 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1550 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1551 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1554 /*----------------------------------------------------------------------------*\
1555 | Cluster ColorControl | 0x0300 |
1556 |------------------------------------------------------------------------------|
1558 | * MoveColor | 0x08 |
1559 | * MoveColorTemperature | 0x4B |
1560 | * MoveHue | 0x01 |
1561 | * MoveSaturation | 0x04 |
1562 | * MoveToColor | 0x07 |
1563 | * MoveToColorTemperature | 0x0A |
1564 | * MoveToHue | 0x00 |
1565 | * MoveToHueAndSaturation | 0x06 |
1566 | * MoveToSaturation | 0x03 |
1567 | * StepColor | 0x09 |
1568 | * StepColorTemperature | 0x4C |
1569 | * StepHue | 0x02 |
1570 | * StepSaturation | 0x05 |
1571 | * StopMoveStep | 0x47 |
1572 |------------------------------------------------------------------------------|
1574 | * CurrentHue | 0x0000 |
1575 | * CurrentSaturation | 0x0001 |
1576 | * RemainingTime | 0x0002 |
1577 | * CurrentX | 0x0003 |
1578 | * CurrentY | 0x0004 |
1579 | * DriftCompensation | 0x0005 |
1580 | * CompensationText | 0x0006 |
1581 | * ColorTemperature | 0x0007 |
1582 | * ColorMode | 0x0008 |
1583 | * ColorControlOptions | 0x000F |
1584 | * NumberOfPrimaries | 0x0010 |
1585 | * Primary1X | 0x0011 |
1586 | * Primary1Y | 0x0012 |
1587 | * Primary1Intensity | 0x0013 |
1588 | * Primary2X | 0x0015 |
1589 | * Primary2Y | 0x0016 |
1590 | * Primary2Intensity | 0x0017 |
1591 | * Primary3X | 0x0019 |
1592 | * Primary3Y | 0x001A |
1593 | * Primary3Intensity | 0x001B |
1594 | * Primary4X | 0x0020 |
1595 | * Primary4Y | 0x0021 |
1596 | * Primary4Intensity | 0x0022 |
1597 | * Primary5X | 0x0024 |
1598 | * Primary5Y | 0x0025 |
1599 | * Primary5Intensity | 0x0026 |
1600 | * Primary6X | 0x0028 |
1601 | * Primary6Y | 0x0029 |
1602 | * Primary6Intensity | 0x002A |
1603 | * WhitePointX | 0x0030 |
1604 | * WhitePointY | 0x0031 |
1605 | * ColorPointRX | 0x0032 |
1606 | * ColorPointRY | 0x0033 |
1607 | * ColorPointRIntensity | 0x0034 |
1608 | * ColorPointGX | 0x0036 |
1609 | * ColorPointGY | 0x0037 |
1610 | * ColorPointGIntensity | 0x0038 |
1611 | * ColorPointBX | 0x003A |
1612 | * ColorPointBY | 0x003B |
1613 | * ColorPointBIntensity | 0x003C |
1614 | * EnhancedCurrentHue | 0x4000 |
1615 | * EnhancedColorMode | 0x4001 |
1616 | * ColorLoopActive | 0x4002 |
1617 | * ColorLoopDirection | 0x4003 |
1618 | * ColorLoopTime | 0x4004 |
1619 | * ColorCapabilities | 0x400A |
1620 | * ColorTempPhysicalMin | 0x400B |
1621 | * ColorTempPhysicalMax | 0x400C |
1622 | * CoupleColorTempToLevelMinMireds | 0x400D |
1623 | * StartUpColorTemperatureMireds | 0x4010 |
1624 | * ClusterRevision | 0xFFFD |
1625 \*----------------------------------------------------------------------------*/
1630 class ColorControlMoveColor : public ModelCommand
1633 ColorControlMoveColor() : ModelCommand("move-color")
1635 AddArgument("rateX", INT16_MIN, INT16_MAX, &mRateX);
1636 AddArgument("rateY", INT16_MIN, INT16_MAX, &mRateY);
1637 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1638 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1639 ModelCommand::AddArguments();
1642 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1644 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x08) on endpoint %" PRIu16, endpointId);
1646 chip::Controller::ColorControlCluster cluster;
1647 cluster.Associate(device, endpointId);
1648 return cluster.MoveColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mRateX, mRateY, mOptionsMask,
1653 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1654 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1655 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1656 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1659 uint8_t mOptionsMask;
1660 uint8_t mOptionsOverride;
1664 * Command MoveColorTemperature
1666 class ColorControlMoveColorTemperature : public ModelCommand
1669 ColorControlMoveColorTemperature() : ModelCommand("move-color-temperature")
1671 AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
1672 AddArgument("rate", 0, UINT16_MAX, &mRate);
1673 AddArgument("colorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum);
1674 AddArgument("colorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum);
1675 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1676 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1677 ModelCommand::AddArguments();
1680 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1682 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x4B) on endpoint %" PRIu16, endpointId);
1684 chip::Controller::ColorControlCluster cluster;
1685 cluster.Associate(device, endpointId);
1686 return cluster.MoveColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate,
1687 mColorTemperatureMinimum, mColorTemperatureMaximum, mOptionsMask, mOptionsOverride);
1691 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1692 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1693 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1694 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1697 uint16_t mColorTemperatureMinimum;
1698 uint16_t mColorTemperatureMaximum;
1699 uint8_t mOptionsMask;
1700 uint8_t mOptionsOverride;
1706 class ColorControlMoveHue : public ModelCommand
1709 ColorControlMoveHue() : ModelCommand("move-hue")
1711 AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
1712 AddArgument("rate", 0, UINT8_MAX, &mRate);
1713 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1714 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1715 ModelCommand::AddArguments();
1718 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1720 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
1722 chip::Controller::ColorControlCluster cluster;
1723 cluster.Associate(device, endpointId);
1724 return cluster.MoveHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionsMask,
1729 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1730 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1731 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1732 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1735 uint8_t mOptionsMask;
1736 uint8_t mOptionsOverride;
1740 * Command MoveSaturation
1742 class ColorControlMoveSaturation : public ModelCommand
1745 ColorControlMoveSaturation() : ModelCommand("move-saturation")
1747 AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
1748 AddArgument("rate", 0, UINT8_MAX, &mRate);
1749 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1750 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1751 ModelCommand::AddArguments();
1754 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1756 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x04) on endpoint %" PRIu16, endpointId);
1758 chip::Controller::ColorControlCluster cluster;
1759 cluster.Associate(device, endpointId);
1760 return cluster.MoveSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionsMask,
1765 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1766 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1767 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1768 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1771 uint8_t mOptionsMask;
1772 uint8_t mOptionsOverride;
1776 * Command MoveToColor
1778 class ColorControlMoveToColor : public ModelCommand
1781 ColorControlMoveToColor() : ModelCommand("move-to-color")
1783 AddArgument("colorX", 0, UINT16_MAX, &mColorX);
1784 AddArgument("colorY", 0, UINT16_MAX, &mColorY);
1785 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
1786 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1787 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1788 ModelCommand::AddArguments();
1791 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1793 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x07) on endpoint %" PRIu16, endpointId);
1795 chip::Controller::ColorControlCluster cluster;
1796 cluster.Associate(device, endpointId);
1797 return cluster.MoveToColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mColorX, mColorY, mTransitionTime,
1798 mOptionsMask, mOptionsOverride);
1802 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1803 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1804 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1805 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1808 uint16_t mTransitionTime;
1809 uint8_t mOptionsMask;
1810 uint8_t mOptionsOverride;
1814 * Command MoveToColorTemperature
1816 class ColorControlMoveToColorTemperature : public ModelCommand
1819 ColorControlMoveToColorTemperature() : ModelCommand("move-to-color-temperature")
1821 AddArgument("colorTemperature", 0, UINT16_MAX, &mColorTemperature);
1822 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
1823 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1824 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1825 ModelCommand::AddArguments();
1828 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1830 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x0A) on endpoint %" PRIu16, endpointId);
1832 chip::Controller::ColorControlCluster cluster;
1833 cluster.Associate(device, endpointId);
1834 return cluster.MoveToColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mColorTemperature,
1835 mTransitionTime, mOptionsMask, mOptionsOverride);
1839 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1840 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1841 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1842 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1843 uint16_t mColorTemperature;
1844 uint16_t mTransitionTime;
1845 uint8_t mOptionsMask;
1846 uint8_t mOptionsOverride;
1852 class ColorControlMoveToHue : public ModelCommand
1855 ColorControlMoveToHue() : ModelCommand("move-to-hue")
1857 AddArgument("hue", 0, UINT8_MAX, &mHue);
1858 AddArgument("direction", 0, UINT8_MAX, &mDirection);
1859 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
1860 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1861 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1862 ModelCommand::AddArguments();
1865 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1867 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
1869 chip::Controller::ColorControlCluster cluster;
1870 cluster.Associate(device, endpointId);
1871 return cluster.MoveToHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mHue, mDirection, mTransitionTime,
1872 mOptionsMask, mOptionsOverride);
1876 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1877 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1878 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1879 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1882 uint16_t mTransitionTime;
1883 uint8_t mOptionsMask;
1884 uint8_t mOptionsOverride;
1888 * Command MoveToHueAndSaturation
1890 class ColorControlMoveToHueAndSaturation : public ModelCommand
1893 ColorControlMoveToHueAndSaturation() : ModelCommand("move-to-hue-and-saturation")
1895 AddArgument("hue", 0, UINT8_MAX, &mHue);
1896 AddArgument("saturation", 0, UINT8_MAX, &mSaturation);
1897 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
1898 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1899 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1900 ModelCommand::AddArguments();
1903 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1905 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
1907 chip::Controller::ColorControlCluster cluster;
1908 cluster.Associate(device, endpointId);
1909 return cluster.MoveToHueAndSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mHue, mSaturation,
1910 mTransitionTime, mOptionsMask, mOptionsOverride);
1914 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1915 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1916 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1917 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1919 uint8_t mSaturation;
1920 uint16_t mTransitionTime;
1921 uint8_t mOptionsMask;
1922 uint8_t mOptionsOverride;
1926 * Command MoveToSaturation
1928 class ColorControlMoveToSaturation : public ModelCommand
1931 ColorControlMoveToSaturation() : ModelCommand("move-to-saturation")
1933 AddArgument("saturation", 0, UINT8_MAX, &mSaturation);
1934 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
1935 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1936 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1937 ModelCommand::AddArguments();
1940 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1942 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x03) on endpoint %" PRIu16, endpointId);
1944 chip::Controller::ColorControlCluster cluster;
1945 cluster.Associate(device, endpointId);
1946 return cluster.MoveToSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mSaturation, mTransitionTime,
1947 mOptionsMask, mOptionsOverride);
1951 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1952 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1953 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1954 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1955 uint8_t mSaturation;
1956 uint16_t mTransitionTime;
1957 uint8_t mOptionsMask;
1958 uint8_t mOptionsOverride;
1964 class ColorControlStepColor : public ModelCommand
1967 ColorControlStepColor() : ModelCommand("step-color")
1969 AddArgument("stepX", INT16_MIN, INT16_MAX, &mStepX);
1970 AddArgument("stepY", INT16_MIN, INT16_MAX, &mStepY);
1971 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
1972 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1973 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1974 ModelCommand::AddArguments();
1977 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1979 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x09) on endpoint %" PRIu16, endpointId);
1981 chip::Controller::ColorControlCluster cluster;
1982 cluster.Associate(device, endpointId);
1983 return cluster.StepColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepX, mStepY, mTransitionTime,
1984 mOptionsMask, mOptionsOverride);
1988 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1989 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1990 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1991 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1994 uint16_t mTransitionTime;
1995 uint8_t mOptionsMask;
1996 uint8_t mOptionsOverride;
2000 * Command StepColorTemperature
2002 class ColorControlStepColorTemperature : public ModelCommand
2005 ColorControlStepColorTemperature() : ModelCommand("step-color-temperature")
2007 AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
2008 AddArgument("stepSize", 0, UINT16_MAX, &mStepSize);
2009 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
2010 AddArgument("colorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum);
2011 AddArgument("colorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum);
2012 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2013 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2014 ModelCommand::AddArguments();
2017 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2019 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x4C) on endpoint %" PRIu16, endpointId);
2021 chip::Controller::ColorControlCluster cluster;
2022 cluster.Associate(device, endpointId);
2023 return cluster.StepColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
2024 mTransitionTime, mColorTemperatureMinimum, mColorTemperatureMaximum, mOptionsMask,
2029 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2030 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2031 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2032 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2035 uint16_t mTransitionTime;
2036 uint16_t mColorTemperatureMinimum;
2037 uint16_t mColorTemperatureMaximum;
2038 uint8_t mOptionsMask;
2039 uint8_t mOptionsOverride;
2045 class ColorControlStepHue : public ModelCommand
2048 ColorControlStepHue() : ModelCommand("step-hue")
2050 AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
2051 AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
2052 AddArgument("transitionTime", 0, UINT8_MAX, &mTransitionTime);
2053 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2054 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2055 ModelCommand::AddArguments();
2058 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2060 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x02) on endpoint %" PRIu16, endpointId);
2062 chip::Controller::ColorControlCluster cluster;
2063 cluster.Associate(device, endpointId);
2064 return cluster.StepHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize, mTransitionTime,
2065 mOptionsMask, mOptionsOverride);
2069 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2070 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2071 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2072 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2075 uint8_t mTransitionTime;
2076 uint8_t mOptionsMask;
2077 uint8_t mOptionsOverride;
2081 * Command StepSaturation
2083 class ColorControlStepSaturation : public ModelCommand
2086 ColorControlStepSaturation() : ModelCommand("step-saturation")
2088 AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
2089 AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
2090 AddArgument("transitionTime", 0, UINT8_MAX, &mTransitionTime);
2091 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2092 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2093 ModelCommand::AddArguments();
2096 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2098 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x05) on endpoint %" PRIu16, endpointId);
2100 chip::Controller::ColorControlCluster cluster;
2101 cluster.Associate(device, endpointId);
2102 return cluster.StepSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
2103 mTransitionTime, mOptionsMask, mOptionsOverride);
2107 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2108 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2109 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2110 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2113 uint8_t mTransitionTime;
2114 uint8_t mOptionsMask;
2115 uint8_t mOptionsOverride;
2119 * Command StopMoveStep
2121 class ColorControlStopMoveStep : public ModelCommand
2124 ColorControlStopMoveStep() : ModelCommand("stop-move-step")
2126 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2127 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2128 ModelCommand::AddArguments();
2131 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2133 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x47) on endpoint %" PRIu16, endpointId);
2135 chip::Controller::ColorControlCluster cluster;
2136 cluster.Associate(device, endpointId);
2137 return cluster.StopMoveStep(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOptionsMask, mOptionsOverride);
2141 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2142 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2143 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2144 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2145 uint8_t mOptionsMask;
2146 uint8_t mOptionsOverride;
2150 * Discover Attributes
2152 class DiscoverColorControlAttributes : public ModelCommand
2155 DiscoverColorControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
2157 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2159 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
2161 chip::Controller::ColorControlCluster cluster;
2162 cluster.Associate(device, endpointId);
2163 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2167 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2168 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2169 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2170 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2174 * Attribute CurrentHue
2176 class ReadColorControlCurrentHue : public ModelCommand
2179 ReadColorControlCurrentHue() : ModelCommand("read")
2181 AddArgument("attr-name", "current-hue");
2182 ModelCommand::AddArguments();
2185 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2187 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2189 chip::Controller::ColorControlCluster cluster;
2190 cluster.Associate(device, endpointId);
2191 return cluster.ReadAttributeCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2195 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2196 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2197 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2198 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2201 class ReportColorControlCurrentHue : public ModelCommand
2204 ReportColorControlCurrentHue() : ModelCommand("report")
2206 AddArgument("attr-name", "current-hue");
2207 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
2208 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
2209 AddArgument("change", 0, UINT8_MAX, &mChange);
2210 ModelCommand::AddArguments();
2213 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2215 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2217 chip::Controller::ColorControlCluster cluster;
2218 cluster.Associate(device, endpointId);
2220 CHIP_ERROR err = cluster.ReportAttributeCurrentHue(onReportCallback->Cancel());
2221 if (err != CHIP_NO_ERROR)
2226 return cluster.ConfigureAttributeCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
2227 mMaxInterval, mChange);
2231 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2232 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2233 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2234 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2235 chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
2236 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2237 uint16_t mMinInterval;
2238 uint16_t mMaxInterval;
2243 * Attribute CurrentSaturation
2245 class ReadColorControlCurrentSaturation : public ModelCommand
2248 ReadColorControlCurrentSaturation() : ModelCommand("read")
2250 AddArgument("attr-name", "current-saturation");
2251 ModelCommand::AddArguments();
2254 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2256 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2258 chip::Controller::ColorControlCluster cluster;
2259 cluster.Associate(device, endpointId);
2260 return cluster.ReadAttributeCurrentSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2264 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2265 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2266 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2267 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2270 class ReportColorControlCurrentSaturation : public ModelCommand
2273 ReportColorControlCurrentSaturation() : ModelCommand("report")
2275 AddArgument("attr-name", "current-saturation");
2276 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
2277 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
2278 AddArgument("change", 0, UINT8_MAX, &mChange);
2279 ModelCommand::AddArguments();
2282 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2284 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2286 chip::Controller::ColorControlCluster cluster;
2287 cluster.Associate(device, endpointId);
2289 CHIP_ERROR err = cluster.ReportAttributeCurrentSaturation(onReportCallback->Cancel());
2290 if (err != CHIP_NO_ERROR)
2295 return cluster.ConfigureAttributeCurrentSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
2296 mMaxInterval, mChange);
2300 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2301 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2302 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2303 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2304 chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
2305 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2306 uint16_t mMinInterval;
2307 uint16_t mMaxInterval;
2312 * Attribute RemainingTime
2314 class ReadColorControlRemainingTime : public ModelCommand
2317 ReadColorControlRemainingTime() : ModelCommand("read")
2319 AddArgument("attr-name", "remaining-time");
2320 ModelCommand::AddArguments();
2323 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2325 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2327 chip::Controller::ColorControlCluster cluster;
2328 cluster.Associate(device, endpointId);
2329 return cluster.ReadAttributeRemainingTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2333 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2334 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2335 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2336 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2340 * Attribute CurrentX
2342 class ReadColorControlCurrentX : public ModelCommand
2345 ReadColorControlCurrentX() : ModelCommand("read")
2347 AddArgument("attr-name", "current-x");
2348 ModelCommand::AddArguments();
2351 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2353 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2355 chip::Controller::ColorControlCluster cluster;
2356 cluster.Associate(device, endpointId);
2357 return cluster.ReadAttributeCurrentX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2361 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2362 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2363 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2364 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2367 class ReportColorControlCurrentX : public ModelCommand
2370 ReportColorControlCurrentX() : ModelCommand("report")
2372 AddArgument("attr-name", "current-x");
2373 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
2374 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
2375 AddArgument("change", 0, UINT16_MAX, &mChange);
2376 ModelCommand::AddArguments();
2379 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2381 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2383 chip::Controller::ColorControlCluster cluster;
2384 cluster.Associate(device, endpointId);
2386 CHIP_ERROR err = cluster.ReportAttributeCurrentX(onReportCallback->Cancel());
2387 if (err != CHIP_NO_ERROR)
2392 return cluster.ConfigureAttributeCurrentX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
2393 mMaxInterval, mChange);
2397 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2398 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2399 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2400 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2401 chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
2402 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2403 uint16_t mMinInterval;
2404 uint16_t mMaxInterval;
2409 * Attribute CurrentY
2411 class ReadColorControlCurrentY : public ModelCommand
2414 ReadColorControlCurrentY() : ModelCommand("read")
2416 AddArgument("attr-name", "current-y");
2417 ModelCommand::AddArguments();
2420 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2422 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2424 chip::Controller::ColorControlCluster cluster;
2425 cluster.Associate(device, endpointId);
2426 return cluster.ReadAttributeCurrentY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2430 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2431 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2432 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2433 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2436 class ReportColorControlCurrentY : public ModelCommand
2439 ReportColorControlCurrentY() : ModelCommand("report")
2441 AddArgument("attr-name", "current-y");
2442 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
2443 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
2444 AddArgument("change", 0, UINT16_MAX, &mChange);
2445 ModelCommand::AddArguments();
2448 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2450 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2452 chip::Controller::ColorControlCluster cluster;
2453 cluster.Associate(device, endpointId);
2455 CHIP_ERROR err = cluster.ReportAttributeCurrentY(onReportCallback->Cancel());
2456 if (err != CHIP_NO_ERROR)
2461 return cluster.ConfigureAttributeCurrentY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
2462 mMaxInterval, mChange);
2466 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2467 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2468 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2469 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2470 chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
2471 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2472 uint16_t mMinInterval;
2473 uint16_t mMaxInterval;
2478 * Attribute DriftCompensation
2480 class ReadColorControlDriftCompensation : public ModelCommand
2483 ReadColorControlDriftCompensation() : ModelCommand("read")
2485 AddArgument("attr-name", "drift-compensation");
2486 ModelCommand::AddArguments();
2489 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2491 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2493 chip::Controller::ColorControlCluster cluster;
2494 cluster.Associate(device, endpointId);
2495 return cluster.ReadAttributeDriftCompensation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2499 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2500 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2501 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2502 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2506 * Attribute CompensationText
2508 class ReadColorControlCompensationText : public ModelCommand
2511 ReadColorControlCompensationText() : ModelCommand("read")
2513 AddArgument("attr-name", "compensation-text");
2514 ModelCommand::AddArguments();
2517 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2519 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2521 chip::Controller::ColorControlCluster cluster;
2522 cluster.Associate(device, endpointId);
2523 return cluster.ReadAttributeCompensationText(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2527 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
2528 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
2529 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2530 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2534 * Attribute ColorTemperature
2536 class ReadColorControlColorTemperature : public ModelCommand
2539 ReadColorControlColorTemperature() : ModelCommand("read")
2541 AddArgument("attr-name", "color-temperature");
2542 ModelCommand::AddArguments();
2545 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2547 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2549 chip::Controller::ColorControlCluster cluster;
2550 cluster.Associate(device, endpointId);
2551 return cluster.ReadAttributeColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2555 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2556 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2557 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2558 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2561 class ReportColorControlColorTemperature : public ModelCommand
2564 ReportColorControlColorTemperature() : ModelCommand("report")
2566 AddArgument("attr-name", "color-temperature");
2567 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
2568 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
2569 AddArgument("change", 0, UINT16_MAX, &mChange);
2570 ModelCommand::AddArguments();
2573 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2575 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2577 chip::Controller::ColorControlCluster cluster;
2578 cluster.Associate(device, endpointId);
2580 CHIP_ERROR err = cluster.ReportAttributeColorTemperature(onReportCallback->Cancel());
2581 if (err != CHIP_NO_ERROR)
2586 return cluster.ConfigureAttributeColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
2587 mMaxInterval, mChange);
2591 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2592 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2593 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2594 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2595 chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
2596 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2597 uint16_t mMinInterval;
2598 uint16_t mMaxInterval;
2603 * Attribute ColorMode
2605 class ReadColorControlColorMode : public ModelCommand
2608 ReadColorControlColorMode() : ModelCommand("read")
2610 AddArgument("attr-name", "color-mode");
2611 ModelCommand::AddArguments();
2614 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2616 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2618 chip::Controller::ColorControlCluster cluster;
2619 cluster.Associate(device, endpointId);
2620 return cluster.ReadAttributeColorMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2624 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2625 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2626 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2627 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2631 * Attribute ColorControlOptions
2633 class ReadColorControlColorControlOptions : public ModelCommand
2636 ReadColorControlColorControlOptions() : ModelCommand("read")
2638 AddArgument("attr-name", "color-control-options");
2639 ModelCommand::AddArguments();
2642 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2644 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2646 chip::Controller::ColorControlCluster cluster;
2647 cluster.Associate(device, endpointId);
2648 return cluster.ReadAttributeColorControlOptions(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2652 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2653 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2654 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2655 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2658 class WriteColorControlColorControlOptions : public ModelCommand
2661 WriteColorControlColorControlOptions() : ModelCommand("write")
2663 AddArgument("attr-name", "color-control-options");
2664 AddArgument("attr-value", 0, UINT8_MAX, &mValue);
2665 ModelCommand::AddArguments();
2668 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2670 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
2672 chip::Controller::ColorControlCluster cluster;
2673 cluster.Associate(device, endpointId);
2674 return cluster.WriteAttributeColorControlOptions(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
2678 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2679 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2680 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2681 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2686 * Attribute NumberOfPrimaries
2688 class ReadColorControlNumberOfPrimaries : public ModelCommand
2691 ReadColorControlNumberOfPrimaries() : ModelCommand("read")
2693 AddArgument("attr-name", "number-of-primaries");
2694 ModelCommand::AddArguments();
2697 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2699 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2701 chip::Controller::ColorControlCluster cluster;
2702 cluster.Associate(device, endpointId);
2703 return cluster.ReadAttributeNumberOfPrimaries(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2707 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2708 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2709 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2710 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2714 * Attribute Primary1X
2716 class ReadColorControlPrimary1X : public ModelCommand
2719 ReadColorControlPrimary1X() : ModelCommand("read")
2721 AddArgument("attr-name", "primary1x");
2722 ModelCommand::AddArguments();
2725 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2727 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2729 chip::Controller::ColorControlCluster cluster;
2730 cluster.Associate(device, endpointId);
2731 return cluster.ReadAttributePrimary1X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2735 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2736 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2737 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2738 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2742 * Attribute Primary1Y
2744 class ReadColorControlPrimary1Y : public ModelCommand
2747 ReadColorControlPrimary1Y() : ModelCommand("read")
2749 AddArgument("attr-name", "primary1y");
2750 ModelCommand::AddArguments();
2753 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2755 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2757 chip::Controller::ColorControlCluster cluster;
2758 cluster.Associate(device, endpointId);
2759 return cluster.ReadAttributePrimary1Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2763 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2764 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2765 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2766 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2770 * Attribute Primary1Intensity
2772 class ReadColorControlPrimary1Intensity : public ModelCommand
2775 ReadColorControlPrimary1Intensity() : ModelCommand("read")
2777 AddArgument("attr-name", "primary1intensity");
2778 ModelCommand::AddArguments();
2781 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2783 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2785 chip::Controller::ColorControlCluster cluster;
2786 cluster.Associate(device, endpointId);
2787 return cluster.ReadAttributePrimary1Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2791 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2792 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2793 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2794 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2798 * Attribute Primary2X
2800 class ReadColorControlPrimary2X : public ModelCommand
2803 ReadColorControlPrimary2X() : ModelCommand("read")
2805 AddArgument("attr-name", "primary2x");
2806 ModelCommand::AddArguments();
2809 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2811 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2813 chip::Controller::ColorControlCluster cluster;
2814 cluster.Associate(device, endpointId);
2815 return cluster.ReadAttributePrimary2X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2819 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2820 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2821 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2822 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2826 * Attribute Primary2Y
2828 class ReadColorControlPrimary2Y : public ModelCommand
2831 ReadColorControlPrimary2Y() : ModelCommand("read")
2833 AddArgument("attr-name", "primary2y");
2834 ModelCommand::AddArguments();
2837 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2839 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2841 chip::Controller::ColorControlCluster cluster;
2842 cluster.Associate(device, endpointId);
2843 return cluster.ReadAttributePrimary2Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2847 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2848 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2849 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2850 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2854 * Attribute Primary2Intensity
2856 class ReadColorControlPrimary2Intensity : public ModelCommand
2859 ReadColorControlPrimary2Intensity() : ModelCommand("read")
2861 AddArgument("attr-name", "primary2intensity");
2862 ModelCommand::AddArguments();
2865 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2867 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2869 chip::Controller::ColorControlCluster cluster;
2870 cluster.Associate(device, endpointId);
2871 return cluster.ReadAttributePrimary2Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2875 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2876 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2877 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2878 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2882 * Attribute Primary3X
2884 class ReadColorControlPrimary3X : public ModelCommand
2887 ReadColorControlPrimary3X() : ModelCommand("read")
2889 AddArgument("attr-name", "primary3x");
2890 ModelCommand::AddArguments();
2893 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2895 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2897 chip::Controller::ColorControlCluster cluster;
2898 cluster.Associate(device, endpointId);
2899 return cluster.ReadAttributePrimary3X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2903 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2904 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2905 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2906 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2910 * Attribute Primary3Y
2912 class ReadColorControlPrimary3Y : public ModelCommand
2915 ReadColorControlPrimary3Y() : ModelCommand("read")
2917 AddArgument("attr-name", "primary3y");
2918 ModelCommand::AddArguments();
2921 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2923 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2925 chip::Controller::ColorControlCluster cluster;
2926 cluster.Associate(device, endpointId);
2927 return cluster.ReadAttributePrimary3Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2931 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2932 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2933 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2934 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2938 * Attribute Primary3Intensity
2940 class ReadColorControlPrimary3Intensity : public ModelCommand
2943 ReadColorControlPrimary3Intensity() : ModelCommand("read")
2945 AddArgument("attr-name", "primary3intensity");
2946 ModelCommand::AddArguments();
2949 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2951 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2953 chip::Controller::ColorControlCluster cluster;
2954 cluster.Associate(device, endpointId);
2955 return cluster.ReadAttributePrimary3Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2959 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2960 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2961 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2962 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2966 * Attribute Primary4X
2968 class ReadColorControlPrimary4X : public ModelCommand
2971 ReadColorControlPrimary4X() : ModelCommand("read")
2973 AddArgument("attr-name", "primary4x");
2974 ModelCommand::AddArguments();
2977 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2979 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2981 chip::Controller::ColorControlCluster cluster;
2982 cluster.Associate(device, endpointId);
2983 return cluster.ReadAttributePrimary4X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2987 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2988 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2989 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2990 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2994 * Attribute Primary4Y
2996 class ReadColorControlPrimary4Y : public ModelCommand
2999 ReadColorControlPrimary4Y() : ModelCommand("read")
3001 AddArgument("attr-name", "primary4y");
3002 ModelCommand::AddArguments();
3005 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3007 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3009 chip::Controller::ColorControlCluster cluster;
3010 cluster.Associate(device, endpointId);
3011 return cluster.ReadAttributePrimary4Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3015 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3016 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3017 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3018 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3022 * Attribute Primary4Intensity
3024 class ReadColorControlPrimary4Intensity : public ModelCommand
3027 ReadColorControlPrimary4Intensity() : ModelCommand("read")
3029 AddArgument("attr-name", "primary4intensity");
3030 ModelCommand::AddArguments();
3033 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3035 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3037 chip::Controller::ColorControlCluster cluster;
3038 cluster.Associate(device, endpointId);
3039 return cluster.ReadAttributePrimary4Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3043 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3044 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3045 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3046 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3050 * Attribute Primary5X
3052 class ReadColorControlPrimary5X : public ModelCommand
3055 ReadColorControlPrimary5X() : ModelCommand("read")
3057 AddArgument("attr-name", "primary5x");
3058 ModelCommand::AddArguments();
3061 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3063 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3065 chip::Controller::ColorControlCluster cluster;
3066 cluster.Associate(device, endpointId);
3067 return cluster.ReadAttributePrimary5X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3071 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3072 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3073 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3074 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3078 * Attribute Primary5Y
3080 class ReadColorControlPrimary5Y : public ModelCommand
3083 ReadColorControlPrimary5Y() : ModelCommand("read")
3085 AddArgument("attr-name", "primary5y");
3086 ModelCommand::AddArguments();
3089 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3091 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3093 chip::Controller::ColorControlCluster cluster;
3094 cluster.Associate(device, endpointId);
3095 return cluster.ReadAttributePrimary5Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3099 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3100 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3101 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3102 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3106 * Attribute Primary5Intensity
3108 class ReadColorControlPrimary5Intensity : public ModelCommand
3111 ReadColorControlPrimary5Intensity() : ModelCommand("read")
3113 AddArgument("attr-name", "primary5intensity");
3114 ModelCommand::AddArguments();
3117 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3119 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3121 chip::Controller::ColorControlCluster cluster;
3122 cluster.Associate(device, endpointId);
3123 return cluster.ReadAttributePrimary5Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3127 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3128 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3129 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3130 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3134 * Attribute Primary6X
3136 class ReadColorControlPrimary6X : public ModelCommand
3139 ReadColorControlPrimary6X() : ModelCommand("read")
3141 AddArgument("attr-name", "primary6x");
3142 ModelCommand::AddArguments();
3145 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3147 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3149 chip::Controller::ColorControlCluster cluster;
3150 cluster.Associate(device, endpointId);
3151 return cluster.ReadAttributePrimary6X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3155 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3156 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3157 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3158 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3162 * Attribute Primary6Y
3164 class ReadColorControlPrimary6Y : public ModelCommand
3167 ReadColorControlPrimary6Y() : ModelCommand("read")
3169 AddArgument("attr-name", "primary6y");
3170 ModelCommand::AddArguments();
3173 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3175 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3177 chip::Controller::ColorControlCluster cluster;
3178 cluster.Associate(device, endpointId);
3179 return cluster.ReadAttributePrimary6Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3183 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3184 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3185 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3186 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3190 * Attribute Primary6Intensity
3192 class ReadColorControlPrimary6Intensity : public ModelCommand
3195 ReadColorControlPrimary6Intensity() : ModelCommand("read")
3197 AddArgument("attr-name", "primary6intensity");
3198 ModelCommand::AddArguments();
3201 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3203 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3205 chip::Controller::ColorControlCluster cluster;
3206 cluster.Associate(device, endpointId);
3207 return cluster.ReadAttributePrimary6Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3211 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3212 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3213 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3214 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3218 * Attribute WhitePointX
3220 class ReadColorControlWhitePointX : public ModelCommand
3223 ReadColorControlWhitePointX() : ModelCommand("read")
3225 AddArgument("attr-name", "white-point-x");
3226 ModelCommand::AddArguments();
3229 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3231 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3233 chip::Controller::ColorControlCluster cluster;
3234 cluster.Associate(device, endpointId);
3235 return cluster.ReadAttributeWhitePointX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3239 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3240 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3241 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3242 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3245 class WriteColorControlWhitePointX : public ModelCommand
3248 WriteColorControlWhitePointX() : ModelCommand("write")
3250 AddArgument("attr-name", "white-point-x");
3251 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3252 ModelCommand::AddArguments();
3255 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3257 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3259 chip::Controller::ColorControlCluster cluster;
3260 cluster.Associate(device, endpointId);
3261 return cluster.WriteAttributeWhitePointX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3265 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3266 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3267 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3268 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3273 * Attribute WhitePointY
3275 class ReadColorControlWhitePointY : public ModelCommand
3278 ReadColorControlWhitePointY() : ModelCommand("read")
3280 AddArgument("attr-name", "white-point-y");
3281 ModelCommand::AddArguments();
3284 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3286 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3288 chip::Controller::ColorControlCluster cluster;
3289 cluster.Associate(device, endpointId);
3290 return cluster.ReadAttributeWhitePointY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3294 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3295 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3296 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3297 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3300 class WriteColorControlWhitePointY : public ModelCommand
3303 WriteColorControlWhitePointY() : ModelCommand("write")
3305 AddArgument("attr-name", "white-point-y");
3306 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3307 ModelCommand::AddArguments();
3310 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3312 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3314 chip::Controller::ColorControlCluster cluster;
3315 cluster.Associate(device, endpointId);
3316 return cluster.WriteAttributeWhitePointY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3320 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3321 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3322 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3323 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3328 * Attribute ColorPointRX
3330 class ReadColorControlColorPointRX : public ModelCommand
3333 ReadColorControlColorPointRX() : ModelCommand("read")
3335 AddArgument("attr-name", "color-point-rx");
3336 ModelCommand::AddArguments();
3339 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3341 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3343 chip::Controller::ColorControlCluster cluster;
3344 cluster.Associate(device, endpointId);
3345 return cluster.ReadAttributeColorPointRX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3349 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3350 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3351 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3352 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3355 class WriteColorControlColorPointRX : public ModelCommand
3358 WriteColorControlColorPointRX() : ModelCommand("write")
3360 AddArgument("attr-name", "color-point-rx");
3361 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3362 ModelCommand::AddArguments();
3365 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3367 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3369 chip::Controller::ColorControlCluster cluster;
3370 cluster.Associate(device, endpointId);
3371 return cluster.WriteAttributeColorPointRX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3375 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3376 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3377 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3378 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3383 * Attribute ColorPointRY
3385 class ReadColorControlColorPointRY : public ModelCommand
3388 ReadColorControlColorPointRY() : ModelCommand("read")
3390 AddArgument("attr-name", "color-point-ry");
3391 ModelCommand::AddArguments();
3394 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3396 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3398 chip::Controller::ColorControlCluster cluster;
3399 cluster.Associate(device, endpointId);
3400 return cluster.ReadAttributeColorPointRY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3404 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3405 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3406 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3407 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3410 class WriteColorControlColorPointRY : public ModelCommand
3413 WriteColorControlColorPointRY() : ModelCommand("write")
3415 AddArgument("attr-name", "color-point-ry");
3416 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3417 ModelCommand::AddArguments();
3420 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3422 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3424 chip::Controller::ColorControlCluster cluster;
3425 cluster.Associate(device, endpointId);
3426 return cluster.WriteAttributeColorPointRY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3430 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3431 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3432 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3433 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3438 * Attribute ColorPointRIntensity
3440 class ReadColorControlColorPointRIntensity : public ModelCommand
3443 ReadColorControlColorPointRIntensity() : ModelCommand("read")
3445 AddArgument("attr-name", "color-point-rintensity");
3446 ModelCommand::AddArguments();
3449 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3451 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3453 chip::Controller::ColorControlCluster cluster;
3454 cluster.Associate(device, endpointId);
3455 return cluster.ReadAttributeColorPointRIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3459 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3460 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3461 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3462 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3465 class WriteColorControlColorPointRIntensity : public ModelCommand
3468 WriteColorControlColorPointRIntensity() : ModelCommand("write")
3470 AddArgument("attr-name", "color-point-rintensity");
3471 AddArgument("attr-value", 0, UINT8_MAX, &mValue);
3472 ModelCommand::AddArguments();
3475 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3477 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3479 chip::Controller::ColorControlCluster cluster;
3480 cluster.Associate(device, endpointId);
3481 return cluster.WriteAttributeColorPointRIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3485 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3486 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3487 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3488 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3493 * Attribute ColorPointGX
3495 class ReadColorControlColorPointGX : public ModelCommand
3498 ReadColorControlColorPointGX() : ModelCommand("read")
3500 AddArgument("attr-name", "color-point-gx");
3501 ModelCommand::AddArguments();
3504 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3506 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3508 chip::Controller::ColorControlCluster cluster;
3509 cluster.Associate(device, endpointId);
3510 return cluster.ReadAttributeColorPointGX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3514 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3515 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3516 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3517 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3520 class WriteColorControlColorPointGX : public ModelCommand
3523 WriteColorControlColorPointGX() : ModelCommand("write")
3525 AddArgument("attr-name", "color-point-gx");
3526 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3527 ModelCommand::AddArguments();
3530 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3532 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3534 chip::Controller::ColorControlCluster cluster;
3535 cluster.Associate(device, endpointId);
3536 return cluster.WriteAttributeColorPointGX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3540 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3541 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3542 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3543 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3548 * Attribute ColorPointGY
3550 class ReadColorControlColorPointGY : public ModelCommand
3553 ReadColorControlColorPointGY() : ModelCommand("read")
3555 AddArgument("attr-name", "color-point-gy");
3556 ModelCommand::AddArguments();
3559 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3561 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3563 chip::Controller::ColorControlCluster cluster;
3564 cluster.Associate(device, endpointId);
3565 return cluster.ReadAttributeColorPointGY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3569 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3570 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3571 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3572 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3575 class WriteColorControlColorPointGY : public ModelCommand
3578 WriteColorControlColorPointGY() : ModelCommand("write")
3580 AddArgument("attr-name", "color-point-gy");
3581 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3582 ModelCommand::AddArguments();
3585 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3587 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3589 chip::Controller::ColorControlCluster cluster;
3590 cluster.Associate(device, endpointId);
3591 return cluster.WriteAttributeColorPointGY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3595 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3596 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3597 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3598 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3603 * Attribute ColorPointGIntensity
3605 class ReadColorControlColorPointGIntensity : public ModelCommand
3608 ReadColorControlColorPointGIntensity() : ModelCommand("read")
3610 AddArgument("attr-name", "color-point-gintensity");
3611 ModelCommand::AddArguments();
3614 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3616 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3618 chip::Controller::ColorControlCluster cluster;
3619 cluster.Associate(device, endpointId);
3620 return cluster.ReadAttributeColorPointGIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3624 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3625 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3626 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3627 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3630 class WriteColorControlColorPointGIntensity : public ModelCommand
3633 WriteColorControlColorPointGIntensity() : ModelCommand("write")
3635 AddArgument("attr-name", "color-point-gintensity");
3636 AddArgument("attr-value", 0, UINT8_MAX, &mValue);
3637 ModelCommand::AddArguments();
3640 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3642 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3644 chip::Controller::ColorControlCluster cluster;
3645 cluster.Associate(device, endpointId);
3646 return cluster.WriteAttributeColorPointGIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3650 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3651 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3652 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3653 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3658 * Attribute ColorPointBX
3660 class ReadColorControlColorPointBX : public ModelCommand
3663 ReadColorControlColorPointBX() : ModelCommand("read")
3665 AddArgument("attr-name", "color-point-bx");
3666 ModelCommand::AddArguments();
3669 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3671 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3673 chip::Controller::ColorControlCluster cluster;
3674 cluster.Associate(device, endpointId);
3675 return cluster.ReadAttributeColorPointBX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3679 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3680 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3681 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3682 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3685 class WriteColorControlColorPointBX : public ModelCommand
3688 WriteColorControlColorPointBX() : ModelCommand("write")
3690 AddArgument("attr-name", "color-point-bx");
3691 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3692 ModelCommand::AddArguments();
3695 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3697 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3699 chip::Controller::ColorControlCluster cluster;
3700 cluster.Associate(device, endpointId);
3701 return cluster.WriteAttributeColorPointBX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3705 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3706 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3707 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3708 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3713 * Attribute ColorPointBY
3715 class ReadColorControlColorPointBY : public ModelCommand
3718 ReadColorControlColorPointBY() : ModelCommand("read")
3720 AddArgument("attr-name", "color-point-by");
3721 ModelCommand::AddArguments();
3724 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3726 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3728 chip::Controller::ColorControlCluster cluster;
3729 cluster.Associate(device, endpointId);
3730 return cluster.ReadAttributeColorPointBY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3734 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3735 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3736 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3737 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3740 class WriteColorControlColorPointBY : public ModelCommand
3743 WriteColorControlColorPointBY() : ModelCommand("write")
3745 AddArgument("attr-name", "color-point-by");
3746 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3747 ModelCommand::AddArguments();
3750 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3752 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3754 chip::Controller::ColorControlCluster cluster;
3755 cluster.Associate(device, endpointId);
3756 return cluster.WriteAttributeColorPointBY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3760 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3761 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3762 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3763 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3768 * Attribute ColorPointBIntensity
3770 class ReadColorControlColorPointBIntensity : public ModelCommand
3773 ReadColorControlColorPointBIntensity() : ModelCommand("read")
3775 AddArgument("attr-name", "color-point-bintensity");
3776 ModelCommand::AddArguments();
3779 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3781 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3783 chip::Controller::ColorControlCluster cluster;
3784 cluster.Associate(device, endpointId);
3785 return cluster.ReadAttributeColorPointBIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3789 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3790 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3791 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3792 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3795 class WriteColorControlColorPointBIntensity : public ModelCommand
3798 WriteColorControlColorPointBIntensity() : ModelCommand("write")
3800 AddArgument("attr-name", "color-point-bintensity");
3801 AddArgument("attr-value", 0, UINT8_MAX, &mValue);
3802 ModelCommand::AddArguments();
3805 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3807 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3809 chip::Controller::ColorControlCluster cluster;
3810 cluster.Associate(device, endpointId);
3811 return cluster.WriteAttributeColorPointBIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3815 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3816 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3817 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3818 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3823 * Attribute EnhancedCurrentHue
3825 class ReadColorControlEnhancedCurrentHue : public ModelCommand
3828 ReadColorControlEnhancedCurrentHue() : ModelCommand("read")
3830 AddArgument("attr-name", "enhanced-current-hue");
3831 ModelCommand::AddArguments();
3834 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3836 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3838 chip::Controller::ColorControlCluster cluster;
3839 cluster.Associate(device, endpointId);
3840 return cluster.ReadAttributeEnhancedCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3844 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3845 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3846 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3847 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3851 * Attribute EnhancedColorMode
3853 class ReadColorControlEnhancedColorMode : public ModelCommand
3856 ReadColorControlEnhancedColorMode() : ModelCommand("read")
3858 AddArgument("attr-name", "enhanced-color-mode");
3859 ModelCommand::AddArguments();
3862 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3864 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3866 chip::Controller::ColorControlCluster cluster;
3867 cluster.Associate(device, endpointId);
3868 return cluster.ReadAttributeEnhancedColorMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3872 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3873 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3874 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3875 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3879 * Attribute ColorLoopActive
3881 class ReadColorControlColorLoopActive : public ModelCommand
3884 ReadColorControlColorLoopActive() : ModelCommand("read")
3886 AddArgument("attr-name", "color-loop-active");
3887 ModelCommand::AddArguments();
3890 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3892 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3894 chip::Controller::ColorControlCluster cluster;
3895 cluster.Associate(device, endpointId);
3896 return cluster.ReadAttributeColorLoopActive(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3900 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3901 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3902 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3903 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3907 * Attribute ColorLoopDirection
3909 class ReadColorControlColorLoopDirection : public ModelCommand
3912 ReadColorControlColorLoopDirection() : ModelCommand("read")
3914 AddArgument("attr-name", "color-loop-direction");
3915 ModelCommand::AddArguments();
3918 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3920 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3922 chip::Controller::ColorControlCluster cluster;
3923 cluster.Associate(device, endpointId);
3924 return cluster.ReadAttributeColorLoopDirection(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3928 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3929 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3930 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3931 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3935 * Attribute ColorLoopTime
3937 class ReadColorControlColorLoopTime : public ModelCommand
3940 ReadColorControlColorLoopTime() : ModelCommand("read")
3942 AddArgument("attr-name", "color-loop-time");
3943 ModelCommand::AddArguments();
3946 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3948 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3950 chip::Controller::ColorControlCluster cluster;
3951 cluster.Associate(device, endpointId);
3952 return cluster.ReadAttributeColorLoopTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3956 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3957 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3958 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3959 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3963 * Attribute ColorCapabilities
3965 class ReadColorControlColorCapabilities : public ModelCommand
3968 ReadColorControlColorCapabilities() : ModelCommand("read")
3970 AddArgument("attr-name", "color-capabilities");
3971 ModelCommand::AddArguments();
3974 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3976 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3978 chip::Controller::ColorControlCluster cluster;
3979 cluster.Associate(device, endpointId);
3980 return cluster.ReadAttributeColorCapabilities(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3984 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3985 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3986 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3987 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3991 * Attribute ColorTempPhysicalMin
3993 class ReadColorControlColorTempPhysicalMin : public ModelCommand
3996 ReadColorControlColorTempPhysicalMin() : ModelCommand("read")
3998 AddArgument("attr-name", "color-temp-physical-min");
3999 ModelCommand::AddArguments();
4002 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4004 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4006 chip::Controller::ColorControlCluster cluster;
4007 cluster.Associate(device, endpointId);
4008 return cluster.ReadAttributeColorTempPhysicalMin(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4012 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4013 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4014 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4015 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4019 * Attribute ColorTempPhysicalMax
4021 class ReadColorControlColorTempPhysicalMax : public ModelCommand
4024 ReadColorControlColorTempPhysicalMax() : ModelCommand("read")
4026 AddArgument("attr-name", "color-temp-physical-max");
4027 ModelCommand::AddArguments();
4030 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4032 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4034 chip::Controller::ColorControlCluster cluster;
4035 cluster.Associate(device, endpointId);
4036 return cluster.ReadAttributeColorTempPhysicalMax(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4040 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4041 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4042 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4043 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4047 * Attribute CoupleColorTempToLevelMinMireds
4049 class ReadColorControlCoupleColorTempToLevelMinMireds : public ModelCommand
4052 ReadColorControlCoupleColorTempToLevelMinMireds() : ModelCommand("read")
4054 AddArgument("attr-name", "couple-color-temp-to-level-min-mireds");
4055 ModelCommand::AddArguments();
4058 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4060 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4062 chip::Controller::ColorControlCluster cluster;
4063 cluster.Associate(device, endpointId);
4064 return cluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4068 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4069 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4070 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4071 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4075 * Attribute StartUpColorTemperatureMireds
4077 class ReadColorControlStartUpColorTemperatureMireds : public ModelCommand
4080 ReadColorControlStartUpColorTemperatureMireds() : ModelCommand("read")
4082 AddArgument("attr-name", "start-up-color-temperature-mireds");
4083 ModelCommand::AddArguments();
4086 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4088 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4090 chip::Controller::ColorControlCluster cluster;
4091 cluster.Associate(device, endpointId);
4092 return cluster.ReadAttributeStartUpColorTemperatureMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4096 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4097 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4098 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4099 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4102 class WriteColorControlStartUpColorTemperatureMireds : public ModelCommand
4105 WriteColorControlStartUpColorTemperatureMireds() : ModelCommand("write")
4107 AddArgument("attr-name", "start-up-color-temperature-mireds");
4108 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
4109 ModelCommand::AddArguments();
4112 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4114 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
4116 chip::Controller::ColorControlCluster cluster;
4117 cluster.Associate(device, endpointId);
4118 return cluster.WriteAttributeStartUpColorTemperatureMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
4123 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
4124 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
4125 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4126 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4131 * Attribute ClusterRevision
4133 class ReadColorControlClusterRevision : public ModelCommand
4136 ReadColorControlClusterRevision() : ModelCommand("read")
4138 AddArgument("attr-name", "cluster-revision");
4139 ModelCommand::AddArguments();
4142 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4144 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4146 chip::Controller::ColorControlCluster cluster;
4147 cluster.Associate(device, endpointId);
4148 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4152 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4153 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4154 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4155 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4158 /*----------------------------------------------------------------------------*\
4159 | Cluster ContentLaunch | 0xF002 |
4160 |------------------------------------------------------------------------------|
4162 | * LaunchContent | 0x00 |
4163 | * LaunchURL | 0x01 |
4164 |------------------------------------------------------------------------------|
4166 | * ClusterRevision | 0xFFFD |
4167 \*----------------------------------------------------------------------------*/
4170 * Command LaunchContent
4172 class ContentLaunchLaunchContent : public ModelCommand
4175 ContentLaunchLaunchContent() : ModelCommand("launch-content") { ModelCommand::AddArguments(); }
4177 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4179 ChipLogProgress(chipTool, "Sending cluster (0xF002) command (0x00) on endpoint %" PRIu16, endpointId);
4181 chip::Controller::ContentLaunchCluster cluster;
4182 cluster.Associate(device, endpointId);
4183 return cluster.LaunchContent(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4187 chip::Callback::Callback<ContentLaunchClusterLaunchContentResponseCallback> * onSuccessCallback =
4188 new chip::Callback::Callback<ContentLaunchClusterLaunchContentResponseCallback>(OnContentLaunchClusterLaunchContentResponse,
4190 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4191 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4197 class ContentLaunchLaunchURL : public ModelCommand
4200 ContentLaunchLaunchURL() : ModelCommand("launch-url") { ModelCommand::AddArguments(); }
4202 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4204 ChipLogProgress(chipTool, "Sending cluster (0xF002) command (0x01) on endpoint %" PRIu16, endpointId);
4206 chip::Controller::ContentLaunchCluster cluster;
4207 cluster.Associate(device, endpointId);
4208 return cluster.LaunchURL(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4212 chip::Callback::Callback<ContentLaunchClusterLaunchURLResponseCallback> * onSuccessCallback =
4213 new chip::Callback::Callback<ContentLaunchClusterLaunchURLResponseCallback>(OnContentLaunchClusterLaunchURLResponse, this);
4214 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4215 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4219 * Discover Attributes
4221 class DiscoverContentLaunchAttributes : public ModelCommand
4224 DiscoverContentLaunchAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
4226 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4228 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
4230 chip::Controller::ContentLaunchCluster cluster;
4231 cluster.Associate(device, endpointId);
4232 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4236 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
4237 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
4238 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4239 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4243 * Attribute ClusterRevision
4245 class ReadContentLaunchClusterRevision : public ModelCommand
4248 ReadContentLaunchClusterRevision() : ModelCommand("read")
4250 AddArgument("attr-name", "cluster-revision");
4251 ModelCommand::AddArguments();
4254 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4256 ChipLogProgress(chipTool, "Sending cluster (0xF002) command (0x00) on endpoint %" PRIu16, endpointId);
4258 chip::Controller::ContentLaunchCluster cluster;
4259 cluster.Associate(device, endpointId);
4260 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4264 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4265 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4266 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4267 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4270 /*----------------------------------------------------------------------------*\
4271 | Cluster DoorLock | 0x0101 |
4272 |------------------------------------------------------------------------------|
4274 | * ClearAllPins | 0x08 |
4275 | * ClearAllRfids | 0x19 |
4276 | * ClearHolidaySchedule | 0x13 |
4277 | * ClearPin | 0x07 |
4278 | * ClearRfid | 0x18 |
4279 | * ClearWeekdaySchedule | 0x0D |
4280 | * ClearYeardaySchedule | 0x10 |
4281 | * GetHolidaySchedule | 0x12 |
4282 | * GetLogRecord | 0x04 |
4284 | * GetRfid | 0x17 |
4285 | * GetUserType | 0x15 |
4286 | * GetWeekdaySchedule | 0x0C |
4287 | * GetYeardaySchedule | 0x0F |
4288 | * LockDoor | 0x00 |
4289 | * SetHolidaySchedule | 0x11 |
4291 | * SetRfid | 0x16 |
4292 | * SetUserType | 0x14 |
4293 | * SetWeekdaySchedule | 0x0B |
4294 | * SetYeardaySchedule | 0x0E |
4295 | * UnlockDoor | 0x01 |
4296 | * UnlockWithTimeout | 0x03 |
4297 |------------------------------------------------------------------------------|
4299 | * LockState | 0x0000 |
4300 | * LockType | 0x0001 |
4301 | * ActuatorEnabled | 0x0002 |
4302 | * ClusterRevision | 0xFFFD |
4303 \*----------------------------------------------------------------------------*/
4306 * Command ClearAllPins
4308 class DoorLockClearAllPins : public ModelCommand
4311 DoorLockClearAllPins() : ModelCommand("clear-all-pins") { ModelCommand::AddArguments(); }
4313 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4315 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x08) on endpoint %" PRIu16, endpointId);
4317 chip::Controller::DoorLockCluster cluster;
4318 cluster.Associate(device, endpointId);
4319 return cluster.ClearAllPins(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4323 chip::Callback::Callback<DoorLockClusterClearAllPinsResponseCallback> * onSuccessCallback =
4324 new chip::Callback::Callback<DoorLockClusterClearAllPinsResponseCallback>(OnDoorLockClusterClearAllPinsResponse, this);
4325 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4326 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4330 * Command ClearAllRfids
4332 class DoorLockClearAllRfids : public ModelCommand
4335 DoorLockClearAllRfids() : ModelCommand("clear-all-rfids") { ModelCommand::AddArguments(); }
4337 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4339 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x19) on endpoint %" PRIu16, endpointId);
4341 chip::Controller::DoorLockCluster cluster;
4342 cluster.Associate(device, endpointId);
4343 return cluster.ClearAllRfids(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4347 chip::Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback> * onSuccessCallback =
4348 new chip::Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback>(OnDoorLockClusterClearAllRfidsResponse, this);
4349 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4350 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4354 * Command ClearHolidaySchedule
4356 class DoorLockClearHolidaySchedule : public ModelCommand
4359 DoorLockClearHolidaySchedule() : ModelCommand("clear-holiday-schedule")
4361 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
4362 ModelCommand::AddArguments();
4365 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4367 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x13) on endpoint %" PRIu16, endpointId);
4369 chip::Controller::DoorLockCluster cluster;
4370 cluster.Associate(device, endpointId);
4371 return cluster.ClearHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId);
4375 chip::Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback> * onSuccessCallback =
4376 new chip::Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback>(
4377 OnDoorLockClusterClearHolidayScheduleResponse, this);
4378 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4379 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4380 uint8_t mScheduleId;
4386 class DoorLockClearPin : public ModelCommand
4389 DoorLockClearPin() : ModelCommand("clear-pin")
4391 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4392 ModelCommand::AddArguments();
4395 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4397 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x07) on endpoint %" PRIu16, endpointId);
4399 chip::Controller::DoorLockCluster cluster;
4400 cluster.Associate(device, endpointId);
4401 return cluster.ClearPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
4405 chip::Callback::Callback<DoorLockClusterClearPinResponseCallback> * onSuccessCallback =
4406 new chip::Callback::Callback<DoorLockClusterClearPinResponseCallback>(OnDoorLockClusterClearPinResponse, this);
4407 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4408 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4415 class DoorLockClearRfid : public ModelCommand
4418 DoorLockClearRfid() : ModelCommand("clear-rfid")
4420 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4421 ModelCommand::AddArguments();
4424 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4426 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x18) on endpoint %" PRIu16, endpointId);
4428 chip::Controller::DoorLockCluster cluster;
4429 cluster.Associate(device, endpointId);
4430 return cluster.ClearRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
4434 chip::Callback::Callback<DoorLockClusterClearRfidResponseCallback> * onSuccessCallback =
4435 new chip::Callback::Callback<DoorLockClusterClearRfidResponseCallback>(OnDoorLockClusterClearRfidResponse, this);
4436 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4437 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4442 * Command ClearWeekdaySchedule
4444 class DoorLockClearWeekdaySchedule : public ModelCommand
4447 DoorLockClearWeekdaySchedule() : ModelCommand("clear-weekday-schedule")
4449 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
4450 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4451 ModelCommand::AddArguments();
4454 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4456 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0D) on endpoint %" PRIu16, endpointId);
4458 chip::Controller::DoorLockCluster cluster;
4459 cluster.Associate(device, endpointId);
4460 return cluster.ClearWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
4464 chip::Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback> * onSuccessCallback =
4465 new chip::Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback>(
4466 OnDoorLockClusterClearWeekdayScheduleResponse, this);
4467 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4468 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4469 uint8_t mScheduleId;
4474 * Command ClearYeardaySchedule
4476 class DoorLockClearYeardaySchedule : public ModelCommand
4479 DoorLockClearYeardaySchedule() : ModelCommand("clear-yearday-schedule")
4481 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
4482 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4483 ModelCommand::AddArguments();
4486 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4488 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x10) on endpoint %" PRIu16, endpointId);
4490 chip::Controller::DoorLockCluster cluster;
4491 cluster.Associate(device, endpointId);
4492 return cluster.ClearYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
4496 chip::Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback> * onSuccessCallback =
4497 new chip::Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback>(
4498 OnDoorLockClusterClearYeardayScheduleResponse, this);
4499 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4500 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4501 uint8_t mScheduleId;
4506 * Command GetHolidaySchedule
4508 class DoorLockGetHolidaySchedule : public ModelCommand
4511 DoorLockGetHolidaySchedule() : ModelCommand("get-holiday-schedule")
4513 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
4514 ModelCommand::AddArguments();
4517 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4519 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x12) on endpoint %" PRIu16, endpointId);
4521 chip::Controller::DoorLockCluster cluster;
4522 cluster.Associate(device, endpointId);
4523 return cluster.GetHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId);
4527 chip::Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback> * onSuccessCallback =
4528 new chip::Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback>(OnDoorLockClusterGetHolidayScheduleResponse,
4530 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4531 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4532 uint8_t mScheduleId;
4536 * Command GetLogRecord
4538 class DoorLockGetLogRecord : public ModelCommand
4541 DoorLockGetLogRecord() : ModelCommand("get-log-record")
4543 AddArgument("logIndex", 0, UINT16_MAX, &mLogIndex);
4544 ModelCommand::AddArguments();
4547 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4549 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x04) on endpoint %" PRIu16, endpointId);
4551 chip::Controller::DoorLockCluster cluster;
4552 cluster.Associate(device, endpointId);
4553 return cluster.GetLogRecord(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLogIndex);
4557 chip::Callback::Callback<DoorLockClusterGetLogRecordResponseCallback> * onSuccessCallback =
4558 new chip::Callback::Callback<DoorLockClusterGetLogRecordResponseCallback>(OnDoorLockClusterGetLogRecordResponse, this);
4559 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4560 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4567 class DoorLockGetPin : public ModelCommand
4570 DoorLockGetPin() : ModelCommand("get-pin")
4572 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4573 ModelCommand::AddArguments();
4576 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4578 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x06) on endpoint %" PRIu16, endpointId);
4580 chip::Controller::DoorLockCluster cluster;
4581 cluster.Associate(device, endpointId);
4582 return cluster.GetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
4586 chip::Callback::Callback<DoorLockClusterGetPinResponseCallback> * onSuccessCallback =
4587 new chip::Callback::Callback<DoorLockClusterGetPinResponseCallback>(OnDoorLockClusterGetPinResponse, this);
4588 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4589 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4596 class DoorLockGetRfid : public ModelCommand
4599 DoorLockGetRfid() : ModelCommand("get-rfid")
4601 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4602 ModelCommand::AddArguments();
4605 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4607 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x17) on endpoint %" PRIu16, endpointId);
4609 chip::Controller::DoorLockCluster cluster;
4610 cluster.Associate(device, endpointId);
4611 return cluster.GetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
4615 chip::Callback::Callback<DoorLockClusterGetRfidResponseCallback> * onSuccessCallback =
4616 new chip::Callback::Callback<DoorLockClusterGetRfidResponseCallback>(OnDoorLockClusterGetRfidResponse, this);
4617 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4618 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4623 * Command GetUserType
4625 class DoorLockGetUserType : public ModelCommand
4628 DoorLockGetUserType() : ModelCommand("get-user-type")
4630 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4631 ModelCommand::AddArguments();
4634 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4636 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x15) on endpoint %" PRIu16, endpointId);
4638 chip::Controller::DoorLockCluster cluster;
4639 cluster.Associate(device, endpointId);
4640 return cluster.GetUserType(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
4644 chip::Callback::Callback<DoorLockClusterGetUserTypeResponseCallback> * onSuccessCallback =
4645 new chip::Callback::Callback<DoorLockClusterGetUserTypeResponseCallback>(OnDoorLockClusterGetUserTypeResponse, this);
4646 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4647 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4652 * Command GetWeekdaySchedule
4654 class DoorLockGetWeekdaySchedule : public ModelCommand
4657 DoorLockGetWeekdaySchedule() : ModelCommand("get-weekday-schedule")
4659 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
4660 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4661 ModelCommand::AddArguments();
4664 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4666 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0C) on endpoint %" PRIu16, endpointId);
4668 chip::Controller::DoorLockCluster cluster;
4669 cluster.Associate(device, endpointId);
4670 return cluster.GetWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
4674 chip::Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback> * onSuccessCallback =
4675 new chip::Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback>(OnDoorLockClusterGetWeekdayScheduleResponse,
4677 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4678 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4679 uint8_t mScheduleId;
4684 * Command GetYeardaySchedule
4686 class DoorLockGetYeardaySchedule : public ModelCommand
4689 DoorLockGetYeardaySchedule() : ModelCommand("get-yearday-schedule")
4691 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
4692 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4693 ModelCommand::AddArguments();
4696 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4698 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0F) on endpoint %" PRIu16, endpointId);
4700 chip::Controller::DoorLockCluster cluster;
4701 cluster.Associate(device, endpointId);
4702 return cluster.GetYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
4706 chip::Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback> * onSuccessCallback =
4707 new chip::Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback>(OnDoorLockClusterGetYeardayScheduleResponse,
4709 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4710 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4711 uint8_t mScheduleId;
4718 class DoorLockLockDoor : public ModelCommand
4721 DoorLockLockDoor() : ModelCommand("lock-door")
4723 AddArgument("pin", &mPin);
4724 ModelCommand::AddArguments();
4727 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4729 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);
4731 chip::Controller::DoorLockCluster cluster;
4732 cluster.Associate(device, endpointId);
4733 return cluster.LockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
4734 chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
4738 chip::Callback::Callback<DoorLockClusterLockDoorResponseCallback> * onSuccessCallback =
4739 new chip::Callback::Callback<DoorLockClusterLockDoorResponseCallback>(OnDoorLockClusterLockDoorResponse, this);
4740 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4741 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4746 * Command SetHolidaySchedule
4748 class DoorLockSetHolidaySchedule : public ModelCommand
4751 DoorLockSetHolidaySchedule() : ModelCommand("set-holiday-schedule")
4753 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
4754 AddArgument("localStartTime", 0, UINT32_MAX, &mLocalStartTime);
4755 AddArgument("localEndTime", 0, UINT32_MAX, &mLocalEndTime);
4756 AddArgument("operatingModeDuringHoliday", 0, UINT8_MAX, &mOperatingModeDuringHoliday);
4757 ModelCommand::AddArguments();
4760 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4762 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x11) on endpoint %" PRIu16, endpointId);
4764 chip::Controller::DoorLockCluster cluster;
4765 cluster.Associate(device, endpointId);
4766 return cluster.SetHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mLocalStartTime,
4767 mLocalEndTime, mOperatingModeDuringHoliday);
4771 chip::Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback> * onSuccessCallback =
4772 new chip::Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback>(OnDoorLockClusterSetHolidayScheduleResponse,
4774 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4775 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4776 uint8_t mScheduleId;
4777 uint32_t mLocalStartTime;
4778 uint32_t mLocalEndTime;
4779 uint8_t mOperatingModeDuringHoliday;
4785 class DoorLockSetPin : public ModelCommand
4788 DoorLockSetPin() : ModelCommand("set-pin")
4790 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4791 AddArgument("userStatus", 0, UINT8_MAX, &mUserStatus);
4792 AddArgument("userType", 0, UINT8_MAX, &mUserType);
4793 AddArgument("pin", &mPin);
4794 ModelCommand::AddArguments();
4797 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4799 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x05) on endpoint %" PRIu16, endpointId);
4801 chip::Controller::DoorLockCluster cluster;
4802 cluster.Associate(device, endpointId);
4803 return cluster.SetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
4804 chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
4808 chip::Callback::Callback<DoorLockClusterSetPinResponseCallback> * onSuccessCallback =
4809 new chip::Callback::Callback<DoorLockClusterSetPinResponseCallback>(OnDoorLockClusterSetPinResponse, this);
4810 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4811 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4813 uint8_t mUserStatus;
4821 class DoorLockSetRfid : public ModelCommand
4824 DoorLockSetRfid() : ModelCommand("set-rfid")
4826 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4827 AddArgument("userStatus", 0, UINT8_MAX, &mUserStatus);
4828 AddArgument("userType", 0, UINT8_MAX, &mUserType);
4829 AddArgument("id", &mId);
4830 ModelCommand::AddArguments();
4833 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4835 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x16) on endpoint %" PRIu16, endpointId);
4837 chip::Controller::DoorLockCluster cluster;
4838 cluster.Associate(device, endpointId);
4839 return cluster.SetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
4840 chip::ByteSpan(chip::Uint8::from_char(mId), strlen(mId)));
4844 chip::Callback::Callback<DoorLockClusterSetRfidResponseCallback> * onSuccessCallback =
4845 new chip::Callback::Callback<DoorLockClusterSetRfidResponseCallback>(OnDoorLockClusterSetRfidResponse, this);
4846 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4847 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4849 uint8_t mUserStatus;
4855 * Command SetUserType
4857 class DoorLockSetUserType : public ModelCommand
4860 DoorLockSetUserType() : ModelCommand("set-user-type")
4862 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4863 AddArgument("userType", 0, UINT8_MAX, &mUserType);
4864 ModelCommand::AddArguments();
4867 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4869 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x14) on endpoint %" PRIu16, endpointId);
4871 chip::Controller::DoorLockCluster cluster;
4872 cluster.Associate(device, endpointId);
4873 return cluster.SetUserType(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserType);
4877 chip::Callback::Callback<DoorLockClusterSetUserTypeResponseCallback> * onSuccessCallback =
4878 new chip::Callback::Callback<DoorLockClusterSetUserTypeResponseCallback>(OnDoorLockClusterSetUserTypeResponse, this);
4879 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4880 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4886 * Command SetWeekdaySchedule
4888 class DoorLockSetWeekdaySchedule : public ModelCommand
4891 DoorLockSetWeekdaySchedule() : ModelCommand("set-weekday-schedule")
4893 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
4894 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4895 AddArgument("daysMask", 0, UINT8_MAX, &mDaysMask);
4896 AddArgument("startHour", 0, UINT8_MAX, &mStartHour);
4897 AddArgument("startMinute", 0, UINT8_MAX, &mStartMinute);
4898 AddArgument("endHour", 0, UINT8_MAX, &mEndHour);
4899 AddArgument("endMinute", 0, UINT8_MAX, &mEndMinute);
4900 ModelCommand::AddArguments();
4903 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4905 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0B) on endpoint %" PRIu16, endpointId);
4907 chip::Controller::DoorLockCluster cluster;
4908 cluster.Associate(device, endpointId);
4909 return cluster.SetWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId, mDaysMask,
4910 mStartHour, mStartMinute, mEndHour, mEndMinute);
4914 chip::Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback> * onSuccessCallback =
4915 new chip::Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback>(OnDoorLockClusterSetWeekdayScheduleResponse,
4917 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4918 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4919 uint8_t mScheduleId;
4923 uint8_t mStartMinute;
4929 * Command SetYeardaySchedule
4931 class DoorLockSetYeardaySchedule : public ModelCommand
4934 DoorLockSetYeardaySchedule() : ModelCommand("set-yearday-schedule")
4936 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
4937 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4938 AddArgument("localStartTime", 0, UINT32_MAX, &mLocalStartTime);
4939 AddArgument("localEndTime", 0, UINT32_MAX, &mLocalEndTime);
4940 ModelCommand::AddArguments();
4943 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4945 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0E) on endpoint %" PRIu16, endpointId);
4947 chip::Controller::DoorLockCluster cluster;
4948 cluster.Associate(device, endpointId);
4949 return cluster.SetYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId,
4950 mLocalStartTime, mLocalEndTime);
4954 chip::Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback> * onSuccessCallback =
4955 new chip::Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback>(OnDoorLockClusterSetYeardayScheduleResponse,
4957 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4958 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4959 uint8_t mScheduleId;
4961 uint32_t mLocalStartTime;
4962 uint32_t mLocalEndTime;
4966 * Command UnlockDoor
4968 class DoorLockUnlockDoor : public ModelCommand
4971 DoorLockUnlockDoor() : ModelCommand("unlock-door")
4973 AddArgument("pin", &mPin);
4974 ModelCommand::AddArguments();
4977 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4979 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x01) on endpoint %" PRIu16, endpointId);
4981 chip::Controller::DoorLockCluster cluster;
4982 cluster.Associate(device, endpointId);
4983 return cluster.UnlockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
4984 chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
4988 chip::Callback::Callback<DoorLockClusterUnlockDoorResponseCallback> * onSuccessCallback =
4989 new chip::Callback::Callback<DoorLockClusterUnlockDoorResponseCallback>(OnDoorLockClusterUnlockDoorResponse, this);
4990 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4991 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4996 * Command UnlockWithTimeout
4998 class DoorLockUnlockWithTimeout : public ModelCommand
5001 DoorLockUnlockWithTimeout() : ModelCommand("unlock-with-timeout")
5003 AddArgument("timeoutInSeconds", 0, UINT16_MAX, &mTimeoutInSeconds);
5004 AddArgument("pin", &mPin);
5005 ModelCommand::AddArguments();
5008 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5010 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x03) on endpoint %" PRIu16, endpointId);
5012 chip::Controller::DoorLockCluster cluster;
5013 cluster.Associate(device, endpointId);
5014 return cluster.UnlockWithTimeout(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTimeoutInSeconds,
5015 chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
5019 chip::Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback> * onSuccessCallback =
5020 new chip::Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback>(OnDoorLockClusterUnlockWithTimeoutResponse,
5022 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5023 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5024 uint16_t mTimeoutInSeconds;
5029 * Discover Attributes
5031 class DiscoverDoorLockAttributes : public ModelCommand
5034 DiscoverDoorLockAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
5036 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5038 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
5040 chip::Controller::DoorLockCluster cluster;
5041 cluster.Associate(device, endpointId);
5042 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5046 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5047 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5048 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5049 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5053 * Attribute LockState
5055 class ReadDoorLockLockState : public ModelCommand
5058 ReadDoorLockLockState() : ModelCommand("read")
5060 AddArgument("attr-name", "lock-state");
5061 ModelCommand::AddArguments();
5064 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5066 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);
5068 chip::Controller::DoorLockCluster cluster;
5069 cluster.Associate(device, endpointId);
5070 return cluster.ReadAttributeLockState(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5074 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
5075 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
5076 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5077 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5080 class ReportDoorLockLockState : public ModelCommand
5083 ReportDoorLockLockState() : ModelCommand("report")
5085 AddArgument("attr-name", "lock-state");
5086 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
5087 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
5088 ModelCommand::AddArguments();
5091 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5093 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x06) on endpoint %" PRIu16, endpointId);
5095 chip::Controller::DoorLockCluster cluster;
5096 cluster.Associate(device, endpointId);
5098 CHIP_ERROR err = cluster.ReportAttributeLockState(onReportCallback->Cancel());
5099 if (err != CHIP_NO_ERROR)
5104 return cluster.ConfigureAttributeLockState(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
5109 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5110 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5111 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5112 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5113 chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
5114 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
5115 uint16_t mMinInterval;
5116 uint16_t mMaxInterval;
5120 * Attribute LockType
5122 class ReadDoorLockLockType : public ModelCommand
5125 ReadDoorLockLockType() : ModelCommand("read")
5127 AddArgument("attr-name", "lock-type");
5128 ModelCommand::AddArguments();
5131 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5133 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);
5135 chip::Controller::DoorLockCluster cluster;
5136 cluster.Associate(device, endpointId);
5137 return cluster.ReadAttributeLockType(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5141 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
5142 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
5143 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5144 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5148 * Attribute ActuatorEnabled
5150 class ReadDoorLockActuatorEnabled : public ModelCommand
5153 ReadDoorLockActuatorEnabled() : ModelCommand("read")
5155 AddArgument("attr-name", "actuator-enabled");
5156 ModelCommand::AddArguments();
5159 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5161 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);
5163 chip::Controller::DoorLockCluster cluster;
5164 cluster.Associate(device, endpointId);
5165 return cluster.ReadAttributeActuatorEnabled(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5169 chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
5170 new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
5171 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5172 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5176 * Attribute ClusterRevision
5178 class ReadDoorLockClusterRevision : public ModelCommand
5181 ReadDoorLockClusterRevision() : ModelCommand("read")
5183 AddArgument("attr-name", "cluster-revision");
5184 ModelCommand::AddArguments();
5187 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5189 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);
5191 chip::Controller::DoorLockCluster cluster;
5192 cluster.Associate(device, endpointId);
5193 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5197 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
5198 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
5199 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5200 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5203 /*----------------------------------------------------------------------------*\
5204 | Cluster GeneralCommissioning | 0x0030 |
5205 |------------------------------------------------------------------------------|
5207 | * ArmFailSafe | 0x02 |
5208 | * CommissioningComplete | 0x06 |
5209 | * SetFabric | 0x00 |
5210 |------------------------------------------------------------------------------|
5212 | * FabricId | 0x0000 |
5213 | * Breadcrumb | 0x0001 |
5214 | * ClusterRevision | 0xFFFD |
5215 \*----------------------------------------------------------------------------*/
5218 * Command ArmFailSafe
5220 class GeneralCommissioningArmFailSafe : public ModelCommand
5223 GeneralCommissioningArmFailSafe() : ModelCommand("arm-fail-safe")
5225 AddArgument("expiryLengthSeconds", 0, UINT16_MAX, &mExpiryLengthSeconds);
5226 AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
5227 AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
5228 ModelCommand::AddArguments();
5231 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5233 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x02) on endpoint %" PRIu16, endpointId);
5235 chip::Controller::GeneralCommissioningCluster cluster;
5236 cluster.Associate(device, endpointId);
5237 return cluster.ArmFailSafe(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mExpiryLengthSeconds, mBreadcrumb,
5242 chip::Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback> * onSuccessCallback =
5243 new chip::Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback>(
5244 OnGeneralCommissioningClusterArmFailSafeResponse, this);
5245 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5246 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5247 uint16_t mExpiryLengthSeconds;
5248 uint64_t mBreadcrumb;
5249 uint32_t mTimeoutMs;
5253 * Command CommissioningComplete
5255 class GeneralCommissioningCommissioningComplete : public ModelCommand
5258 GeneralCommissioningCommissioningComplete() : ModelCommand("commissioning-complete") { ModelCommand::AddArguments(); }
5260 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5262 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x06) on endpoint %" PRIu16, endpointId);
5264 chip::Controller::GeneralCommissioningCluster cluster;
5265 cluster.Associate(device, endpointId);
5266 return cluster.CommissioningComplete(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5270 chip::Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback> * onSuccessCallback =
5271 new chip::Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback>(
5272 OnGeneralCommissioningClusterCommissioningCompleteResponse, this);
5273 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5274 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5280 class GeneralCommissioningSetFabric : public ModelCommand
5283 GeneralCommissioningSetFabric() : ModelCommand("set-fabric")
5285 AddArgument("fabricId", &mFabricId);
5286 AddArgument("fabricSecret", &mFabricSecret);
5287 AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
5288 AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
5289 ModelCommand::AddArguments();
5292 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5294 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);
5296 chip::Controller::GeneralCommissioningCluster cluster;
5297 cluster.Associate(device, endpointId);
5298 return cluster.SetFabric(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
5299 chip::ByteSpan(chip::Uint8::from_char(mFabricId), strlen(mFabricId)),
5300 chip::ByteSpan(chip::Uint8::from_char(mFabricSecret), strlen(mFabricSecret)), mBreadcrumb,
5305 chip::Callback::Callback<GeneralCommissioningClusterSetFabricResponseCallback> * onSuccessCallback =
5306 new chip::Callback::Callback<GeneralCommissioningClusterSetFabricResponseCallback>(
5307 OnGeneralCommissioningClusterSetFabricResponse, this);
5308 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5309 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5311 char * mFabricSecret;
5312 uint64_t mBreadcrumb;
5313 uint32_t mTimeoutMs;
5317 * Discover Attributes
5319 class DiscoverGeneralCommissioningAttributes : public ModelCommand
5322 DiscoverGeneralCommissioningAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
5324 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5326 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
5328 chip::Controller::GeneralCommissioningCluster cluster;
5329 cluster.Associate(device, endpointId);
5330 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5334 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5335 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5336 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5337 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5341 * Attribute FabricId
5343 class ReadGeneralCommissioningFabricId : public ModelCommand
5346 ReadGeneralCommissioningFabricId() : ModelCommand("read")
5348 AddArgument("attr-name", "fabric-id");
5349 ModelCommand::AddArguments();
5352 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5354 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);
5356 chip::Controller::GeneralCommissioningCluster cluster;
5357 cluster.Associate(device, endpointId);
5358 return cluster.ReadAttributeFabricId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5362 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
5363 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
5364 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5365 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5369 * Attribute Breadcrumb
5371 class ReadGeneralCommissioningBreadcrumb : public ModelCommand
5374 ReadGeneralCommissioningBreadcrumb() : ModelCommand("read")
5376 AddArgument("attr-name", "breadcrumb");
5377 ModelCommand::AddArguments();
5380 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5382 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);
5384 chip::Controller::GeneralCommissioningCluster cluster;
5385 cluster.Associate(device, endpointId);
5386 return cluster.ReadAttributeBreadcrumb(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5390 chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
5391 new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
5392 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5393 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5396 class WriteGeneralCommissioningBreadcrumb : public ModelCommand
5399 WriteGeneralCommissioningBreadcrumb() : ModelCommand("write")
5401 AddArgument("attr-name", "breadcrumb");
5402 AddArgument("attr-value", 0, UINT64_MAX, &mValue);
5403 ModelCommand::AddArguments();
5406 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5408 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x01) on endpoint %" PRIu16, endpointId);
5410 chip::Controller::GeneralCommissioningCluster cluster;
5411 cluster.Associate(device, endpointId);
5412 return cluster.WriteAttributeBreadcrumb(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
5416 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5417 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5418 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5419 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5424 * Attribute ClusterRevision
5426 class ReadGeneralCommissioningClusterRevision : public ModelCommand
5429 ReadGeneralCommissioningClusterRevision() : ModelCommand("read")
5431 AddArgument("attr-name", "cluster-revision");
5432 ModelCommand::AddArguments();
5435 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5437 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);
5439 chip::Controller::GeneralCommissioningCluster cluster;
5440 cluster.Associate(device, endpointId);
5441 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5445 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
5446 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
5447 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5448 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5451 /*----------------------------------------------------------------------------*\
5452 | Cluster Groups | 0x0004 |
5453 |------------------------------------------------------------------------------|
5455 | * AddGroup | 0x00 |
5456 | * AddGroupIfIdentifying | 0x05 |
5457 | * GetGroupMembership | 0x02 |
5458 | * RemoveAllGroups | 0x04 |
5459 | * RemoveGroup | 0x03 |
5460 | * ViewGroup | 0x01 |
5461 |------------------------------------------------------------------------------|
5463 | * NameSupport | 0x0000 |
5464 | * ClusterRevision | 0xFFFD |
5465 \*----------------------------------------------------------------------------*/
5470 class GroupsAddGroup : public ModelCommand
5473 GroupsAddGroup() : ModelCommand("add-group")
5475 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
5476 AddArgument("groupName", &mGroupName);
5477 ModelCommand::AddArguments();
5480 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5482 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu16, endpointId);
5484 chip::Controller::GroupsCluster cluster;
5485 cluster.Associate(device, endpointId);
5486 return cluster.AddGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
5487 chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
5491 chip::Callback::Callback<GroupsClusterAddGroupResponseCallback> * onSuccessCallback =
5492 new chip::Callback::Callback<GroupsClusterAddGroupResponseCallback>(OnGroupsClusterAddGroupResponse, this);
5493 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5494 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5500 * Command AddGroupIfIdentifying
5502 class GroupsAddGroupIfIdentifying : public ModelCommand
5505 GroupsAddGroupIfIdentifying() : ModelCommand("add-group-if-identifying")
5507 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
5508 AddArgument("groupName", &mGroupName);
5509 ModelCommand::AddArguments();
5512 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5514 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x05) on endpoint %" PRIu16, endpointId);
5516 chip::Controller::GroupsCluster cluster;
5517 cluster.Associate(device, endpointId);
5518 return cluster.AddGroupIfIdentifying(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
5519 chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
5523 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5524 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5525 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5526 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5532 * Command GetGroupMembership
5534 class GroupsGetGroupMembership : public ModelCommand
5537 GroupsGetGroupMembership() : ModelCommand("get-group-membership")
5539 AddArgument("groupCount", 0, UINT8_MAX, &mGroupCount);
5540 AddArgument("groupList", 0, UINT16_MAX, &mGroupList);
5541 ModelCommand::AddArguments();
5544 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5546 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x02) on endpoint %" PRIu16, endpointId);
5548 chip::Controller::GroupsCluster cluster;
5549 cluster.Associate(device, endpointId);
5550 return cluster.GetGroupMembership(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupCount, mGroupList);
5554 chip::Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback> * onSuccessCallback =
5555 new chip::Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback>(OnGroupsClusterGetGroupMembershipResponse,
5557 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5558 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5559 uint8_t mGroupCount;
5560 uint16_t mGroupList;
5564 * Command RemoveAllGroups
5566 class GroupsRemoveAllGroups : public ModelCommand
5569 GroupsRemoveAllGroups() : ModelCommand("remove-all-groups") { ModelCommand::AddArguments(); }
5571 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5573 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x04) on endpoint %" PRIu16, endpointId);
5575 chip::Controller::GroupsCluster cluster;
5576 cluster.Associate(device, endpointId);
5577 return cluster.RemoveAllGroups(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5581 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5582 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5583 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5584 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5588 * Command RemoveGroup
5590 class GroupsRemoveGroup : public ModelCommand
5593 GroupsRemoveGroup() : ModelCommand("remove-group")
5595 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
5596 ModelCommand::AddArguments();
5599 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5601 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x03) on endpoint %" PRIu16, endpointId);
5603 chip::Controller::GroupsCluster cluster;
5604 cluster.Associate(device, endpointId);
5605 return cluster.RemoveGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
5609 chip::Callback::Callback<GroupsClusterRemoveGroupResponseCallback> * onSuccessCallback =
5610 new chip::Callback::Callback<GroupsClusterRemoveGroupResponseCallback>(OnGroupsClusterRemoveGroupResponse, this);
5611 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5612 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5619 class GroupsViewGroup : public ModelCommand
5622 GroupsViewGroup() : ModelCommand("view-group")
5624 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
5625 ModelCommand::AddArguments();
5628 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5630 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x01) on endpoint %" PRIu16, endpointId);
5632 chip::Controller::GroupsCluster cluster;
5633 cluster.Associate(device, endpointId);
5634 return cluster.ViewGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
5638 chip::Callback::Callback<GroupsClusterViewGroupResponseCallback> * onSuccessCallback =
5639 new chip::Callback::Callback<GroupsClusterViewGroupResponseCallback>(OnGroupsClusterViewGroupResponse, this);
5640 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5641 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5646 * Discover Attributes
5648 class DiscoverGroupsAttributes : public ModelCommand
5651 DiscoverGroupsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
5653 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5655 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
5657 chip::Controller::GroupsCluster cluster;
5658 cluster.Associate(device, endpointId);
5659 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5663 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5664 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5665 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5666 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5670 * Attribute NameSupport
5672 class ReadGroupsNameSupport : public ModelCommand
5675 ReadGroupsNameSupport() : ModelCommand("read")
5677 AddArgument("attr-name", "name-support");
5678 ModelCommand::AddArguments();
5681 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5683 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu16, endpointId);
5685 chip::Controller::GroupsCluster cluster;
5686 cluster.Associate(device, endpointId);
5687 return cluster.ReadAttributeNameSupport(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5691 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
5692 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
5693 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5694 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5698 * Attribute ClusterRevision
5700 class ReadGroupsClusterRevision : public ModelCommand
5703 ReadGroupsClusterRevision() : ModelCommand("read")
5705 AddArgument("attr-name", "cluster-revision");
5706 ModelCommand::AddArguments();
5709 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5711 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu16, endpointId);
5713 chip::Controller::GroupsCluster cluster;
5714 cluster.Associate(device, endpointId);
5715 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5719 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
5720 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
5721 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5722 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5725 /*----------------------------------------------------------------------------*\
5726 | Cluster Identify | 0x0003 |
5727 |------------------------------------------------------------------------------|
5729 | * Identify | 0x00 |
5730 | * IdentifyQuery | 0x01 |
5731 |------------------------------------------------------------------------------|
5733 | * IdentifyTime | 0x0000 |
5734 | * ClusterRevision | 0xFFFD |
5735 \*----------------------------------------------------------------------------*/
5740 class IdentifyIdentify : public ModelCommand
5743 IdentifyIdentify() : ModelCommand("identify")
5745 AddArgument("identifyTime", 0, UINT16_MAX, &mIdentifyTime);
5746 ModelCommand::AddArguments();
5749 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5751 ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu16, endpointId);
5753 chip::Controller::IdentifyCluster cluster;
5754 cluster.Associate(device, endpointId);
5755 return cluster.Identify(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIdentifyTime);
5759 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5760 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5761 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5762 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5763 uint16_t mIdentifyTime;
5767 * Command IdentifyQuery
5769 class IdentifyIdentifyQuery : public ModelCommand
5772 IdentifyIdentifyQuery() : ModelCommand("identify-query") { ModelCommand::AddArguments(); }
5774 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5776 ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x01) on endpoint %" PRIu16, endpointId);
5778 chip::Controller::IdentifyCluster cluster;
5779 cluster.Associate(device, endpointId);
5780 return cluster.IdentifyQuery(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5784 chip::Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback> * onSuccessCallback =
5785 new chip::Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback>(OnIdentifyClusterIdentifyQueryResponse, this);
5786 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5787 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5791 * Discover Attributes
5793 class DiscoverIdentifyAttributes : public ModelCommand
5796 DiscoverIdentifyAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
5798 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5800 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
5802 chip::Controller::IdentifyCluster cluster;
5803 cluster.Associate(device, endpointId);
5804 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5808 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5809 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5810 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5811 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5815 * Attribute IdentifyTime
5817 class ReadIdentifyIdentifyTime : public ModelCommand
5820 ReadIdentifyIdentifyTime() : ModelCommand("read")
5822 AddArgument("attr-name", "identify-time");
5823 ModelCommand::AddArguments();
5826 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5828 ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu16, endpointId);
5830 chip::Controller::IdentifyCluster cluster;
5831 cluster.Associate(device, endpointId);
5832 return cluster.ReadAttributeIdentifyTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5836 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
5837 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
5838 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5839 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5842 class WriteIdentifyIdentifyTime : public ModelCommand
5845 WriteIdentifyIdentifyTime() : ModelCommand("write")
5847 AddArgument("attr-name", "identify-time");
5848 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
5849 ModelCommand::AddArguments();
5852 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5854 ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x01) on endpoint %" PRIu16, endpointId);
5856 chip::Controller::IdentifyCluster cluster;
5857 cluster.Associate(device, endpointId);
5858 return cluster.WriteAttributeIdentifyTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
5862 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5863 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5864 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5865 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5870 * Attribute ClusterRevision
5872 class ReadIdentifyClusterRevision : public ModelCommand
5875 ReadIdentifyClusterRevision() : ModelCommand("read")
5877 AddArgument("attr-name", "cluster-revision");
5878 ModelCommand::AddArguments();
5881 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5883 ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu16, endpointId);
5885 chip::Controller::IdentifyCluster cluster;
5886 cluster.Associate(device, endpointId);
5887 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5891 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
5892 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
5893 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5894 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5897 /*----------------------------------------------------------------------------*\
5898 | Cluster LevelControl | 0x0008 |
5899 |------------------------------------------------------------------------------|
5902 | * MoveToLevel | 0x00 |
5903 | * MoveToLevelWithOnOff | 0x04 |
5904 | * MoveWithOnOff | 0x05 |
5906 | * StepWithOnOff | 0x06 |
5908 | * StopWithOnOff | 0x07 |
5909 |------------------------------------------------------------------------------|
5911 | * CurrentLevel | 0x0000 |
5912 | * ClusterRevision | 0xFFFD |
5913 \*----------------------------------------------------------------------------*/
5918 class LevelControlMove : public ModelCommand
5921 LevelControlMove() : ModelCommand("move")
5923 AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
5924 AddArgument("rate", 0, UINT8_MAX, &mRate);
5925 AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
5926 AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
5927 ModelCommand::AddArguments();
5930 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5932 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x01) on endpoint %" PRIu16, endpointId);
5934 chip::Controller::LevelControlCluster cluster;
5935 cluster.Associate(device, endpointId);
5936 return cluster.Move(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionMask,
5941 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5942 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5943 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5944 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5947 uint8_t mOptionMask;
5948 uint8_t mOptionOverride;
5952 * Command MoveToLevel
5954 class LevelControlMoveToLevel : public ModelCommand
5957 LevelControlMoveToLevel() : ModelCommand("move-to-level")
5959 AddArgument("level", 0, UINT8_MAX, &mLevel);
5960 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
5961 AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
5962 AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
5963 ModelCommand::AddArguments();
5966 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5968 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu16, endpointId);
5970 chip::Controller::LevelControlCluster cluster;
5971 cluster.Associate(device, endpointId);
5972 return cluster.MoveToLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLevel, mTransitionTime, mOptionMask,
5977 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5978 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5979 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5980 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5982 uint16_t mTransitionTime;
5983 uint8_t mOptionMask;
5984 uint8_t mOptionOverride;
5988 * Command MoveToLevelWithOnOff
5990 class LevelControlMoveToLevelWithOnOff : public ModelCommand
5993 LevelControlMoveToLevelWithOnOff() : ModelCommand("move-to-level-with-on-off")
5995 AddArgument("level", 0, UINT8_MAX, &mLevel);
5996 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
5997 ModelCommand::AddArguments();
6000 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6002 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x04) on endpoint %" PRIu16, endpointId);
6004 chip::Controller::LevelControlCluster cluster;
6005 cluster.Associate(device, endpointId);
6006 return cluster.MoveToLevelWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLevel, mTransitionTime);
6010 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6011 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6012 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6013 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6015 uint16_t mTransitionTime;
6019 * Command MoveWithOnOff
6021 class LevelControlMoveWithOnOff : public ModelCommand
6024 LevelControlMoveWithOnOff() : ModelCommand("move-with-on-off")
6026 AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
6027 AddArgument("rate", 0, UINT8_MAX, &mRate);
6028 ModelCommand::AddArguments();
6031 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6033 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x05) on endpoint %" PRIu16, endpointId);
6035 chip::Controller::LevelControlCluster cluster;
6036 cluster.Associate(device, endpointId);
6037 return cluster.MoveWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate);
6041 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6042 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6043 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6044 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6052 class LevelControlStep : public ModelCommand
6055 LevelControlStep() : ModelCommand("step")
6057 AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
6058 AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
6059 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
6060 AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
6061 AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
6062 ModelCommand::AddArguments();
6065 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6067 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x02) on endpoint %" PRIu16, endpointId);
6069 chip::Controller::LevelControlCluster cluster;
6070 cluster.Associate(device, endpointId);
6071 return cluster.Step(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize, mTransitionTime,
6072 mOptionMask, mOptionOverride);
6076 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6077 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6078 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6079 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6082 uint16_t mTransitionTime;
6083 uint8_t mOptionMask;
6084 uint8_t mOptionOverride;
6088 * Command StepWithOnOff
6090 class LevelControlStepWithOnOff : public ModelCommand
6093 LevelControlStepWithOnOff() : ModelCommand("step-with-on-off")
6095 AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
6096 AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
6097 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
6098 ModelCommand::AddArguments();
6101 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6103 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x06) on endpoint %" PRIu16, endpointId);
6105 chip::Controller::LevelControlCluster cluster;
6106 cluster.Associate(device, endpointId);
6107 return cluster.StepWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
6112 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6113 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6114 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6115 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6118 uint16_t mTransitionTime;
6124 class LevelControlStop : public ModelCommand
6127 LevelControlStop() : ModelCommand("stop")
6129 AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
6130 AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
6131 ModelCommand::AddArguments();
6134 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6136 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x03) on endpoint %" PRIu16, endpointId);
6138 chip::Controller::LevelControlCluster cluster;
6139 cluster.Associate(device, endpointId);
6140 return cluster.Stop(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOptionMask, mOptionOverride);
6144 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6145 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6146 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6147 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6148 uint8_t mOptionMask;
6149 uint8_t mOptionOverride;
6153 * Command StopWithOnOff
6155 class LevelControlStopWithOnOff : public ModelCommand
6158 LevelControlStopWithOnOff() : ModelCommand("stop-with-on-off") { ModelCommand::AddArguments(); }
6160 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6162 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x07) on endpoint %" PRIu16, endpointId);
6164 chip::Controller::LevelControlCluster cluster;
6165 cluster.Associate(device, endpointId);
6166 return cluster.StopWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6170 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6171 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6172 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6173 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6177 * Discover Attributes
6179 class DiscoverLevelControlAttributes : public ModelCommand
6182 DiscoverLevelControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
6184 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6186 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
6188 chip::Controller::LevelControlCluster cluster;
6189 cluster.Associate(device, endpointId);
6190 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6194 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6195 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6196 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6197 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6201 * Attribute CurrentLevel
6203 class ReadLevelControlCurrentLevel : public ModelCommand
6206 ReadLevelControlCurrentLevel() : ModelCommand("read")
6208 AddArgument("attr-name", "current-level");
6209 ModelCommand::AddArguments();
6212 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6214 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu16, endpointId);
6216 chip::Controller::LevelControlCluster cluster;
6217 cluster.Associate(device, endpointId);
6218 return cluster.ReadAttributeCurrentLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6222 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
6223 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
6224 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6225 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6228 class ReportLevelControlCurrentLevel : public ModelCommand
6231 ReportLevelControlCurrentLevel() : ModelCommand("report")
6233 AddArgument("attr-name", "current-level");
6234 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
6235 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
6236 AddArgument("change", 0, UINT8_MAX, &mChange);
6237 ModelCommand::AddArguments();
6240 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6242 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x06) on endpoint %" PRIu16, endpointId);
6244 chip::Controller::LevelControlCluster cluster;
6245 cluster.Associate(device, endpointId);
6247 CHIP_ERROR err = cluster.ReportAttributeCurrentLevel(onReportCallback->Cancel());
6248 if (err != CHIP_NO_ERROR)
6253 return cluster.ConfigureAttributeCurrentLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
6254 mMaxInterval, mChange);
6258 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6259 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6260 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6261 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6262 chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
6263 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
6264 uint16_t mMinInterval;
6265 uint16_t mMaxInterval;
6270 * Attribute ClusterRevision
6272 class ReadLevelControlClusterRevision : public ModelCommand
6275 ReadLevelControlClusterRevision() : ModelCommand("read")
6277 AddArgument("attr-name", "cluster-revision");
6278 ModelCommand::AddArguments();
6281 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6283 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu16, endpointId);
6285 chip::Controller::LevelControlCluster cluster;
6286 cluster.Associate(device, endpointId);
6287 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6291 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
6292 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
6293 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6294 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6297 /*----------------------------------------------------------------------------*\
6298 | Cluster LowPower | 0x0508 |
6299 |------------------------------------------------------------------------------|
6302 |------------------------------------------------------------------------------|
6304 | * ClusterRevision | 0xFFFD |
6305 \*----------------------------------------------------------------------------*/
6310 class LowPowerSleep : public ModelCommand
6313 LowPowerSleep() : ModelCommand("sleep") { ModelCommand::AddArguments(); }
6315 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6317 ChipLogProgress(chipTool, "Sending cluster (0x0508) command (0x00) on endpoint %" PRIu16, endpointId);
6319 chip::Controller::LowPowerCluster cluster;
6320 cluster.Associate(device, endpointId);
6321 return cluster.Sleep(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6325 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6326 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6327 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6328 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6332 * Discover Attributes
6334 class DiscoverLowPowerAttributes : public ModelCommand
6337 DiscoverLowPowerAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
6339 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6341 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
6343 chip::Controller::LowPowerCluster cluster;
6344 cluster.Associate(device, endpointId);
6345 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6349 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6350 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6351 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6352 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6356 * Attribute ClusterRevision
6358 class ReadLowPowerClusterRevision : public ModelCommand
6361 ReadLowPowerClusterRevision() : ModelCommand("read")
6363 AddArgument("attr-name", "cluster-revision");
6364 ModelCommand::AddArguments();
6367 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6369 ChipLogProgress(chipTool, "Sending cluster (0x0508) command (0x00) on endpoint %" PRIu16, endpointId);
6371 chip::Controller::LowPowerCluster cluster;
6372 cluster.Associate(device, endpointId);
6373 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6377 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
6378 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
6379 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6380 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6383 /*----------------------------------------------------------------------------*\
6384 | Cluster MediaPlayback | 0xF001 |
6385 |------------------------------------------------------------------------------|
6387 | * FastForwardRequest | 0x07 |
6388 | * NextRequest | 0x05 |
6389 | * PauseRequest | 0x01 |
6390 | * PlayRequest | 0x00 |
6391 | * PreviousRequest | 0x04 |
6392 | * RewindRequest | 0x06 |
6393 | * SkipBackwardRequest | 0x09 |
6394 | * SkipForwardRequest | 0x08 |
6395 | * StartOverRequest | 0x03 |
6396 | * StopRequest | 0x02 |
6397 |------------------------------------------------------------------------------|
6399 | * CurrentState | 0x0000 |
6400 | * ClusterRevision | 0xFFFD |
6401 \*----------------------------------------------------------------------------*/
6404 * Command FastForwardRequest
6406 class MediaPlaybackFastForwardRequest : public ModelCommand
6409 MediaPlaybackFastForwardRequest() : ModelCommand("fast-forward-request") { ModelCommand::AddArguments(); }
6411 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6413 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x07) on endpoint %" PRIu16, endpointId);
6415 chip::Controller::MediaPlaybackCluster cluster;
6416 cluster.Associate(device, endpointId);
6417 return cluster.FastForwardRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6421 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6422 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6423 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6424 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6428 * Command NextRequest
6430 class MediaPlaybackNextRequest : public ModelCommand
6433 MediaPlaybackNextRequest() : ModelCommand("next-request") { ModelCommand::AddArguments(); }
6435 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6437 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x05) on endpoint %" PRIu16, endpointId);
6439 chip::Controller::MediaPlaybackCluster cluster;
6440 cluster.Associate(device, endpointId);
6441 return cluster.NextRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6445 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6446 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6447 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6448 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6452 * Command PauseRequest
6454 class MediaPlaybackPauseRequest : public ModelCommand
6457 MediaPlaybackPauseRequest() : ModelCommand("pause-request") { ModelCommand::AddArguments(); }
6459 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6461 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x01) on endpoint %" PRIu16, endpointId);
6463 chip::Controller::MediaPlaybackCluster cluster;
6464 cluster.Associate(device, endpointId);
6465 return cluster.PauseRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6469 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6470 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6471 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6472 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6476 * Command PlayRequest
6478 class MediaPlaybackPlayRequest : public ModelCommand
6481 MediaPlaybackPlayRequest() : ModelCommand("play-request") { ModelCommand::AddArguments(); }
6483 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6485 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x00) on endpoint %" PRIu16, endpointId);
6487 chip::Controller::MediaPlaybackCluster cluster;
6488 cluster.Associate(device, endpointId);
6489 return cluster.PlayRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6493 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6494 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6495 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6496 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6500 * Command PreviousRequest
6502 class MediaPlaybackPreviousRequest : public ModelCommand
6505 MediaPlaybackPreviousRequest() : ModelCommand("previous-request") { ModelCommand::AddArguments(); }
6507 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6509 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x04) on endpoint %" PRIu16, endpointId);
6511 chip::Controller::MediaPlaybackCluster cluster;
6512 cluster.Associate(device, endpointId);
6513 return cluster.PreviousRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6517 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6518 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6519 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6520 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6524 * Command RewindRequest
6526 class MediaPlaybackRewindRequest : public ModelCommand
6529 MediaPlaybackRewindRequest() : ModelCommand("rewind-request") { ModelCommand::AddArguments(); }
6531 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6533 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x06) on endpoint %" PRIu16, endpointId);
6535 chip::Controller::MediaPlaybackCluster cluster;
6536 cluster.Associate(device, endpointId);
6537 return cluster.RewindRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6541 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6542 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6543 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6544 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6548 * Command SkipBackwardRequest
6550 class MediaPlaybackSkipBackwardRequest : public ModelCommand
6553 MediaPlaybackSkipBackwardRequest() : ModelCommand("skip-backward-request") { ModelCommand::AddArguments(); }
6555 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6557 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x09) on endpoint %" PRIu16, endpointId);
6559 chip::Controller::MediaPlaybackCluster cluster;
6560 cluster.Associate(device, endpointId);
6561 return cluster.SkipBackwardRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6565 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6566 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6567 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6568 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6572 * Command SkipForwardRequest
6574 class MediaPlaybackSkipForwardRequest : public ModelCommand
6577 MediaPlaybackSkipForwardRequest() : ModelCommand("skip-forward-request") { ModelCommand::AddArguments(); }
6579 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6581 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x08) on endpoint %" PRIu16, endpointId);
6583 chip::Controller::MediaPlaybackCluster cluster;
6584 cluster.Associate(device, endpointId);
6585 return cluster.SkipForwardRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6589 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6590 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6591 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6592 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6596 * Command StartOverRequest
6598 class MediaPlaybackStartOverRequest : public ModelCommand
6601 MediaPlaybackStartOverRequest() : ModelCommand("start-over-request") { ModelCommand::AddArguments(); }
6603 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6605 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x03) on endpoint %" PRIu16, endpointId);
6607 chip::Controller::MediaPlaybackCluster cluster;
6608 cluster.Associate(device, endpointId);
6609 return cluster.StartOverRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6613 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6614 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6615 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6616 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6620 * Command StopRequest
6622 class MediaPlaybackStopRequest : public ModelCommand
6625 MediaPlaybackStopRequest() : ModelCommand("stop-request") { ModelCommand::AddArguments(); }
6627 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6629 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x02) on endpoint %" PRIu16, endpointId);
6631 chip::Controller::MediaPlaybackCluster cluster;
6632 cluster.Associate(device, endpointId);
6633 return cluster.StopRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6637 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6638 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6639 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6640 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6644 * Discover Attributes
6646 class DiscoverMediaPlaybackAttributes : public ModelCommand
6649 DiscoverMediaPlaybackAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
6651 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6653 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
6655 chip::Controller::MediaPlaybackCluster cluster;
6656 cluster.Associate(device, endpointId);
6657 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6661 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6662 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6663 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6664 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6668 * Attribute CurrentState
6670 class ReadMediaPlaybackCurrentState : public ModelCommand
6673 ReadMediaPlaybackCurrentState() : ModelCommand("read")
6675 AddArgument("attr-name", "current-state");
6676 ModelCommand::AddArguments();
6679 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6681 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x00) on endpoint %" PRIu16, endpointId);
6683 chip::Controller::MediaPlaybackCluster cluster;
6684 cluster.Associate(device, endpointId);
6685 return cluster.ReadAttributeCurrentState(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6689 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
6690 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
6691 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6692 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6696 * Attribute ClusterRevision
6698 class ReadMediaPlaybackClusterRevision : public ModelCommand
6701 ReadMediaPlaybackClusterRevision() : ModelCommand("read")
6703 AddArgument("attr-name", "cluster-revision");
6704 ModelCommand::AddArguments();
6707 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6709 ChipLogProgress(chipTool, "Sending cluster (0xF001) command (0x00) on endpoint %" PRIu16, endpointId);
6711 chip::Controller::MediaPlaybackCluster cluster;
6712 cluster.Associate(device, endpointId);
6713 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6717 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
6718 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
6719 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6720 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6723 /*----------------------------------------------------------------------------*\
6724 | Cluster OnOff | 0x0006 |
6725 |------------------------------------------------------------------------------|
6730 |------------------------------------------------------------------------------|
6732 | * OnOff | 0x0000 |
6733 | * ClusterRevision | 0xFFFD |
6734 \*----------------------------------------------------------------------------*/
6739 class OnOffOff : public ModelCommand
6742 OnOffOff() : ModelCommand("off") { ModelCommand::AddArguments(); }
6744 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6746 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu16, endpointId);
6748 chip::Controller::OnOffCluster cluster;
6749 cluster.Associate(device, endpointId);
6750 return cluster.Off(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6754 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6755 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6756 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6757 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6763 class OnOffOn : public ModelCommand
6766 OnOffOn() : ModelCommand("on") { ModelCommand::AddArguments(); }
6768 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6770 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x01) on endpoint %" PRIu16, endpointId);
6772 chip::Controller::OnOffCluster cluster;
6773 cluster.Associate(device, endpointId);
6774 return cluster.On(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6778 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6779 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6780 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6781 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6787 class OnOffToggle : public ModelCommand
6790 OnOffToggle() : ModelCommand("toggle") { ModelCommand::AddArguments(); }
6792 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6794 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x02) on endpoint %" PRIu16, endpointId);
6796 chip::Controller::OnOffCluster cluster;
6797 cluster.Associate(device, endpointId);
6798 return cluster.Toggle(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6802 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6803 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6804 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6805 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6809 * Discover Attributes
6811 class DiscoverOnOffAttributes : public ModelCommand
6814 DiscoverOnOffAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
6816 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6818 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
6820 chip::Controller::OnOffCluster cluster;
6821 cluster.Associate(device, endpointId);
6822 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6826 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6827 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6828 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6829 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6835 class ReadOnOffOnOff : public ModelCommand
6838 ReadOnOffOnOff() : ModelCommand("read")
6840 AddArgument("attr-name", "on-off");
6841 ModelCommand::AddArguments();
6844 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6846 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu16, endpointId);
6848 chip::Controller::OnOffCluster cluster;
6849 cluster.Associate(device, endpointId);
6850 return cluster.ReadAttributeOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6854 chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
6855 new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
6856 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6857 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6860 class ReportOnOffOnOff : public ModelCommand
6863 ReportOnOffOnOff() : ModelCommand("report")
6865 AddArgument("attr-name", "on-off");
6866 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
6867 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
6868 ModelCommand::AddArguments();
6871 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6873 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x06) on endpoint %" PRIu16, endpointId);
6875 chip::Controller::OnOffCluster cluster;
6876 cluster.Associate(device, endpointId);
6878 CHIP_ERROR err = cluster.ReportAttributeOnOff(onReportCallback->Cancel());
6879 if (err != CHIP_NO_ERROR)
6884 return cluster.ConfigureAttributeOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
6889 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6890 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6891 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6892 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6893 chip::Callback::Callback<BooleanAttributeCallback> * onReportCallback =
6894 new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
6895 uint16_t mMinInterval;
6896 uint16_t mMaxInterval;
6900 * Attribute ClusterRevision
6902 class ReadOnOffClusterRevision : public ModelCommand
6905 ReadOnOffClusterRevision() : ModelCommand("read")
6907 AddArgument("attr-name", "cluster-revision");
6908 ModelCommand::AddArguments();
6911 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6913 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu16, endpointId);
6915 chip::Controller::OnOffCluster cluster;
6916 cluster.Associate(device, endpointId);
6917 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6921 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
6922 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
6923 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6924 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6927 /*----------------------------------------------------------------------------*\
6928 | Cluster Scenes | 0x0005 |
6929 |------------------------------------------------------------------------------|
6931 | * AddScene | 0x00 |
6932 | * GetSceneMembership | 0x06 |
6933 | * RecallScene | 0x05 |
6934 | * RemoveAllScenes | 0x03 |
6935 | * RemoveScene | 0x02 |
6936 | * StoreScene | 0x04 |
6937 | * ViewScene | 0x01 |
6938 |------------------------------------------------------------------------------|
6940 | * SceneCount | 0x0000 |
6941 | * CurrentScene | 0x0001 |
6942 | * CurrentGroup | 0x0002 |
6943 | * SceneValid | 0x0003 |
6944 | * NameSupport | 0x0004 |
6945 | * ClusterRevision | 0xFFFD |
6946 \*----------------------------------------------------------------------------*/
6951 class ScenesAddScene : public ModelCommand
6954 ScenesAddScene() : ModelCommand("add-scene")
6956 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
6957 AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
6958 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
6959 AddArgument("sceneName", &mSceneName);
6960 AddArgument("clusterId", 0, UINT16_MAX, &mClusterId);
6961 AddArgument("length", 0, UINT8_MAX, &mLength);
6962 AddArgument("value", 0, UINT8_MAX, &mValue);
6963 ModelCommand::AddArguments();
6966 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6968 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
6970 chip::Controller::ScenesCluster cluster;
6971 cluster.Associate(device, endpointId);
6972 return cluster.AddScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId, mTransitionTime,
6973 chip::ByteSpan(chip::Uint8::from_char(mSceneName), strlen(mSceneName)), mClusterId, mLength,
6978 chip::Callback::Callback<ScenesClusterAddSceneResponseCallback> * onSuccessCallback =
6979 new chip::Callback::Callback<ScenesClusterAddSceneResponseCallback>(OnScenesClusterAddSceneResponse, this);
6980 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6981 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6984 uint16_t mTransitionTime;
6986 chip::ClusterId mClusterId;
6992 * Command GetSceneMembership
6994 class ScenesGetSceneMembership : public ModelCommand
6997 ScenesGetSceneMembership() : ModelCommand("get-scene-membership")
6999 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7000 ModelCommand::AddArguments();
7003 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7005 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x06) on endpoint %" PRIu16, endpointId);
7007 chip::Controller::ScenesCluster cluster;
7008 cluster.Associate(device, endpointId);
7009 return cluster.GetSceneMembership(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
7013 chip::Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback> * onSuccessCallback =
7014 new chip::Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback>(OnScenesClusterGetSceneMembershipResponse,
7016 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7017 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7022 * Command RecallScene
7024 class ScenesRecallScene : public ModelCommand
7027 ScenesRecallScene() : ModelCommand("recall-scene")
7029 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7030 AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
7031 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
7032 ModelCommand::AddArguments();
7035 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7037 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x05) on endpoint %" PRIu16, endpointId);
7039 chip::Controller::ScenesCluster cluster;
7040 cluster.Associate(device, endpointId);
7041 return cluster.RecallScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId, mTransitionTime);
7045 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7046 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7047 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7048 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7051 uint16_t mTransitionTime;
7055 * Command RemoveAllScenes
7057 class ScenesRemoveAllScenes : public ModelCommand
7060 ScenesRemoveAllScenes() : ModelCommand("remove-all-scenes")
7062 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7063 ModelCommand::AddArguments();
7066 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7068 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x03) on endpoint %" PRIu16, endpointId);
7070 chip::Controller::ScenesCluster cluster;
7071 cluster.Associate(device, endpointId);
7072 return cluster.RemoveAllScenes(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
7076 chip::Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback> * onSuccessCallback =
7077 new chip::Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback>(OnScenesClusterRemoveAllScenesResponse, this);
7078 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7079 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7084 * Command RemoveScene
7086 class ScenesRemoveScene : public ModelCommand
7089 ScenesRemoveScene() : ModelCommand("remove-scene")
7091 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7092 AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
7093 ModelCommand::AddArguments();
7096 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7098 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x02) on endpoint %" PRIu16, endpointId);
7100 chip::Controller::ScenesCluster cluster;
7101 cluster.Associate(device, endpointId);
7102 return cluster.RemoveScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
7106 chip::Callback::Callback<ScenesClusterRemoveSceneResponseCallback> * onSuccessCallback =
7107 new chip::Callback::Callback<ScenesClusterRemoveSceneResponseCallback>(OnScenesClusterRemoveSceneResponse, this);
7108 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7109 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7115 * Command StoreScene
7117 class ScenesStoreScene : public ModelCommand
7120 ScenesStoreScene() : ModelCommand("store-scene")
7122 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7123 AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
7124 ModelCommand::AddArguments();
7127 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7129 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x04) on endpoint %" PRIu16, endpointId);
7131 chip::Controller::ScenesCluster cluster;
7132 cluster.Associate(device, endpointId);
7133 return cluster.StoreScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
7137 chip::Callback::Callback<ScenesClusterStoreSceneResponseCallback> * onSuccessCallback =
7138 new chip::Callback::Callback<ScenesClusterStoreSceneResponseCallback>(OnScenesClusterStoreSceneResponse, this);
7139 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7140 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7148 class ScenesViewScene : public ModelCommand
7151 ScenesViewScene() : ModelCommand("view-scene")
7153 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7154 AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
7155 ModelCommand::AddArguments();
7158 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7160 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x01) on endpoint %" PRIu16, endpointId);
7162 chip::Controller::ScenesCluster cluster;
7163 cluster.Associate(device, endpointId);
7164 return cluster.ViewScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
7168 chip::Callback::Callback<ScenesClusterViewSceneResponseCallback> * onSuccessCallback =
7169 new chip::Callback::Callback<ScenesClusterViewSceneResponseCallback>(OnScenesClusterViewSceneResponse, this);
7170 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7171 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7177 * Discover Attributes
7179 class DiscoverScenesAttributes : public ModelCommand
7182 DiscoverScenesAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
7184 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7186 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
7188 chip::Controller::ScenesCluster cluster;
7189 cluster.Associate(device, endpointId);
7190 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7194 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7195 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7196 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7197 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7201 * Attribute SceneCount
7203 class ReadScenesSceneCount : public ModelCommand
7206 ReadScenesSceneCount() : ModelCommand("read")
7208 AddArgument("attr-name", "scene-count");
7209 ModelCommand::AddArguments();
7212 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7214 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
7216 chip::Controller::ScenesCluster cluster;
7217 cluster.Associate(device, endpointId);
7218 return cluster.ReadAttributeSceneCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7222 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
7223 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
7224 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7225 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7229 * Attribute CurrentScene
7231 class ReadScenesCurrentScene : public ModelCommand
7234 ReadScenesCurrentScene() : ModelCommand("read")
7236 AddArgument("attr-name", "current-scene");
7237 ModelCommand::AddArguments();
7240 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7242 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
7244 chip::Controller::ScenesCluster cluster;
7245 cluster.Associate(device, endpointId);
7246 return cluster.ReadAttributeCurrentScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7250 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
7251 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
7252 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7253 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7257 * Attribute CurrentGroup
7259 class ReadScenesCurrentGroup : public ModelCommand
7262 ReadScenesCurrentGroup() : ModelCommand("read")
7264 AddArgument("attr-name", "current-group");
7265 ModelCommand::AddArguments();
7268 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7270 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
7272 chip::Controller::ScenesCluster cluster;
7273 cluster.Associate(device, endpointId);
7274 return cluster.ReadAttributeCurrentGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7278 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
7279 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
7280 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7281 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7285 * Attribute SceneValid
7287 class ReadScenesSceneValid : public ModelCommand
7290 ReadScenesSceneValid() : ModelCommand("read")
7292 AddArgument("attr-name", "scene-valid");
7293 ModelCommand::AddArguments();
7296 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7298 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
7300 chip::Controller::ScenesCluster cluster;
7301 cluster.Associate(device, endpointId);
7302 return cluster.ReadAttributeSceneValid(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7306 chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
7307 new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
7308 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7309 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7313 * Attribute NameSupport
7315 class ReadScenesNameSupport : public ModelCommand
7318 ReadScenesNameSupport() : ModelCommand("read")
7320 AddArgument("attr-name", "name-support");
7321 ModelCommand::AddArguments();
7324 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7326 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
7328 chip::Controller::ScenesCluster cluster;
7329 cluster.Associate(device, endpointId);
7330 return cluster.ReadAttributeNameSupport(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7334 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
7335 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
7336 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7337 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7341 * Attribute ClusterRevision
7343 class ReadScenesClusterRevision : public ModelCommand
7346 ReadScenesClusterRevision() : ModelCommand("read")
7348 AddArgument("attr-name", "cluster-revision");
7349 ModelCommand::AddArguments();
7352 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7354 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
7356 chip::Controller::ScenesCluster cluster;
7357 cluster.Associate(device, endpointId);
7358 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7362 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
7363 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
7364 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7365 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7368 /*----------------------------------------------------------------------------*\
7369 | Cluster TemperatureMeasurement | 0x0402 |
7370 |------------------------------------------------------------------------------|
7372 |------------------------------------------------------------------------------|
7374 | * MeasuredValue | 0x0000 |
7375 | * MinMeasuredValue | 0x0001 |
7376 | * MaxMeasuredValue | 0x0002 |
7377 | * ClusterRevision | 0xFFFD |
7378 \*----------------------------------------------------------------------------*/
7381 * Discover Attributes
7383 class DiscoverTemperatureMeasurementAttributes : public ModelCommand
7386 DiscoverTemperatureMeasurementAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
7388 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7390 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
7392 chip::Controller::TemperatureMeasurementCluster cluster;
7393 cluster.Associate(device, endpointId);
7394 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7398 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7399 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7400 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7401 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7405 * Attribute MeasuredValue
7407 class ReadTemperatureMeasurementMeasuredValue : public ModelCommand
7410 ReadTemperatureMeasurementMeasuredValue() : ModelCommand("read")
7412 AddArgument("attr-name", "measured-value");
7413 ModelCommand::AddArguments();
7416 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7418 ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);
7420 chip::Controller::TemperatureMeasurementCluster cluster;
7421 cluster.Associate(device, endpointId);
7422 return cluster.ReadAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7426 chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
7427 new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
7428 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7429 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7432 class ReportTemperatureMeasurementMeasuredValue : public ModelCommand
7435 ReportTemperatureMeasurementMeasuredValue() : ModelCommand("report")
7437 AddArgument("attr-name", "measured-value");
7438 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
7439 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
7440 AddArgument("change", INT16_MIN, INT16_MAX, &mChange);
7441 ModelCommand::AddArguments();
7444 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7446 ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x06) on endpoint %" PRIu16, endpointId);
7448 chip::Controller::TemperatureMeasurementCluster cluster;
7449 cluster.Associate(device, endpointId);
7451 CHIP_ERROR err = cluster.ReportAttributeMeasuredValue(onReportCallback->Cancel());
7452 if (err != CHIP_NO_ERROR)
7457 return cluster.ConfigureAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
7458 mMaxInterval, mChange);
7462 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7463 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7464 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7465 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7466 chip::Callback::Callback<Int16sAttributeCallback> * onReportCallback =
7467 new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
7468 uint16_t mMinInterval;
7469 uint16_t mMaxInterval;
7474 * Attribute MinMeasuredValue
7476 class ReadTemperatureMeasurementMinMeasuredValue : public ModelCommand
7479 ReadTemperatureMeasurementMinMeasuredValue() : ModelCommand("read")
7481 AddArgument("attr-name", "min-measured-value");
7482 ModelCommand::AddArguments();
7485 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7487 ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);
7489 chip::Controller::TemperatureMeasurementCluster cluster;
7490 cluster.Associate(device, endpointId);
7491 return cluster.ReadAttributeMinMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7495 chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
7496 new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
7497 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7498 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7502 * Attribute MaxMeasuredValue
7504 class ReadTemperatureMeasurementMaxMeasuredValue : public ModelCommand
7507 ReadTemperatureMeasurementMaxMeasuredValue() : ModelCommand("read")
7509 AddArgument("attr-name", "max-measured-value");
7510 ModelCommand::AddArguments();
7513 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7515 ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);
7517 chip::Controller::TemperatureMeasurementCluster cluster;
7518 cluster.Associate(device, endpointId);
7519 return cluster.ReadAttributeMaxMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7523 chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
7524 new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
7525 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7526 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7530 * Attribute ClusterRevision
7532 class ReadTemperatureMeasurementClusterRevision : public ModelCommand
7535 ReadTemperatureMeasurementClusterRevision() : ModelCommand("read")
7537 AddArgument("attr-name", "cluster-revision");
7538 ModelCommand::AddArguments();
7541 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7543 ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);
7545 chip::Controller::TemperatureMeasurementCluster cluster;
7546 cluster.Associate(device, endpointId);
7547 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7551 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
7552 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
7553 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7554 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7557 /*----------------------------------------------------------------------------*\
7558 | Register all Clusters commands |
7559 \*----------------------------------------------------------------------------*/
7560 void registerClusterApplicationBasic(Commands & commands)
7562 const char * clusterName = "ApplicationBasic";
7564 commands_list clusterCommands = {
7565 make_unique<DiscoverApplicationBasicAttributes>(), make_unique<ReadApplicationBasicVendorName>(),
7566 make_unique<ReadApplicationBasicVendorId>(), make_unique<ReadApplicationBasicApplicationName>(),
7567 make_unique<ReadApplicationBasicProductId>(), make_unique<ReadApplicationBasicApplicationId>(),
7568 make_unique<ReadApplicationBasicCatalogVendorId>(), make_unique<ReadApplicationBasicApplicationSatus>(),
7569 make_unique<ReadApplicationBasicClusterRevision>(),
7572 commands.Register(clusterName, clusterCommands);
7574 void registerClusterBarrierControl(Commands & commands)
7576 const char * clusterName = "BarrierControl";
7578 commands_list clusterCommands = {
7579 make_unique<BarrierControlBarrierControlGoToPercent>(), make_unique<BarrierControlBarrierControlStop>(),
7580 make_unique<DiscoverBarrierControlAttributes>(), make_unique<ReadBarrierControlBarrierMovingState>(),
7581 make_unique<ReadBarrierControlBarrierSafetyStatus>(), make_unique<ReadBarrierControlBarrierCapabilities>(),
7582 make_unique<ReadBarrierControlBarrierPosition>(), make_unique<ReadBarrierControlClusterRevision>(),
7585 commands.Register(clusterName, clusterCommands);
7587 void registerClusterBasic(Commands & commands)
7589 const char * clusterName = "Basic";
7591 commands_list clusterCommands = {
7592 make_unique<BasicMfgSpecificPing>(),
7593 make_unique<DiscoverBasicAttributes>(),
7594 make_unique<ReadBasicInteractionModelVersion>(),
7595 make_unique<ReadBasicVendorName>(),
7596 make_unique<ReadBasicVendorID>(),
7597 make_unique<ReadBasicProductName>(),
7598 make_unique<ReadBasicProductID>(),
7599 make_unique<ReadBasicUserLabel>(),
7600 make_unique<WriteBasicUserLabel>(),
7601 make_unique<ReadBasicLocation>(),
7602 make_unique<WriteBasicLocation>(),
7603 make_unique<ReadBasicHardwareVersion>(),
7604 make_unique<ReadBasicHardwareVersionString>(),
7605 make_unique<ReadBasicSoftwareVersion>(),
7606 make_unique<ReadBasicSoftwareVersionString>(),
7607 make_unique<ReadBasicClusterRevision>(),
7610 commands.Register(clusterName, clusterCommands);
7612 void registerClusterBinding(Commands & commands)
7614 const char * clusterName = "Binding";
7616 commands_list clusterCommands = {
7617 make_unique<BindingBind>(),
7618 make_unique<BindingUnbind>(),
7619 make_unique<DiscoverBindingAttributes>(),
7620 make_unique<ReadBindingClusterRevision>(),
7623 commands.Register(clusterName, clusterCommands);
7625 void registerClusterColorControl(Commands & commands)
7627 const char * clusterName = "ColorControl";
7629 commands_list clusterCommands = {
7630 make_unique<ColorControlMoveColor>(),
7631 make_unique<ColorControlMoveColorTemperature>(),
7632 make_unique<ColorControlMoveHue>(),
7633 make_unique<ColorControlMoveSaturation>(),
7634 make_unique<ColorControlMoveToColor>(),
7635 make_unique<ColorControlMoveToColorTemperature>(),
7636 make_unique<ColorControlMoveToHue>(),
7637 make_unique<ColorControlMoveToHueAndSaturation>(),
7638 make_unique<ColorControlMoveToSaturation>(),
7639 make_unique<ColorControlStepColor>(),
7640 make_unique<ColorControlStepColorTemperature>(),
7641 make_unique<ColorControlStepHue>(),
7642 make_unique<ColorControlStepSaturation>(),
7643 make_unique<ColorControlStopMoveStep>(),
7644 make_unique<DiscoverColorControlAttributes>(),
7645 make_unique<ReadColorControlCurrentHue>(),
7646 make_unique<ReportColorControlCurrentHue>(),
7647 make_unique<ReadColorControlCurrentSaturation>(),
7648 make_unique<ReportColorControlCurrentSaturation>(),
7649 make_unique<ReadColorControlRemainingTime>(),
7650 make_unique<ReadColorControlCurrentX>(),
7651 make_unique<ReportColorControlCurrentX>(),
7652 make_unique<ReadColorControlCurrentY>(),
7653 make_unique<ReportColorControlCurrentY>(),
7654 make_unique<ReadColorControlDriftCompensation>(),
7655 make_unique<ReadColorControlCompensationText>(),
7656 make_unique<ReadColorControlColorTemperature>(),
7657 make_unique<ReportColorControlColorTemperature>(),
7658 make_unique<ReadColorControlColorMode>(),
7659 make_unique<ReadColorControlColorControlOptions>(),
7660 make_unique<WriteColorControlColorControlOptions>(),
7661 make_unique<ReadColorControlNumberOfPrimaries>(),
7662 make_unique<ReadColorControlPrimary1X>(),
7663 make_unique<ReadColorControlPrimary1Y>(),
7664 make_unique<ReadColorControlPrimary1Intensity>(),
7665 make_unique<ReadColorControlPrimary2X>(),
7666 make_unique<ReadColorControlPrimary2Y>(),
7667 make_unique<ReadColorControlPrimary2Intensity>(),
7668 make_unique<ReadColorControlPrimary3X>(),
7669 make_unique<ReadColorControlPrimary3Y>(),
7670 make_unique<ReadColorControlPrimary3Intensity>(),
7671 make_unique<ReadColorControlPrimary4X>(),
7672 make_unique<ReadColorControlPrimary4Y>(),
7673 make_unique<ReadColorControlPrimary4Intensity>(),
7674 make_unique<ReadColorControlPrimary5X>(),
7675 make_unique<ReadColorControlPrimary5Y>(),
7676 make_unique<ReadColorControlPrimary5Intensity>(),
7677 make_unique<ReadColorControlPrimary6X>(),
7678 make_unique<ReadColorControlPrimary6Y>(),
7679 make_unique<ReadColorControlPrimary6Intensity>(),
7680 make_unique<ReadColorControlWhitePointX>(),
7681 make_unique<WriteColorControlWhitePointX>(),
7682 make_unique<ReadColorControlWhitePointY>(),
7683 make_unique<WriteColorControlWhitePointY>(),
7684 make_unique<ReadColorControlColorPointRX>(),
7685 make_unique<WriteColorControlColorPointRX>(),
7686 make_unique<ReadColorControlColorPointRY>(),
7687 make_unique<WriteColorControlColorPointRY>(),
7688 make_unique<ReadColorControlColorPointRIntensity>(),
7689 make_unique<WriteColorControlColorPointRIntensity>(),
7690 make_unique<ReadColorControlColorPointGX>(),
7691 make_unique<WriteColorControlColorPointGX>(),
7692 make_unique<ReadColorControlColorPointGY>(),
7693 make_unique<WriteColorControlColorPointGY>(),
7694 make_unique<ReadColorControlColorPointGIntensity>(),
7695 make_unique<WriteColorControlColorPointGIntensity>(),
7696 make_unique<ReadColorControlColorPointBX>(),
7697 make_unique<WriteColorControlColorPointBX>(),
7698 make_unique<ReadColorControlColorPointBY>(),
7699 make_unique<WriteColorControlColorPointBY>(),
7700 make_unique<ReadColorControlColorPointBIntensity>(),
7701 make_unique<WriteColorControlColorPointBIntensity>(),
7702 make_unique<ReadColorControlEnhancedCurrentHue>(),
7703 make_unique<ReadColorControlEnhancedColorMode>(),
7704 make_unique<ReadColorControlColorLoopActive>(),
7705 make_unique<ReadColorControlColorLoopDirection>(),
7706 make_unique<ReadColorControlColorLoopTime>(),
7707 make_unique<ReadColorControlColorCapabilities>(),
7708 make_unique<ReadColorControlColorTempPhysicalMin>(),
7709 make_unique<ReadColorControlColorTempPhysicalMax>(),
7710 make_unique<ReadColorControlCoupleColorTempToLevelMinMireds>(),
7711 make_unique<ReadColorControlStartUpColorTemperatureMireds>(),
7712 make_unique<WriteColorControlStartUpColorTemperatureMireds>(),
7713 make_unique<ReadColorControlClusterRevision>(),
7716 commands.Register(clusterName, clusterCommands);
7718 void registerClusterContentLaunch(Commands & commands)
7720 const char * clusterName = "ContentLaunch";
7722 commands_list clusterCommands = {
7723 make_unique<ContentLaunchLaunchContent>(),
7724 make_unique<ContentLaunchLaunchURL>(),
7725 make_unique<DiscoverContentLaunchAttributes>(),
7726 make_unique<ReadContentLaunchClusterRevision>(),
7729 commands.Register(clusterName, clusterCommands);
7731 void registerClusterDoorLock(Commands & commands)
7733 const char * clusterName = "DoorLock";
7735 commands_list clusterCommands = {
7736 make_unique<DoorLockClearAllPins>(),
7737 make_unique<DoorLockClearAllRfids>(),
7738 make_unique<DoorLockClearHolidaySchedule>(),
7739 make_unique<DoorLockClearPin>(),
7740 make_unique<DoorLockClearRfid>(),
7741 make_unique<DoorLockClearWeekdaySchedule>(),
7742 make_unique<DoorLockClearYeardaySchedule>(),
7743 make_unique<DoorLockGetHolidaySchedule>(),
7744 make_unique<DoorLockGetLogRecord>(),
7745 make_unique<DoorLockGetPin>(),
7746 make_unique<DoorLockGetRfid>(),
7747 make_unique<DoorLockGetUserType>(),
7748 make_unique<DoorLockGetWeekdaySchedule>(),
7749 make_unique<DoorLockGetYeardaySchedule>(),
7750 make_unique<DoorLockLockDoor>(),
7751 make_unique<DoorLockSetHolidaySchedule>(),
7752 make_unique<DoorLockSetPin>(),
7753 make_unique<DoorLockSetRfid>(),
7754 make_unique<DoorLockSetUserType>(),
7755 make_unique<DoorLockSetWeekdaySchedule>(),
7756 make_unique<DoorLockSetYeardaySchedule>(),
7757 make_unique<DoorLockUnlockDoor>(),
7758 make_unique<DoorLockUnlockWithTimeout>(),
7759 make_unique<DiscoverDoorLockAttributes>(),
7760 make_unique<ReadDoorLockLockState>(),
7761 make_unique<ReportDoorLockLockState>(),
7762 make_unique<ReadDoorLockLockType>(),
7763 make_unique<ReadDoorLockActuatorEnabled>(),
7764 make_unique<ReadDoorLockClusterRevision>(),
7767 commands.Register(clusterName, clusterCommands);
7769 void registerClusterGeneralCommissioning(Commands & commands)
7771 const char * clusterName = "GeneralCommissioning";
7773 commands_list clusterCommands = {
7774 make_unique<GeneralCommissioningArmFailSafe>(), make_unique<GeneralCommissioningCommissioningComplete>(),
7775 make_unique<GeneralCommissioningSetFabric>(), make_unique<DiscoverGeneralCommissioningAttributes>(),
7776 make_unique<ReadGeneralCommissioningFabricId>(), make_unique<ReadGeneralCommissioningBreadcrumb>(),
7777 make_unique<WriteGeneralCommissioningBreadcrumb>(), make_unique<ReadGeneralCommissioningClusterRevision>(),
7780 commands.Register(clusterName, clusterCommands);
7782 void registerClusterGroups(Commands & commands)
7784 const char * clusterName = "Groups";
7786 commands_list clusterCommands = {
7787 make_unique<GroupsAddGroup>(),
7788 make_unique<GroupsAddGroupIfIdentifying>(),
7789 make_unique<GroupsGetGroupMembership>(),
7790 make_unique<GroupsRemoveAllGroups>(),
7791 make_unique<GroupsRemoveGroup>(),
7792 make_unique<GroupsViewGroup>(),
7793 make_unique<DiscoverGroupsAttributes>(),
7794 make_unique<ReadGroupsNameSupport>(),
7795 make_unique<ReadGroupsClusterRevision>(),
7798 commands.Register(clusterName, clusterCommands);
7800 void registerClusterIdentify(Commands & commands)
7802 const char * clusterName = "Identify";
7804 commands_list clusterCommands = {
7805 make_unique<IdentifyIdentify>(), make_unique<IdentifyIdentifyQuery>(),
7806 make_unique<DiscoverIdentifyAttributes>(), make_unique<ReadIdentifyIdentifyTime>(),
7807 make_unique<WriteIdentifyIdentifyTime>(), make_unique<ReadIdentifyClusterRevision>(),
7810 commands.Register(clusterName, clusterCommands);
7812 void registerClusterLevelControl(Commands & commands)
7814 const char * clusterName = "LevelControl";
7816 commands_list clusterCommands = {
7817 make_unique<LevelControlMove>(),
7818 make_unique<LevelControlMoveToLevel>(),
7819 make_unique<LevelControlMoveToLevelWithOnOff>(),
7820 make_unique<LevelControlMoveWithOnOff>(),
7821 make_unique<LevelControlStep>(),
7822 make_unique<LevelControlStepWithOnOff>(),
7823 make_unique<LevelControlStop>(),
7824 make_unique<LevelControlStopWithOnOff>(),
7825 make_unique<DiscoverLevelControlAttributes>(),
7826 make_unique<ReadLevelControlCurrentLevel>(),
7827 make_unique<ReportLevelControlCurrentLevel>(),
7828 make_unique<ReadLevelControlClusterRevision>(),
7831 commands.Register(clusterName, clusterCommands);
7833 void registerClusterLowPower(Commands & commands)
7835 const char * clusterName = "LowPower";
7837 commands_list clusterCommands = {
7838 make_unique<LowPowerSleep>(),
7839 make_unique<DiscoverLowPowerAttributes>(),
7840 make_unique<ReadLowPowerClusterRevision>(),
7843 commands.Register(clusterName, clusterCommands);
7845 void registerClusterMediaPlayback(Commands & commands)
7847 const char * clusterName = "MediaPlayback";
7849 commands_list clusterCommands = {
7850 make_unique<MediaPlaybackFastForwardRequest>(), make_unique<MediaPlaybackNextRequest>(),
7851 make_unique<MediaPlaybackPauseRequest>(), make_unique<MediaPlaybackPlayRequest>(),
7852 make_unique<MediaPlaybackPreviousRequest>(), make_unique<MediaPlaybackRewindRequest>(),
7853 make_unique<MediaPlaybackSkipBackwardRequest>(), make_unique<MediaPlaybackSkipForwardRequest>(),
7854 make_unique<MediaPlaybackStartOverRequest>(), make_unique<MediaPlaybackStopRequest>(),
7855 make_unique<DiscoverMediaPlaybackAttributes>(), make_unique<ReadMediaPlaybackCurrentState>(),
7856 make_unique<ReadMediaPlaybackClusterRevision>(),
7859 commands.Register(clusterName, clusterCommands);
7861 void registerClusterOnOff(Commands & commands)
7863 const char * clusterName = "OnOff";
7865 commands_list clusterCommands = {
7866 make_unique<OnOffOff>(),
7867 make_unique<OnOffOn>(),
7868 make_unique<OnOffToggle>(),
7869 make_unique<DiscoverOnOffAttributes>(),
7870 make_unique<ReadOnOffOnOff>(),
7871 make_unique<ReportOnOffOnOff>(),
7872 make_unique<ReadOnOffClusterRevision>(),
7875 commands.Register(clusterName, clusterCommands);
7877 void registerClusterScenes(Commands & commands)
7879 const char * clusterName = "Scenes";
7881 commands_list clusterCommands = {
7882 make_unique<ScenesAddScene>(), make_unique<ScenesGetSceneMembership>(), make_unique<ScenesRecallScene>(),
7883 make_unique<ScenesRemoveAllScenes>(), make_unique<ScenesRemoveScene>(), make_unique<ScenesStoreScene>(),
7884 make_unique<ScenesViewScene>(), make_unique<DiscoverScenesAttributes>(), make_unique<ReadScenesSceneCount>(),
7885 make_unique<ReadScenesCurrentScene>(), make_unique<ReadScenesCurrentGroup>(), make_unique<ReadScenesSceneValid>(),
7886 make_unique<ReadScenesNameSupport>(), make_unique<ReadScenesClusterRevision>(),
7889 commands.Register(clusterName, clusterCommands);
7891 void registerClusterTemperatureMeasurement(Commands & commands)
7893 const char * clusterName = "TemperatureMeasurement";
7895 commands_list clusterCommands = {
7896 make_unique<DiscoverTemperatureMeasurementAttributes>(), make_unique<ReadTemperatureMeasurementMeasuredValue>(),
7897 make_unique<ReportTemperatureMeasurementMeasuredValue>(), make_unique<ReadTemperatureMeasurementMinMeasuredValue>(),
7898 make_unique<ReadTemperatureMeasurementMaxMeasuredValue>(), make_unique<ReadTemperatureMeasurementClusterRevision>(),
7901 commands.Register(clusterName, clusterCommands);
7904 void registerClusters(Commands & commands)
7906 registerClusterApplicationBasic(commands);
7907 registerClusterBarrierControl(commands);
7908 registerClusterBasic(commands);
7909 registerClusterBinding(commands);
7910 registerClusterColorControl(commands);
7911 registerClusterContentLaunch(commands);
7912 registerClusterDoorLock(commands);
7913 registerClusterGeneralCommissioning(commands);
7914 registerClusterGroups(commands);
7915 registerClusterIdentify(commands);
7916 registerClusterLevelControl(commands);
7917 registerClusterLowPower(commands);
7918 registerClusterMediaPlayback(commands);
7919 registerClusterOnOff(commands);
7920 registerClusterScenes(commands);
7921 registerClusterTemperatureMeasurement(commands);