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 OnDoorLockClusterClearAllPinsResponse(void * context)
108 ChipLogProgress(chipTool, "DoorLockClusterClearAllPinsResponse");
110 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
111 command->SetCommandExitStatus(true);
114 static void OnDoorLockClusterClearAllRfidsResponse(void * context)
116 ChipLogProgress(chipTool, "DoorLockClusterClearAllRfidsResponse");
118 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
119 command->SetCommandExitStatus(true);
122 static void OnDoorLockClusterClearHolidayScheduleResponse(void * context)
124 ChipLogProgress(chipTool, "DoorLockClusterClearHolidayScheduleResponse");
126 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
127 command->SetCommandExitStatus(true);
130 static void OnDoorLockClusterClearPinResponse(void * context)
132 ChipLogProgress(chipTool, "DoorLockClusterClearPinResponse");
134 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
135 command->SetCommandExitStatus(true);
138 static void OnDoorLockClusterClearRfidResponse(void * context)
140 ChipLogProgress(chipTool, "DoorLockClusterClearRfidResponse");
142 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
143 command->SetCommandExitStatus(true);
146 static void OnDoorLockClusterClearWeekdayScheduleResponse(void * context)
148 ChipLogProgress(chipTool, "DoorLockClusterClearWeekdayScheduleResponse");
150 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
151 command->SetCommandExitStatus(true);
154 static void OnDoorLockClusterClearYeardayScheduleResponse(void * context)
156 ChipLogProgress(chipTool, "DoorLockClusterClearYeardayScheduleResponse");
158 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
159 command->SetCommandExitStatus(true);
162 static void OnDoorLockClusterGetHolidayScheduleResponse(void * context, uint8_t scheduleId, uint32_t localStartTime,
163 uint32_t localEndTime, uint8_t operatingModeDuringHoliday)
165 ChipLogProgress(chipTool, "DoorLockClusterGetHolidayScheduleResponse");
167 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
168 command->SetCommandExitStatus(true);
171 static void OnDoorLockClusterGetLogRecordResponse(void * context, uint16_t logEntryId, uint32_t timestamp, uint8_t eventType,
172 uint8_t source, uint8_t eventIdOrAlarmCode, uint16_t userId, uint8_t * pin)
174 ChipLogProgress(chipTool, "DoorLockClusterGetLogRecordResponse");
176 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
177 command->SetCommandExitStatus(true);
180 static void OnDoorLockClusterGetPinResponse(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * pin)
182 ChipLogProgress(chipTool, "DoorLockClusterGetPinResponse");
184 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
185 command->SetCommandExitStatus(true);
188 static void OnDoorLockClusterGetRfidResponse(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * rfid)
190 ChipLogProgress(chipTool, "DoorLockClusterGetRfidResponse");
192 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
193 command->SetCommandExitStatus(true);
196 static void OnDoorLockClusterGetUserTypeResponse(void * context, uint16_t userId, uint8_t userType)
198 ChipLogProgress(chipTool, "DoorLockClusterGetUserTypeResponse");
200 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
201 command->SetCommandExitStatus(true);
204 static void OnDoorLockClusterGetWeekdayScheduleResponse(void * context, uint8_t scheduleId, uint16_t userId, uint8_t daysMask,
205 uint8_t startHour, uint8_t startMinute, uint8_t endHour, uint8_t endMinute)
207 ChipLogProgress(chipTool, "DoorLockClusterGetWeekdayScheduleResponse");
209 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
210 command->SetCommandExitStatus(true);
213 static void OnDoorLockClusterGetYeardayScheduleResponse(void * context, uint8_t scheduleId, uint16_t userId,
214 uint32_t localStartTime, uint32_t localEndTime)
216 ChipLogProgress(chipTool, "DoorLockClusterGetYeardayScheduleResponse");
218 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
219 command->SetCommandExitStatus(true);
222 static void OnDoorLockClusterLockDoorResponse(void * context)
224 ChipLogProgress(chipTool, "DoorLockClusterLockDoorResponse");
226 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
227 command->SetCommandExitStatus(true);
230 static void OnDoorLockClusterSetHolidayScheduleResponse(void * context)
232 ChipLogProgress(chipTool, "DoorLockClusterSetHolidayScheduleResponse");
234 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
235 command->SetCommandExitStatus(true);
238 static void OnDoorLockClusterSetPinResponse(void * context)
240 ChipLogProgress(chipTool, "DoorLockClusterSetPinResponse");
242 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
243 command->SetCommandExitStatus(true);
246 static void OnDoorLockClusterSetRfidResponse(void * context)
248 ChipLogProgress(chipTool, "DoorLockClusterSetRfidResponse");
250 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
251 command->SetCommandExitStatus(true);
254 static void OnDoorLockClusterSetUserTypeResponse(void * context)
256 ChipLogProgress(chipTool, "DoorLockClusterSetUserTypeResponse");
258 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
259 command->SetCommandExitStatus(true);
262 static void OnDoorLockClusterSetWeekdayScheduleResponse(void * context)
264 ChipLogProgress(chipTool, "DoorLockClusterSetWeekdayScheduleResponse");
266 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
267 command->SetCommandExitStatus(true);
270 static void OnDoorLockClusterSetYeardayScheduleResponse(void * context)
272 ChipLogProgress(chipTool, "DoorLockClusterSetYeardayScheduleResponse");
274 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
275 command->SetCommandExitStatus(true);
278 static void OnDoorLockClusterUnlockDoorResponse(void * context)
280 ChipLogProgress(chipTool, "DoorLockClusterUnlockDoorResponse");
282 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
283 command->SetCommandExitStatus(true);
286 static void OnDoorLockClusterUnlockWithTimeoutResponse(void * context)
288 ChipLogProgress(chipTool, "DoorLockClusterUnlockWithTimeoutResponse");
290 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
291 command->SetCommandExitStatus(true);
294 static void OnGeneralCommissioningClusterArmFailSafeResponse(void * context, uint8_t errorCode, uint8_t * debugText)
296 ChipLogProgress(chipTool, "GeneralCommissioningClusterArmFailSafeResponse");
298 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
299 command->SetCommandExitStatus(true);
302 static void OnGeneralCommissioningClusterCommissioningCompleteResponse(void * context, uint8_t errorCode, uint8_t * debugText)
304 ChipLogProgress(chipTool, "GeneralCommissioningClusterCommissioningCompleteResponse");
306 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
307 command->SetCommandExitStatus(true);
310 static void OnGeneralCommissioningClusterSetFabricResponse(void * context, uint8_t errorCode, uint8_t * debugText)
312 ChipLogProgress(chipTool, "GeneralCommissioningClusterSetFabricResponse");
314 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
315 command->SetCommandExitStatus(true);
318 static void OnGroupsClusterAddGroupResponse(void * context, uint16_t groupId)
320 ChipLogProgress(chipTool, "GroupsClusterAddGroupResponse");
322 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
323 command->SetCommandExitStatus(true);
326 static void OnGroupsClusterGetGroupMembershipResponse(void * context, uint8_t capacity, uint8_t groupCount,
327 /* TYPE WARNING: array array defaults to */ uint8_t * groupList)
329 ChipLogProgress(chipTool, "GroupsClusterGetGroupMembershipResponse");
331 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
332 command->SetCommandExitStatus(true);
335 static void OnGroupsClusterRemoveGroupResponse(void * context, uint16_t groupId)
337 ChipLogProgress(chipTool, "GroupsClusterRemoveGroupResponse");
339 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
340 command->SetCommandExitStatus(true);
343 static void OnGroupsClusterViewGroupResponse(void * context, uint16_t groupId, uint8_t * groupName)
345 ChipLogProgress(chipTool, "GroupsClusterViewGroupResponse");
347 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
348 command->SetCommandExitStatus(true);
351 static void OnIdentifyClusterIdentifyQueryResponse(void * context, uint16_t timeout)
353 ChipLogProgress(chipTool, "IdentifyClusterIdentifyQueryResponse");
355 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
356 command->SetCommandExitStatus(true);
359 static void OnScenesClusterAddSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
361 ChipLogProgress(chipTool, "ScenesClusterAddSceneResponse");
363 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
364 command->SetCommandExitStatus(true);
367 static void OnScenesClusterGetSceneMembershipResponse(void * context, uint8_t capacity, uint16_t groupId, uint8_t sceneCount,
368 /* TYPE WARNING: array array defaults to */ uint8_t * sceneList)
370 ChipLogProgress(chipTool, "ScenesClusterGetSceneMembershipResponse");
372 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
373 command->SetCommandExitStatus(true);
376 static void OnScenesClusterRemoveAllScenesResponse(void * context, uint16_t groupId)
378 ChipLogProgress(chipTool, "ScenesClusterRemoveAllScenesResponse");
380 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
381 command->SetCommandExitStatus(true);
384 static void OnScenesClusterRemoveSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
386 ChipLogProgress(chipTool, "ScenesClusterRemoveSceneResponse");
388 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
389 command->SetCommandExitStatus(true);
392 static void OnScenesClusterStoreSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
394 ChipLogProgress(chipTool, "ScenesClusterStoreSceneResponse");
396 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
397 command->SetCommandExitStatus(true);
400 static void OnScenesClusterViewSceneResponse(void * context, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime,
402 /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets)
404 ChipLogProgress(chipTool, "ScenesClusterViewSceneResponse");
406 ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
407 command->SetCommandExitStatus(true);
410 /*----------------------------------------------------------------------------*\
411 | Cluster Name | ID |
412 |---------------------------------------------------------------------+--------|
413 | ApplicationBasic | 0x050D |
414 | BarrierControl | 0x0103 |
417 | ColorControl | 0x0300 |
418 | DoorLock | 0x0101 |
419 | GeneralCommissioning | 0x0030 |
421 | Identify | 0x0003 |
422 | LevelControl | 0x0008 |
423 | LowPower | 0x0508 |
426 | TemperatureMeasurement | 0x0402 |
427 \*----------------------------------------------------------------------------*/
429 constexpr chip::ClusterId kApplicationBasicClusterId = 0x050D;
430 constexpr chip::ClusterId kBarrierControlClusterId = 0x0103;
431 constexpr chip::ClusterId kBasicClusterId = 0x0028;
432 constexpr chip::ClusterId kBindingClusterId = 0xF000;
433 constexpr chip::ClusterId kColorControlClusterId = 0x0300;
434 constexpr chip::ClusterId kDoorLockClusterId = 0x0101;
435 constexpr chip::ClusterId kGeneralCommissioningClusterId = 0x0030;
436 constexpr chip::ClusterId kGroupsClusterId = 0x0004;
437 constexpr chip::ClusterId kIdentifyClusterId = 0x0003;
438 constexpr chip::ClusterId kLevelControlClusterId = 0x0008;
439 constexpr chip::ClusterId kLowPowerClusterId = 0x0508;
440 constexpr chip::ClusterId kOnOffClusterId = 0x0006;
441 constexpr chip::ClusterId kScenesClusterId = 0x0005;
442 constexpr chip::ClusterId kTemperatureMeasurementClusterId = 0x0402;
444 /*----------------------------------------------------------------------------*\
445 | Cluster ApplicationBasic | 0x050D |
446 |------------------------------------------------------------------------------|
448 |------------------------------------------------------------------------------|
450 | * VendorName | 0x0000 |
451 | * VendorId | 0x0001 |
452 | * ApplicationName | 0x0002 |
453 | * ProductId | 0x0003 |
454 | * ApplicationId | 0x0005 |
455 | * CatalogVendorId | 0x0006 |
456 | * ApplicationSatus | 0x0007 |
457 | * ClusterRevision | 0xFFFD |
458 \*----------------------------------------------------------------------------*/
461 * Discover Attributes
463 class DiscoverApplicationBasicAttributes : public ModelCommand
466 DiscoverApplicationBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
468 ~DiscoverApplicationBasicAttributes()
470 delete onSuccessCallback;
471 delete onFailureCallback;
474 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
476 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
478 chip::Controller::ApplicationBasicCluster cluster;
479 cluster.Associate(device, endpointId);
480 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
484 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
485 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
486 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
487 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
491 * Attribute VendorName
493 class ReadApplicationBasicVendorName : public ModelCommand
496 ReadApplicationBasicVendorName() : ModelCommand("read")
498 AddArgument("attr-name", "vendor-name");
499 ModelCommand::AddArguments();
502 ~ReadApplicationBasicVendorName()
504 delete onSuccessCallback;
505 delete onFailureCallback;
508 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
510 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
512 chip::Controller::ApplicationBasicCluster cluster;
513 cluster.Associate(device, endpointId);
514 return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
518 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
519 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
520 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
521 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
527 class ReadApplicationBasicVendorId : public ModelCommand
530 ReadApplicationBasicVendorId() : ModelCommand("read")
532 AddArgument("attr-name", "vendor-id");
533 ModelCommand::AddArguments();
536 ~ReadApplicationBasicVendorId()
538 delete onSuccessCallback;
539 delete onFailureCallback;
542 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
544 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
546 chip::Controller::ApplicationBasicCluster cluster;
547 cluster.Associate(device, endpointId);
548 return cluster.ReadAttributeVendorId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
552 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
553 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
554 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
555 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
559 * Attribute ApplicationName
561 class ReadApplicationBasicApplicationName : public ModelCommand
564 ReadApplicationBasicApplicationName() : ModelCommand("read")
566 AddArgument("attr-name", "application-name");
567 ModelCommand::AddArguments();
570 ~ReadApplicationBasicApplicationName()
572 delete onSuccessCallback;
573 delete onFailureCallback;
576 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
578 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
580 chip::Controller::ApplicationBasicCluster cluster;
581 cluster.Associate(device, endpointId);
582 return cluster.ReadAttributeApplicationName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
586 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
587 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
588 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
589 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
593 * Attribute ProductId
595 class ReadApplicationBasicProductId : public ModelCommand
598 ReadApplicationBasicProductId() : ModelCommand("read")
600 AddArgument("attr-name", "product-id");
601 ModelCommand::AddArguments();
604 ~ReadApplicationBasicProductId()
606 delete onSuccessCallback;
607 delete onFailureCallback;
610 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
612 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
614 chip::Controller::ApplicationBasicCluster cluster;
615 cluster.Associate(device, endpointId);
616 return cluster.ReadAttributeProductId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
620 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
621 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
622 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
623 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
627 * Attribute ApplicationId
629 class ReadApplicationBasicApplicationId : public ModelCommand
632 ReadApplicationBasicApplicationId() : ModelCommand("read")
634 AddArgument("attr-name", "application-id");
635 ModelCommand::AddArguments();
638 ~ReadApplicationBasicApplicationId()
640 delete onSuccessCallback;
641 delete onFailureCallback;
644 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
646 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
648 chip::Controller::ApplicationBasicCluster cluster;
649 cluster.Associate(device, endpointId);
650 return cluster.ReadAttributeApplicationId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
654 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
655 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
656 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
657 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
661 * Attribute CatalogVendorId
663 class ReadApplicationBasicCatalogVendorId : public ModelCommand
666 ReadApplicationBasicCatalogVendorId() : ModelCommand("read")
668 AddArgument("attr-name", "catalog-vendor-id");
669 ModelCommand::AddArguments();
672 ~ReadApplicationBasicCatalogVendorId()
674 delete onSuccessCallback;
675 delete onFailureCallback;
678 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
680 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
682 chip::Controller::ApplicationBasicCluster cluster;
683 cluster.Associate(device, endpointId);
684 return cluster.ReadAttributeCatalogVendorId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
688 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
689 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
690 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
691 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
695 * Attribute ApplicationSatus
697 class ReadApplicationBasicApplicationSatus : public ModelCommand
700 ReadApplicationBasicApplicationSatus() : ModelCommand("read")
702 AddArgument("attr-name", "application-satus");
703 ModelCommand::AddArguments();
706 ~ReadApplicationBasicApplicationSatus()
708 delete onSuccessCallback;
709 delete onFailureCallback;
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.ReadAttributeApplicationSatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
722 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
723 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
724 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
725 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
729 * Attribute ClusterRevision
731 class ReadApplicationBasicClusterRevision : public ModelCommand
734 ReadApplicationBasicClusterRevision() : ModelCommand("read")
736 AddArgument("attr-name", "cluster-revision");
737 ModelCommand::AddArguments();
740 ~ReadApplicationBasicClusterRevision()
742 delete onSuccessCallback;
743 delete onFailureCallback;
746 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
748 ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);
750 chip::Controller::ApplicationBasicCluster cluster;
751 cluster.Associate(device, endpointId);
752 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
756 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
757 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
758 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
759 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
762 /*----------------------------------------------------------------------------*\
763 | Cluster BarrierControl | 0x0103 |
764 |------------------------------------------------------------------------------|
766 | * BarrierControlGoToPercent | 0x00 |
767 | * BarrierControlStop | 0x01 |
768 |------------------------------------------------------------------------------|
770 | * BarrierMovingState | 0x0001 |
771 | * BarrierSafetyStatus | 0x0002 |
772 | * BarrierCapabilities | 0x0003 |
773 | * BarrierPosition | 0x000A |
774 | * ClusterRevision | 0xFFFD |
775 \*----------------------------------------------------------------------------*/
778 * Command BarrierControlGoToPercent
780 class BarrierControlBarrierControlGoToPercent : public ModelCommand
783 BarrierControlBarrierControlGoToPercent() : ModelCommand("barrier-control-go-to-percent")
785 AddArgument("percentOpen", 0, UINT8_MAX, &mPercentOpen);
786 ModelCommand::AddArguments();
788 ~BarrierControlBarrierControlGoToPercent()
790 delete onSuccessCallback;
791 delete onFailureCallback;
794 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
796 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
798 chip::Controller::BarrierControlCluster cluster;
799 cluster.Associate(device, endpointId);
800 return cluster.BarrierControlGoToPercent(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPercentOpen);
804 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
805 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
806 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
807 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
808 uint8_t mPercentOpen;
812 * Command BarrierControlStop
814 class BarrierControlBarrierControlStop : public ModelCommand
817 BarrierControlBarrierControlStop() : ModelCommand("barrier-control-stop") { ModelCommand::AddArguments(); }
818 ~BarrierControlBarrierControlStop()
820 delete onSuccessCallback;
821 delete onFailureCallback;
824 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
826 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x01) on endpoint %" PRIu16, endpointId);
828 chip::Controller::BarrierControlCluster cluster;
829 cluster.Associate(device, endpointId);
830 return cluster.BarrierControlStop(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
834 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
835 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
836 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
837 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
841 * Discover Attributes
843 class DiscoverBarrierControlAttributes : public ModelCommand
846 DiscoverBarrierControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
848 ~DiscoverBarrierControlAttributes()
850 delete onSuccessCallback;
851 delete onFailureCallback;
854 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
856 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
858 chip::Controller::BarrierControlCluster cluster;
859 cluster.Associate(device, endpointId);
860 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
864 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
865 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
866 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
867 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
871 * Attribute BarrierMovingState
873 class ReadBarrierControlBarrierMovingState : public ModelCommand
876 ReadBarrierControlBarrierMovingState() : ModelCommand("read")
878 AddArgument("attr-name", "barrier-moving-state");
879 ModelCommand::AddArguments();
882 ~ReadBarrierControlBarrierMovingState()
884 delete onSuccessCallback;
885 delete onFailureCallback;
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.ReadAttributeBarrierMovingState(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 BarrierSafetyStatus
907 class ReadBarrierControlBarrierSafetyStatus : public ModelCommand
910 ReadBarrierControlBarrierSafetyStatus() : ModelCommand("read")
912 AddArgument("attr-name", "barrier-safety-status");
913 ModelCommand::AddArguments();
916 ~ReadBarrierControlBarrierSafetyStatus()
918 delete onSuccessCallback;
919 delete onFailureCallback;
922 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
924 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
926 chip::Controller::BarrierControlCluster cluster;
927 cluster.Associate(device, endpointId);
928 return cluster.ReadAttributeBarrierSafetyStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
932 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
933 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
934 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
935 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
939 * Attribute BarrierCapabilities
941 class ReadBarrierControlBarrierCapabilities : public ModelCommand
944 ReadBarrierControlBarrierCapabilities() : ModelCommand("read")
946 AddArgument("attr-name", "barrier-capabilities");
947 ModelCommand::AddArguments();
950 ~ReadBarrierControlBarrierCapabilities()
952 delete onSuccessCallback;
953 delete onFailureCallback;
956 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
958 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
960 chip::Controller::BarrierControlCluster cluster;
961 cluster.Associate(device, endpointId);
962 return cluster.ReadAttributeBarrierCapabilities(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
966 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
967 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
968 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
969 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
973 * Attribute BarrierPosition
975 class ReadBarrierControlBarrierPosition : public ModelCommand
978 ReadBarrierControlBarrierPosition() : ModelCommand("read")
980 AddArgument("attr-name", "barrier-position");
981 ModelCommand::AddArguments();
984 ~ReadBarrierControlBarrierPosition()
986 delete onSuccessCallback;
987 delete onFailureCallback;
990 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
992 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
994 chip::Controller::BarrierControlCluster cluster;
995 cluster.Associate(device, endpointId);
996 return cluster.ReadAttributeBarrierPosition(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1000 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
1001 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
1002 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1003 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1007 * Attribute ClusterRevision
1009 class ReadBarrierControlClusterRevision : public ModelCommand
1012 ReadBarrierControlClusterRevision() : ModelCommand("read")
1014 AddArgument("attr-name", "cluster-revision");
1015 ModelCommand::AddArguments();
1018 ~ReadBarrierControlClusterRevision()
1020 delete onSuccessCallback;
1021 delete onFailureCallback;
1024 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1026 ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);
1028 chip::Controller::BarrierControlCluster cluster;
1029 cluster.Associate(device, endpointId);
1030 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1034 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1035 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1036 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1037 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1040 /*----------------------------------------------------------------------------*\
1041 | Cluster Basic | 0x0028 |
1042 |------------------------------------------------------------------------------|
1044 | * MfgSpecificPing | 0x00 |
1045 |------------------------------------------------------------------------------|
1047 | * InteractionModelVersion | 0x0000 |
1048 | * VendorName | 0x0001 |
1049 | * VendorID | 0x0002 |
1050 | * ProductName | 0x0003 |
1051 | * ProductID | 0x0004 |
1052 | * UserLabel | 0x0005 |
1053 | * Location | 0x0006 |
1054 | * HardwareVersion | 0x0007 |
1055 | * HardwareVersionString | 0x0008 |
1056 | * SoftwareVersion | 0x0009 |
1057 | * SoftwareVersionString | 0x000A |
1058 | * ClusterRevision | 0xFFFD |
1059 \*----------------------------------------------------------------------------*/
1062 * Command MfgSpecificPing
1064 class BasicMfgSpecificPing : public ModelCommand
1067 BasicMfgSpecificPing() : ModelCommand("mfg-specific-ping") { ModelCommand::AddArguments(); }
1068 ~BasicMfgSpecificPing()
1070 delete onSuccessCallback;
1071 delete onFailureCallback;
1074 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1076 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1078 chip::Controller::BasicCluster cluster;
1079 cluster.Associate(device, endpointId);
1080 return cluster.MfgSpecificPing(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1084 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1085 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1086 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1087 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1091 * Discover Attributes
1093 class DiscoverBasicAttributes : public ModelCommand
1096 DiscoverBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
1098 ~DiscoverBasicAttributes()
1100 delete onSuccessCallback;
1101 delete onFailureCallback;
1104 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1106 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
1108 chip::Controller::BasicCluster cluster;
1109 cluster.Associate(device, endpointId);
1110 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1114 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1115 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1116 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1117 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1121 * Attribute InteractionModelVersion
1123 class ReadBasicInteractionModelVersion : public ModelCommand
1126 ReadBasicInteractionModelVersion() : ModelCommand("read")
1128 AddArgument("attr-name", "interaction-model-version");
1129 ModelCommand::AddArguments();
1132 ~ReadBasicInteractionModelVersion()
1134 delete onSuccessCallback;
1135 delete onFailureCallback;
1138 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1140 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1142 chip::Controller::BasicCluster cluster;
1143 cluster.Associate(device, endpointId);
1144 return cluster.ReadAttributeInteractionModelVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1148 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1149 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1150 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1151 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1155 * Attribute VendorName
1157 class ReadBasicVendorName : public ModelCommand
1160 ReadBasicVendorName() : ModelCommand("read")
1162 AddArgument("attr-name", "vendor-name");
1163 ModelCommand::AddArguments();
1166 ~ReadBasicVendorName()
1168 delete onSuccessCallback;
1169 delete onFailureCallback;
1172 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1174 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1176 chip::Controller::BasicCluster cluster;
1177 cluster.Associate(device, endpointId);
1178 return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1182 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1183 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1184 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1185 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1189 * Attribute VendorID
1191 class ReadBasicVendorID : public ModelCommand
1194 ReadBasicVendorID() : ModelCommand("read")
1196 AddArgument("attr-name", "vendor-id");
1197 ModelCommand::AddArguments();
1200 ~ReadBasicVendorID()
1202 delete onSuccessCallback;
1203 delete onFailureCallback;
1206 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1208 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1210 chip::Controller::BasicCluster cluster;
1211 cluster.Associate(device, endpointId);
1212 return cluster.ReadAttributeVendorID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1216 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1217 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1218 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1219 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1223 * Attribute ProductName
1225 class ReadBasicProductName : public ModelCommand
1228 ReadBasicProductName() : ModelCommand("read")
1230 AddArgument("attr-name", "product-name");
1231 ModelCommand::AddArguments();
1234 ~ReadBasicProductName()
1236 delete onSuccessCallback;
1237 delete onFailureCallback;
1240 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1242 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1244 chip::Controller::BasicCluster cluster;
1245 cluster.Associate(device, endpointId);
1246 return cluster.ReadAttributeProductName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1250 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1251 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1252 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1253 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1257 * Attribute ProductID
1259 class ReadBasicProductID : public ModelCommand
1262 ReadBasicProductID() : ModelCommand("read")
1264 AddArgument("attr-name", "product-id");
1265 ModelCommand::AddArguments();
1268 ~ReadBasicProductID()
1270 delete onSuccessCallback;
1271 delete onFailureCallback;
1274 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1276 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1278 chip::Controller::BasicCluster cluster;
1279 cluster.Associate(device, endpointId);
1280 return cluster.ReadAttributeProductID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1284 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1285 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1286 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1287 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1291 * Attribute UserLabel
1293 class ReadBasicUserLabel : public ModelCommand
1296 ReadBasicUserLabel() : ModelCommand("read")
1298 AddArgument("attr-name", "user-label");
1299 ModelCommand::AddArguments();
1302 ~ReadBasicUserLabel()
1304 delete onSuccessCallback;
1305 delete onFailureCallback;
1308 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1310 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1312 chip::Controller::BasicCluster cluster;
1313 cluster.Associate(device, endpointId);
1314 return cluster.ReadAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1318 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1319 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1320 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1321 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1324 class WriteBasicUserLabel : public ModelCommand
1327 WriteBasicUserLabel() : ModelCommand("write")
1329 AddArgument("attr-name", "user-label");
1330 AddArgument("attr-value", &mValue);
1331 ModelCommand::AddArguments();
1334 ~WriteBasicUserLabel()
1336 delete onSuccessCallback;
1337 delete onFailureCallback;
1340 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1342 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);
1344 chip::Controller::BasicCluster cluster;
1345 cluster.Associate(device, endpointId);
1346 return cluster.WriteAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
1347 chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
1351 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1352 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1353 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1354 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1359 * Attribute Location
1361 class ReadBasicLocation : public ModelCommand
1364 ReadBasicLocation() : ModelCommand("read")
1366 AddArgument("attr-name", "location");
1367 ModelCommand::AddArguments();
1370 ~ReadBasicLocation()
1372 delete onSuccessCallback;
1373 delete onFailureCallback;
1376 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1378 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1380 chip::Controller::BasicCluster cluster;
1381 cluster.Associate(device, endpointId);
1382 return cluster.ReadAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1386 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1387 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1388 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1389 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1392 class WriteBasicLocation : public ModelCommand
1395 WriteBasicLocation() : ModelCommand("write")
1397 AddArgument("attr-name", "location");
1398 AddArgument("attr-value", &mValue);
1399 ModelCommand::AddArguments();
1402 ~WriteBasicLocation()
1404 delete onSuccessCallback;
1405 delete onFailureCallback;
1408 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1410 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);
1412 chip::Controller::BasicCluster cluster;
1413 cluster.Associate(device, endpointId);
1414 return cluster.WriteAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
1415 chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
1419 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1420 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1421 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1422 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1427 * Attribute HardwareVersion
1429 class ReadBasicHardwareVersion : public ModelCommand
1432 ReadBasicHardwareVersion() : ModelCommand("read")
1434 AddArgument("attr-name", "hardware-version");
1435 ModelCommand::AddArguments();
1438 ~ReadBasicHardwareVersion()
1440 delete onSuccessCallback;
1441 delete onFailureCallback;
1444 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1446 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1448 chip::Controller::BasicCluster cluster;
1449 cluster.Associate(device, endpointId);
1450 return cluster.ReadAttributeHardwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1454 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1455 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1456 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1457 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1461 * Attribute HardwareVersionString
1463 class ReadBasicHardwareVersionString : public ModelCommand
1466 ReadBasicHardwareVersionString() : ModelCommand("read")
1468 AddArgument("attr-name", "hardware-version-string");
1469 ModelCommand::AddArguments();
1472 ~ReadBasicHardwareVersionString()
1474 delete onSuccessCallback;
1475 delete onFailureCallback;
1478 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1480 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1482 chip::Controller::BasicCluster cluster;
1483 cluster.Associate(device, endpointId);
1484 return cluster.ReadAttributeHardwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1488 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1489 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1490 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1491 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1495 * Attribute SoftwareVersion
1497 class ReadBasicSoftwareVersion : public ModelCommand
1500 ReadBasicSoftwareVersion() : ModelCommand("read")
1502 AddArgument("attr-name", "software-version");
1503 ModelCommand::AddArguments();
1506 ~ReadBasicSoftwareVersion()
1508 delete onSuccessCallback;
1509 delete onFailureCallback;
1512 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1514 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1516 chip::Controller::BasicCluster cluster;
1517 cluster.Associate(device, endpointId);
1518 return cluster.ReadAttributeSoftwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1522 chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
1523 new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
1524 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1525 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1529 * Attribute SoftwareVersionString
1531 class ReadBasicSoftwareVersionString : public ModelCommand
1534 ReadBasicSoftwareVersionString() : ModelCommand("read")
1536 AddArgument("attr-name", "software-version-string");
1537 ModelCommand::AddArguments();
1540 ~ReadBasicSoftwareVersionString()
1542 delete onSuccessCallback;
1543 delete onFailureCallback;
1546 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1548 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1550 chip::Controller::BasicCluster cluster;
1551 cluster.Associate(device, endpointId);
1552 return cluster.ReadAttributeSoftwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1556 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
1557 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
1558 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1559 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1563 * Attribute ClusterRevision
1565 class ReadBasicClusterRevision : public ModelCommand
1568 ReadBasicClusterRevision() : ModelCommand("read")
1570 AddArgument("attr-name", "cluster-revision");
1571 ModelCommand::AddArguments();
1574 ~ReadBasicClusterRevision()
1576 delete onSuccessCallback;
1577 delete onFailureCallback;
1580 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1582 ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);
1584 chip::Controller::BasicCluster cluster;
1585 cluster.Associate(device, endpointId);
1586 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1590 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1591 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1592 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1593 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1596 /*----------------------------------------------------------------------------*\
1597 | Cluster Binding | 0xF000 |
1598 |------------------------------------------------------------------------------|
1602 |------------------------------------------------------------------------------|
1604 | * ClusterRevision | 0xFFFD |
1605 \*----------------------------------------------------------------------------*/
1610 class BindingBind : public ModelCommand
1613 BindingBind() : ModelCommand("bind")
1615 AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
1616 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
1617 AddArgument("endpointId", 0, UINT8_MAX, &mEndpointId);
1618 AddArgument("clusterId", 0, UINT16_MAX, &mClusterId);
1619 ModelCommand::AddArguments();
1623 delete onSuccessCallback;
1624 delete onFailureCallback;
1627 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1629 ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x00) on endpoint %" PRIu16, endpointId);
1631 chip::Controller::BindingCluster cluster;
1632 cluster.Associate(device, endpointId);
1633 return cluster.Bind(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNodeId, mGroupId, mEndpointId, mClusterId);
1637 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1638 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1639 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1640 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1641 chip::NodeId mNodeId;
1642 chip::GroupId mGroupId;
1643 chip::EndpointId mEndpointId;
1644 chip::ClusterId mClusterId;
1650 class BindingUnbind : public ModelCommand
1653 BindingUnbind() : ModelCommand("unbind")
1655 AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
1656 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
1657 AddArgument("endpointId", 0, UINT8_MAX, &mEndpointId);
1658 AddArgument("clusterId", 0, UINT16_MAX, &mClusterId);
1659 ModelCommand::AddArguments();
1663 delete onSuccessCallback;
1664 delete onFailureCallback;
1667 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1669 ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x01) on endpoint %" PRIu16, endpointId);
1671 chip::Controller::BindingCluster cluster;
1672 cluster.Associate(device, endpointId);
1673 return cluster.Unbind(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNodeId, mGroupId, mEndpointId, mClusterId);
1677 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1678 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1679 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1680 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1681 chip::NodeId mNodeId;
1682 chip::GroupId mGroupId;
1683 chip::EndpointId mEndpointId;
1684 chip::ClusterId mClusterId;
1688 * Discover Attributes
1690 class DiscoverBindingAttributes : public ModelCommand
1693 DiscoverBindingAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
1695 ~DiscoverBindingAttributes()
1697 delete onSuccessCallback;
1698 delete onFailureCallback;
1701 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1703 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
1705 chip::Controller::BindingCluster cluster;
1706 cluster.Associate(device, endpointId);
1707 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1711 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1712 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1713 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1714 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1718 * Attribute ClusterRevision
1720 class ReadBindingClusterRevision : public ModelCommand
1723 ReadBindingClusterRevision() : ModelCommand("read")
1725 AddArgument("attr-name", "cluster-revision");
1726 ModelCommand::AddArguments();
1729 ~ReadBindingClusterRevision()
1731 delete onSuccessCallback;
1732 delete onFailureCallback;
1735 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1737 ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x00) on endpoint %" PRIu16, endpointId);
1739 chip::Controller::BindingCluster cluster;
1740 cluster.Associate(device, endpointId);
1741 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
1745 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
1746 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
1747 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1748 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1751 /*----------------------------------------------------------------------------*\
1752 | Cluster ColorControl | 0x0300 |
1753 |------------------------------------------------------------------------------|
1755 | * MoveColor | 0x08 |
1756 | * MoveColorTemperature | 0x4B |
1757 | * MoveHue | 0x01 |
1758 | * MoveSaturation | 0x04 |
1759 | * MoveToColor | 0x07 |
1760 | * MoveToColorTemperature | 0x0A |
1761 | * MoveToHue | 0x00 |
1762 | * MoveToHueAndSaturation | 0x06 |
1763 | * MoveToSaturation | 0x03 |
1764 | * StepColor | 0x09 |
1765 | * StepColorTemperature | 0x4C |
1766 | * StepHue | 0x02 |
1767 | * StepSaturation | 0x05 |
1768 | * StopMoveStep | 0x47 |
1769 |------------------------------------------------------------------------------|
1771 | * CurrentHue | 0x0000 |
1772 | * CurrentSaturation | 0x0001 |
1773 | * RemainingTime | 0x0002 |
1774 | * CurrentX | 0x0003 |
1775 | * CurrentY | 0x0004 |
1776 | * DriftCompensation | 0x0005 |
1777 | * CompensationText | 0x0006 |
1778 | * ColorTemperature | 0x0007 |
1779 | * ColorMode | 0x0008 |
1780 | * ColorControlOptions | 0x000F |
1781 | * NumberOfPrimaries | 0x0010 |
1782 | * Primary1X | 0x0011 |
1783 | * Primary1Y | 0x0012 |
1784 | * Primary1Intensity | 0x0013 |
1785 | * Primary2X | 0x0015 |
1786 | * Primary2Y | 0x0016 |
1787 | * Primary2Intensity | 0x0017 |
1788 | * Primary3X | 0x0019 |
1789 | * Primary3Y | 0x001A |
1790 | * Primary3Intensity | 0x001B |
1791 | * Primary4X | 0x0020 |
1792 | * Primary4Y | 0x0021 |
1793 | * Primary4Intensity | 0x0022 |
1794 | * Primary5X | 0x0024 |
1795 | * Primary5Y | 0x0025 |
1796 | * Primary5Intensity | 0x0026 |
1797 | * Primary6X | 0x0028 |
1798 | * Primary6Y | 0x0029 |
1799 | * Primary6Intensity | 0x002A |
1800 | * WhitePointX | 0x0030 |
1801 | * WhitePointY | 0x0031 |
1802 | * ColorPointRX | 0x0032 |
1803 | * ColorPointRY | 0x0033 |
1804 | * ColorPointRIntensity | 0x0034 |
1805 | * ColorPointGX | 0x0036 |
1806 | * ColorPointGY | 0x0037 |
1807 | * ColorPointGIntensity | 0x0038 |
1808 | * ColorPointBX | 0x003A |
1809 | * ColorPointBY | 0x003B |
1810 | * ColorPointBIntensity | 0x003C |
1811 | * EnhancedCurrentHue | 0x4000 |
1812 | * EnhancedColorMode | 0x4001 |
1813 | * ColorLoopActive | 0x4002 |
1814 | * ColorLoopDirection | 0x4003 |
1815 | * ColorLoopTime | 0x4004 |
1816 | * ColorCapabilities | 0x400A |
1817 | * ColorTempPhysicalMin | 0x400B |
1818 | * ColorTempPhysicalMax | 0x400C |
1819 | * CoupleColorTempToLevelMinMireds | 0x400D |
1820 | * StartUpColorTemperatureMireds | 0x4010 |
1821 | * ClusterRevision | 0xFFFD |
1822 \*----------------------------------------------------------------------------*/
1827 class ColorControlMoveColor : public ModelCommand
1830 ColorControlMoveColor() : ModelCommand("move-color")
1832 AddArgument("rateX", INT16_MIN, INT16_MAX, &mRateX);
1833 AddArgument("rateY", INT16_MIN, INT16_MAX, &mRateY);
1834 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1835 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1836 ModelCommand::AddArguments();
1838 ~ColorControlMoveColor()
1840 delete onSuccessCallback;
1841 delete onFailureCallback;
1844 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1846 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x08) on endpoint %" PRIu16, endpointId);
1848 chip::Controller::ColorControlCluster cluster;
1849 cluster.Associate(device, endpointId);
1850 return cluster.MoveColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mRateX, mRateY, mOptionsMask,
1855 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1856 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1857 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1858 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1861 uint8_t mOptionsMask;
1862 uint8_t mOptionsOverride;
1866 * Command MoveColorTemperature
1868 class ColorControlMoveColorTemperature : public ModelCommand
1871 ColorControlMoveColorTemperature() : ModelCommand("move-color-temperature")
1873 AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
1874 AddArgument("rate", 0, UINT16_MAX, &mRate);
1875 AddArgument("colorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum);
1876 AddArgument("colorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum);
1877 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1878 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1879 ModelCommand::AddArguments();
1881 ~ColorControlMoveColorTemperature()
1883 delete onSuccessCallback;
1884 delete onFailureCallback;
1887 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1889 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x4B) on endpoint %" PRIu16, endpointId);
1891 chip::Controller::ColorControlCluster cluster;
1892 cluster.Associate(device, endpointId);
1893 return cluster.MoveColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate,
1894 mColorTemperatureMinimum, mColorTemperatureMaximum, mOptionsMask, mOptionsOverride);
1898 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1899 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1900 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1901 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1904 uint16_t mColorTemperatureMinimum;
1905 uint16_t mColorTemperatureMaximum;
1906 uint8_t mOptionsMask;
1907 uint8_t mOptionsOverride;
1913 class ColorControlMoveHue : public ModelCommand
1916 ColorControlMoveHue() : ModelCommand("move-hue")
1918 AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
1919 AddArgument("rate", 0, UINT8_MAX, &mRate);
1920 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1921 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1922 ModelCommand::AddArguments();
1924 ~ColorControlMoveHue()
1926 delete onSuccessCallback;
1927 delete onFailureCallback;
1930 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1932 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
1934 chip::Controller::ColorControlCluster cluster;
1935 cluster.Associate(device, endpointId);
1936 return cluster.MoveHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionsMask,
1941 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1942 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1943 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1944 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1947 uint8_t mOptionsMask;
1948 uint8_t mOptionsOverride;
1952 * Command MoveSaturation
1954 class ColorControlMoveSaturation : public ModelCommand
1957 ColorControlMoveSaturation() : ModelCommand("move-saturation")
1959 AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
1960 AddArgument("rate", 0, UINT8_MAX, &mRate);
1961 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
1962 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
1963 ModelCommand::AddArguments();
1965 ~ColorControlMoveSaturation()
1967 delete onSuccessCallback;
1968 delete onFailureCallback;
1971 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
1973 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x04) on endpoint %" PRIu16, endpointId);
1975 chip::Controller::ColorControlCluster cluster;
1976 cluster.Associate(device, endpointId);
1977 return cluster.MoveSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionsMask,
1982 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
1983 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
1984 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
1985 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
1988 uint8_t mOptionsMask;
1989 uint8_t mOptionsOverride;
1993 * Command MoveToColor
1995 class ColorControlMoveToColor : public ModelCommand
1998 ColorControlMoveToColor() : ModelCommand("move-to-color")
2000 AddArgument("colorX", 0, UINT16_MAX, &mColorX);
2001 AddArgument("colorY", 0, UINT16_MAX, &mColorY);
2002 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
2003 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2004 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2005 ModelCommand::AddArguments();
2007 ~ColorControlMoveToColor()
2009 delete onSuccessCallback;
2010 delete onFailureCallback;
2013 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2015 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x07) on endpoint %" PRIu16, endpointId);
2017 chip::Controller::ColorControlCluster cluster;
2018 cluster.Associate(device, endpointId);
2019 return cluster.MoveToColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mColorX, mColorY, mTransitionTime,
2020 mOptionsMask, mOptionsOverride);
2024 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2025 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2026 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2027 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2030 uint16_t mTransitionTime;
2031 uint8_t mOptionsMask;
2032 uint8_t mOptionsOverride;
2036 * Command MoveToColorTemperature
2038 class ColorControlMoveToColorTemperature : public ModelCommand
2041 ColorControlMoveToColorTemperature() : ModelCommand("move-to-color-temperature")
2043 AddArgument("colorTemperature", 0, UINT16_MAX, &mColorTemperature);
2044 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
2045 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2046 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2047 ModelCommand::AddArguments();
2049 ~ColorControlMoveToColorTemperature()
2051 delete onSuccessCallback;
2052 delete onFailureCallback;
2055 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2057 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x0A) on endpoint %" PRIu16, endpointId);
2059 chip::Controller::ColorControlCluster cluster;
2060 cluster.Associate(device, endpointId);
2061 return cluster.MoveToColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mColorTemperature,
2062 mTransitionTime, mOptionsMask, mOptionsOverride);
2066 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2067 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2068 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2069 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2070 uint16_t mColorTemperature;
2071 uint16_t mTransitionTime;
2072 uint8_t mOptionsMask;
2073 uint8_t mOptionsOverride;
2079 class ColorControlMoveToHue : public ModelCommand
2082 ColorControlMoveToHue() : ModelCommand("move-to-hue")
2084 AddArgument("hue", 0, UINT8_MAX, &mHue);
2085 AddArgument("direction", 0, UINT8_MAX, &mDirection);
2086 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
2087 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2088 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2089 ModelCommand::AddArguments();
2091 ~ColorControlMoveToHue()
2093 delete onSuccessCallback;
2094 delete onFailureCallback;
2097 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2099 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2101 chip::Controller::ColorControlCluster cluster;
2102 cluster.Associate(device, endpointId);
2103 return cluster.MoveToHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mHue, mDirection, mTransitionTime,
2104 mOptionsMask, mOptionsOverride);
2108 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2109 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2110 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2111 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2114 uint16_t mTransitionTime;
2115 uint8_t mOptionsMask;
2116 uint8_t mOptionsOverride;
2120 * Command MoveToHueAndSaturation
2122 class ColorControlMoveToHueAndSaturation : public ModelCommand
2125 ColorControlMoveToHueAndSaturation() : ModelCommand("move-to-hue-and-saturation")
2127 AddArgument("hue", 0, UINT8_MAX, &mHue);
2128 AddArgument("saturation", 0, UINT8_MAX, &mSaturation);
2129 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
2130 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2131 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2132 ModelCommand::AddArguments();
2134 ~ColorControlMoveToHueAndSaturation()
2136 delete onSuccessCallback;
2137 delete onFailureCallback;
2140 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2142 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2144 chip::Controller::ColorControlCluster cluster;
2145 cluster.Associate(device, endpointId);
2146 return cluster.MoveToHueAndSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mHue, mSaturation,
2147 mTransitionTime, mOptionsMask, mOptionsOverride);
2151 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2152 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2153 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2154 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2156 uint8_t mSaturation;
2157 uint16_t mTransitionTime;
2158 uint8_t mOptionsMask;
2159 uint8_t mOptionsOverride;
2163 * Command MoveToSaturation
2165 class ColorControlMoveToSaturation : public ModelCommand
2168 ColorControlMoveToSaturation() : ModelCommand("move-to-saturation")
2170 AddArgument("saturation", 0, UINT8_MAX, &mSaturation);
2171 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
2172 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2173 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2174 ModelCommand::AddArguments();
2176 ~ColorControlMoveToSaturation()
2178 delete onSuccessCallback;
2179 delete onFailureCallback;
2182 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2184 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x03) on endpoint %" PRIu16, endpointId);
2186 chip::Controller::ColorControlCluster cluster;
2187 cluster.Associate(device, endpointId);
2188 return cluster.MoveToSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mSaturation, mTransitionTime,
2189 mOptionsMask, mOptionsOverride);
2193 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2194 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2195 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2196 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2197 uint8_t mSaturation;
2198 uint16_t mTransitionTime;
2199 uint8_t mOptionsMask;
2200 uint8_t mOptionsOverride;
2206 class ColorControlStepColor : public ModelCommand
2209 ColorControlStepColor() : ModelCommand("step-color")
2211 AddArgument("stepX", INT16_MIN, INT16_MAX, &mStepX);
2212 AddArgument("stepY", INT16_MIN, INT16_MAX, &mStepY);
2213 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
2214 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2215 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2216 ModelCommand::AddArguments();
2218 ~ColorControlStepColor()
2220 delete onSuccessCallback;
2221 delete onFailureCallback;
2224 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2226 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x09) on endpoint %" PRIu16, endpointId);
2228 chip::Controller::ColorControlCluster cluster;
2229 cluster.Associate(device, endpointId);
2230 return cluster.StepColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepX, mStepY, mTransitionTime,
2231 mOptionsMask, mOptionsOverride);
2235 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2236 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2237 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2238 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2241 uint16_t mTransitionTime;
2242 uint8_t mOptionsMask;
2243 uint8_t mOptionsOverride;
2247 * Command StepColorTemperature
2249 class ColorControlStepColorTemperature : public ModelCommand
2252 ColorControlStepColorTemperature() : ModelCommand("step-color-temperature")
2254 AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
2255 AddArgument("stepSize", 0, UINT16_MAX, &mStepSize);
2256 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
2257 AddArgument("colorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum);
2258 AddArgument("colorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum);
2259 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2260 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2261 ModelCommand::AddArguments();
2263 ~ColorControlStepColorTemperature()
2265 delete onSuccessCallback;
2266 delete onFailureCallback;
2269 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2271 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x4C) on endpoint %" PRIu16, endpointId);
2273 chip::Controller::ColorControlCluster cluster;
2274 cluster.Associate(device, endpointId);
2275 return cluster.StepColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
2276 mTransitionTime, mColorTemperatureMinimum, mColorTemperatureMaximum, mOptionsMask,
2281 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2282 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2283 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2284 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2287 uint16_t mTransitionTime;
2288 uint16_t mColorTemperatureMinimum;
2289 uint16_t mColorTemperatureMaximum;
2290 uint8_t mOptionsMask;
2291 uint8_t mOptionsOverride;
2297 class ColorControlStepHue : public ModelCommand
2300 ColorControlStepHue() : ModelCommand("step-hue")
2302 AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
2303 AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
2304 AddArgument("transitionTime", 0, UINT8_MAX, &mTransitionTime);
2305 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2306 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2307 ModelCommand::AddArguments();
2309 ~ColorControlStepHue()
2311 delete onSuccessCallback;
2312 delete onFailureCallback;
2315 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2317 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x02) on endpoint %" PRIu16, endpointId);
2319 chip::Controller::ColorControlCluster cluster;
2320 cluster.Associate(device, endpointId);
2321 return cluster.StepHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize, mTransitionTime,
2322 mOptionsMask, mOptionsOverride);
2326 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2327 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2328 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2329 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2332 uint8_t mTransitionTime;
2333 uint8_t mOptionsMask;
2334 uint8_t mOptionsOverride;
2338 * Command StepSaturation
2340 class ColorControlStepSaturation : public ModelCommand
2343 ColorControlStepSaturation() : ModelCommand("step-saturation")
2345 AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
2346 AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
2347 AddArgument("transitionTime", 0, UINT8_MAX, &mTransitionTime);
2348 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2349 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2350 ModelCommand::AddArguments();
2352 ~ColorControlStepSaturation()
2354 delete onSuccessCallback;
2355 delete onFailureCallback;
2358 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2360 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x05) on endpoint %" PRIu16, endpointId);
2362 chip::Controller::ColorControlCluster cluster;
2363 cluster.Associate(device, endpointId);
2364 return cluster.StepSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
2365 mTransitionTime, mOptionsMask, mOptionsOverride);
2369 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2370 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2371 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2372 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2375 uint8_t mTransitionTime;
2376 uint8_t mOptionsMask;
2377 uint8_t mOptionsOverride;
2381 * Command StopMoveStep
2383 class ColorControlStopMoveStep : public ModelCommand
2386 ColorControlStopMoveStep() : ModelCommand("stop-move-step")
2388 AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
2389 AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
2390 ModelCommand::AddArguments();
2392 ~ColorControlStopMoveStep()
2394 delete onSuccessCallback;
2395 delete onFailureCallback;
2398 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2400 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x47) on endpoint %" PRIu16, endpointId);
2402 chip::Controller::ColorControlCluster cluster;
2403 cluster.Associate(device, endpointId);
2404 return cluster.StopMoveStep(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOptionsMask, mOptionsOverride);
2408 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2409 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2410 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2411 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2412 uint8_t mOptionsMask;
2413 uint8_t mOptionsOverride;
2417 * Discover Attributes
2419 class DiscoverColorControlAttributes : public ModelCommand
2422 DiscoverColorControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
2424 ~DiscoverColorControlAttributes()
2426 delete onSuccessCallback;
2427 delete onFailureCallback;
2430 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2432 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
2434 chip::Controller::ColorControlCluster cluster;
2435 cluster.Associate(device, endpointId);
2436 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2440 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2441 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2442 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2443 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2447 * Attribute CurrentHue
2449 class ReadColorControlCurrentHue : public ModelCommand
2452 ReadColorControlCurrentHue() : ModelCommand("read")
2454 AddArgument("attr-name", "current-hue");
2455 ModelCommand::AddArguments();
2458 ~ReadColorControlCurrentHue()
2460 delete onSuccessCallback;
2461 delete onFailureCallback;
2464 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2466 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2468 chip::Controller::ColorControlCluster cluster;
2469 cluster.Associate(device, endpointId);
2470 return cluster.ReadAttributeCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2474 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2475 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2476 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2477 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2480 class ReportColorControlCurrentHue : public ModelCommand
2483 ReportColorControlCurrentHue() : ModelCommand("report")
2485 AddArgument("attr-name", "current-hue");
2486 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
2487 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
2488 AddArgument("change", 0, UINT8_MAX, &mChange);
2489 ModelCommand::AddArguments();
2492 ~ReportColorControlCurrentHue()
2494 delete onSuccessCallback;
2495 delete onFailureCallback;
2496 delete onReportCallback;
2499 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2501 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2503 chip::Controller::ColorControlCluster cluster;
2504 cluster.Associate(device, endpointId);
2506 CHIP_ERROR err = cluster.ReportAttributeCurrentHue(onReportCallback->Cancel());
2507 if (err != CHIP_NO_ERROR)
2512 return cluster.ConfigureAttributeCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
2513 mMaxInterval, mChange);
2517 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2518 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2519 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2520 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2521 chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
2522 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2523 uint16_t mMinInterval;
2524 uint16_t mMaxInterval;
2529 * Attribute CurrentSaturation
2531 class ReadColorControlCurrentSaturation : public ModelCommand
2534 ReadColorControlCurrentSaturation() : ModelCommand("read")
2536 AddArgument("attr-name", "current-saturation");
2537 ModelCommand::AddArguments();
2540 ~ReadColorControlCurrentSaturation()
2542 delete onSuccessCallback;
2543 delete onFailureCallback;
2546 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2548 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2550 chip::Controller::ColorControlCluster cluster;
2551 cluster.Associate(device, endpointId);
2552 return cluster.ReadAttributeCurrentSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2556 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2557 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2558 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2559 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2562 class ReportColorControlCurrentSaturation : public ModelCommand
2565 ReportColorControlCurrentSaturation() : ModelCommand("report")
2567 AddArgument("attr-name", "current-saturation");
2568 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
2569 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
2570 AddArgument("change", 0, UINT8_MAX, &mChange);
2571 ModelCommand::AddArguments();
2574 ~ReportColorControlCurrentSaturation()
2576 delete onSuccessCallback;
2577 delete onFailureCallback;
2578 delete onReportCallback;
2581 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2583 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2585 chip::Controller::ColorControlCluster cluster;
2586 cluster.Associate(device, endpointId);
2588 CHIP_ERROR err = cluster.ReportAttributeCurrentSaturation(onReportCallback->Cancel());
2589 if (err != CHIP_NO_ERROR)
2594 return cluster.ConfigureAttributeCurrentSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
2595 mMaxInterval, mChange);
2599 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2600 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2601 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2602 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2603 chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
2604 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2605 uint16_t mMinInterval;
2606 uint16_t mMaxInterval;
2611 * Attribute RemainingTime
2613 class ReadColorControlRemainingTime : public ModelCommand
2616 ReadColorControlRemainingTime() : ModelCommand("read")
2618 AddArgument("attr-name", "remaining-time");
2619 ModelCommand::AddArguments();
2622 ~ReadColorControlRemainingTime()
2624 delete onSuccessCallback;
2625 delete onFailureCallback;
2628 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2630 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2632 chip::Controller::ColorControlCluster cluster;
2633 cluster.Associate(device, endpointId);
2634 return cluster.ReadAttributeRemainingTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2638 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2639 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2640 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2641 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2645 * Attribute CurrentX
2647 class ReadColorControlCurrentX : public ModelCommand
2650 ReadColorControlCurrentX() : ModelCommand("read")
2652 AddArgument("attr-name", "current-x");
2653 ModelCommand::AddArguments();
2656 ~ReadColorControlCurrentX()
2658 delete onSuccessCallback;
2659 delete onFailureCallback;
2662 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2664 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2666 chip::Controller::ColorControlCluster cluster;
2667 cluster.Associate(device, endpointId);
2668 return cluster.ReadAttributeCurrentX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2672 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2673 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2674 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2675 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2678 class ReportColorControlCurrentX : public ModelCommand
2681 ReportColorControlCurrentX() : ModelCommand("report")
2683 AddArgument("attr-name", "current-x");
2684 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
2685 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
2686 AddArgument("change", 0, UINT16_MAX, &mChange);
2687 ModelCommand::AddArguments();
2690 ~ReportColorControlCurrentX()
2692 delete onSuccessCallback;
2693 delete onFailureCallback;
2694 delete onReportCallback;
2697 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2699 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2701 chip::Controller::ColorControlCluster cluster;
2702 cluster.Associate(device, endpointId);
2704 CHIP_ERROR err = cluster.ReportAttributeCurrentX(onReportCallback->Cancel());
2705 if (err != CHIP_NO_ERROR)
2710 return cluster.ConfigureAttributeCurrentX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
2711 mMaxInterval, mChange);
2715 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2716 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2717 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2718 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2719 chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
2720 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2721 uint16_t mMinInterval;
2722 uint16_t mMaxInterval;
2727 * Attribute CurrentY
2729 class ReadColorControlCurrentY : public ModelCommand
2732 ReadColorControlCurrentY() : ModelCommand("read")
2734 AddArgument("attr-name", "current-y");
2735 ModelCommand::AddArguments();
2738 ~ReadColorControlCurrentY()
2740 delete onSuccessCallback;
2741 delete onFailureCallback;
2744 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2746 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2748 chip::Controller::ColorControlCluster cluster;
2749 cluster.Associate(device, endpointId);
2750 return cluster.ReadAttributeCurrentY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2754 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2755 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2756 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2757 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2760 class ReportColorControlCurrentY : public ModelCommand
2763 ReportColorControlCurrentY() : ModelCommand("report")
2765 AddArgument("attr-name", "current-y");
2766 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
2767 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
2768 AddArgument("change", 0, UINT16_MAX, &mChange);
2769 ModelCommand::AddArguments();
2772 ~ReportColorControlCurrentY()
2774 delete onSuccessCallback;
2775 delete onFailureCallback;
2776 delete onReportCallback;
2779 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2781 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2783 chip::Controller::ColorControlCluster cluster;
2784 cluster.Associate(device, endpointId);
2786 CHIP_ERROR err = cluster.ReportAttributeCurrentY(onReportCallback->Cancel());
2787 if (err != CHIP_NO_ERROR)
2792 return cluster.ConfigureAttributeCurrentY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
2793 mMaxInterval, mChange);
2797 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2798 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2799 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2800 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2801 chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
2802 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2803 uint16_t mMinInterval;
2804 uint16_t mMaxInterval;
2809 * Attribute DriftCompensation
2811 class ReadColorControlDriftCompensation : public ModelCommand
2814 ReadColorControlDriftCompensation() : ModelCommand("read")
2816 AddArgument("attr-name", "drift-compensation");
2817 ModelCommand::AddArguments();
2820 ~ReadColorControlDriftCompensation()
2822 delete onSuccessCallback;
2823 delete onFailureCallback;
2826 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2828 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2830 chip::Controller::ColorControlCluster cluster;
2831 cluster.Associate(device, endpointId);
2832 return cluster.ReadAttributeDriftCompensation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2836 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2837 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2838 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2839 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2843 * Attribute CompensationText
2845 class ReadColorControlCompensationText : public ModelCommand
2848 ReadColorControlCompensationText() : ModelCommand("read")
2850 AddArgument("attr-name", "compensation-text");
2851 ModelCommand::AddArguments();
2854 ~ReadColorControlCompensationText()
2856 delete onSuccessCallback;
2857 delete onFailureCallback;
2860 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2862 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2864 chip::Controller::ColorControlCluster cluster;
2865 cluster.Associate(device, endpointId);
2866 return cluster.ReadAttributeCompensationText(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2870 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
2871 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
2872 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2873 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2877 * Attribute ColorTemperature
2879 class ReadColorControlColorTemperature : public ModelCommand
2882 ReadColorControlColorTemperature() : ModelCommand("read")
2884 AddArgument("attr-name", "color-temperature");
2885 ModelCommand::AddArguments();
2888 ~ReadColorControlColorTemperature()
2890 delete onSuccessCallback;
2891 delete onFailureCallback;
2894 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2896 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2898 chip::Controller::ColorControlCluster cluster;
2899 cluster.Associate(device, endpointId);
2900 return cluster.ReadAttributeColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2904 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
2905 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2906 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2907 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2910 class ReportColorControlColorTemperature : public ModelCommand
2913 ReportColorControlColorTemperature() : ModelCommand("report")
2915 AddArgument("attr-name", "color-temperature");
2916 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
2917 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
2918 AddArgument("change", 0, UINT16_MAX, &mChange);
2919 ModelCommand::AddArguments();
2922 ~ReportColorControlColorTemperature()
2924 delete onSuccessCallback;
2925 delete onFailureCallback;
2926 delete onReportCallback;
2929 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2931 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);
2933 chip::Controller::ColorControlCluster cluster;
2934 cluster.Associate(device, endpointId);
2936 CHIP_ERROR err = cluster.ReportAttributeColorTemperature(onReportCallback->Cancel());
2937 if (err != CHIP_NO_ERROR)
2942 return cluster.ConfigureAttributeColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
2943 mMaxInterval, mChange);
2947 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
2948 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
2949 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2950 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2951 chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
2952 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
2953 uint16_t mMinInterval;
2954 uint16_t mMaxInterval;
2959 * Attribute ColorMode
2961 class ReadColorControlColorMode : public ModelCommand
2964 ReadColorControlColorMode() : ModelCommand("read")
2966 AddArgument("attr-name", "color-mode");
2967 ModelCommand::AddArguments();
2970 ~ReadColorControlColorMode()
2972 delete onSuccessCallback;
2973 delete onFailureCallback;
2976 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
2978 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
2980 chip::Controller::ColorControlCluster cluster;
2981 cluster.Associate(device, endpointId);
2982 return cluster.ReadAttributeColorMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
2986 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
2987 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
2988 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
2989 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
2993 * Attribute ColorControlOptions
2995 class ReadColorControlColorControlOptions : public ModelCommand
2998 ReadColorControlColorControlOptions() : ModelCommand("read")
3000 AddArgument("attr-name", "color-control-options");
3001 ModelCommand::AddArguments();
3004 ~ReadColorControlColorControlOptions()
3006 delete onSuccessCallback;
3007 delete onFailureCallback;
3010 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3012 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3014 chip::Controller::ColorControlCluster cluster;
3015 cluster.Associate(device, endpointId);
3016 return cluster.ReadAttributeColorControlOptions(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3020 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3021 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3022 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3023 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3026 class WriteColorControlColorControlOptions : public ModelCommand
3029 WriteColorControlColorControlOptions() : ModelCommand("write")
3031 AddArgument("attr-name", "color-control-options");
3032 AddArgument("attr-value", 0, UINT8_MAX, &mValue);
3033 ModelCommand::AddArguments();
3036 ~WriteColorControlColorControlOptions()
3038 delete onSuccessCallback;
3039 delete onFailureCallback;
3042 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3044 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3046 chip::Controller::ColorControlCluster cluster;
3047 cluster.Associate(device, endpointId);
3048 return cluster.WriteAttributeColorControlOptions(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3052 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3053 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3054 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3055 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3060 * Attribute NumberOfPrimaries
3062 class ReadColorControlNumberOfPrimaries : public ModelCommand
3065 ReadColorControlNumberOfPrimaries() : ModelCommand("read")
3067 AddArgument("attr-name", "number-of-primaries");
3068 ModelCommand::AddArguments();
3071 ~ReadColorControlNumberOfPrimaries()
3073 delete onSuccessCallback;
3074 delete onFailureCallback;
3077 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3079 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3081 chip::Controller::ColorControlCluster cluster;
3082 cluster.Associate(device, endpointId);
3083 return cluster.ReadAttributeNumberOfPrimaries(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3087 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3088 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3089 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3090 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3094 * Attribute Primary1X
3096 class ReadColorControlPrimary1X : public ModelCommand
3099 ReadColorControlPrimary1X() : ModelCommand("read")
3101 AddArgument("attr-name", "primary1x");
3102 ModelCommand::AddArguments();
3105 ~ReadColorControlPrimary1X()
3107 delete onSuccessCallback;
3108 delete onFailureCallback;
3111 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3113 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3115 chip::Controller::ColorControlCluster cluster;
3116 cluster.Associate(device, endpointId);
3117 return cluster.ReadAttributePrimary1X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3121 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3122 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3123 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3124 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3128 * Attribute Primary1Y
3130 class ReadColorControlPrimary1Y : public ModelCommand
3133 ReadColorControlPrimary1Y() : ModelCommand("read")
3135 AddArgument("attr-name", "primary1y");
3136 ModelCommand::AddArguments();
3139 ~ReadColorControlPrimary1Y()
3141 delete onSuccessCallback;
3142 delete onFailureCallback;
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.ReadAttributePrimary1Y(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 Primary1Intensity
3164 class ReadColorControlPrimary1Intensity : public ModelCommand
3167 ReadColorControlPrimary1Intensity() : ModelCommand("read")
3169 AddArgument("attr-name", "primary1intensity");
3170 ModelCommand::AddArguments();
3173 ~ReadColorControlPrimary1Intensity()
3175 delete onSuccessCallback;
3176 delete onFailureCallback;
3179 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3181 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3183 chip::Controller::ColorControlCluster cluster;
3184 cluster.Associate(device, endpointId);
3185 return cluster.ReadAttributePrimary1Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3189 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3190 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3191 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3192 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3196 * Attribute Primary2X
3198 class ReadColorControlPrimary2X : public ModelCommand
3201 ReadColorControlPrimary2X() : ModelCommand("read")
3203 AddArgument("attr-name", "primary2x");
3204 ModelCommand::AddArguments();
3207 ~ReadColorControlPrimary2X()
3209 delete onSuccessCallback;
3210 delete onFailureCallback;
3213 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3215 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3217 chip::Controller::ColorControlCluster cluster;
3218 cluster.Associate(device, endpointId);
3219 return cluster.ReadAttributePrimary2X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3223 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3224 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3225 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3226 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3230 * Attribute Primary2Y
3232 class ReadColorControlPrimary2Y : public ModelCommand
3235 ReadColorControlPrimary2Y() : ModelCommand("read")
3237 AddArgument("attr-name", "primary2y");
3238 ModelCommand::AddArguments();
3241 ~ReadColorControlPrimary2Y()
3243 delete onSuccessCallback;
3244 delete onFailureCallback;
3247 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3249 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3251 chip::Controller::ColorControlCluster cluster;
3252 cluster.Associate(device, endpointId);
3253 return cluster.ReadAttributePrimary2Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3257 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3258 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3259 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3260 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3264 * Attribute Primary2Intensity
3266 class ReadColorControlPrimary2Intensity : public ModelCommand
3269 ReadColorControlPrimary2Intensity() : ModelCommand("read")
3271 AddArgument("attr-name", "primary2intensity");
3272 ModelCommand::AddArguments();
3275 ~ReadColorControlPrimary2Intensity()
3277 delete onSuccessCallback;
3278 delete onFailureCallback;
3281 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3283 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3285 chip::Controller::ColorControlCluster cluster;
3286 cluster.Associate(device, endpointId);
3287 return cluster.ReadAttributePrimary2Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3291 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3292 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3293 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3294 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3298 * Attribute Primary3X
3300 class ReadColorControlPrimary3X : public ModelCommand
3303 ReadColorControlPrimary3X() : ModelCommand("read")
3305 AddArgument("attr-name", "primary3x");
3306 ModelCommand::AddArguments();
3309 ~ReadColorControlPrimary3X()
3311 delete onSuccessCallback;
3312 delete onFailureCallback;
3315 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3317 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3319 chip::Controller::ColorControlCluster cluster;
3320 cluster.Associate(device, endpointId);
3321 return cluster.ReadAttributePrimary3X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3325 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3326 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3327 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3328 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3332 * Attribute Primary3Y
3334 class ReadColorControlPrimary3Y : public ModelCommand
3337 ReadColorControlPrimary3Y() : ModelCommand("read")
3339 AddArgument("attr-name", "primary3y");
3340 ModelCommand::AddArguments();
3343 ~ReadColorControlPrimary3Y()
3345 delete onSuccessCallback;
3346 delete onFailureCallback;
3349 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3351 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3353 chip::Controller::ColorControlCluster cluster;
3354 cluster.Associate(device, endpointId);
3355 return cluster.ReadAttributePrimary3Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3359 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3360 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3361 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3362 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3366 * Attribute Primary3Intensity
3368 class ReadColorControlPrimary3Intensity : public ModelCommand
3371 ReadColorControlPrimary3Intensity() : ModelCommand("read")
3373 AddArgument("attr-name", "primary3intensity");
3374 ModelCommand::AddArguments();
3377 ~ReadColorControlPrimary3Intensity()
3379 delete onSuccessCallback;
3380 delete onFailureCallback;
3383 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3385 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3387 chip::Controller::ColorControlCluster cluster;
3388 cluster.Associate(device, endpointId);
3389 return cluster.ReadAttributePrimary3Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3393 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3394 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3395 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3396 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3400 * Attribute Primary4X
3402 class ReadColorControlPrimary4X : public ModelCommand
3405 ReadColorControlPrimary4X() : ModelCommand("read")
3407 AddArgument("attr-name", "primary4x");
3408 ModelCommand::AddArguments();
3411 ~ReadColorControlPrimary4X()
3413 delete onSuccessCallback;
3414 delete onFailureCallback;
3417 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3419 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3421 chip::Controller::ColorControlCluster cluster;
3422 cluster.Associate(device, endpointId);
3423 return cluster.ReadAttributePrimary4X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3427 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3428 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3429 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3430 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3434 * Attribute Primary4Y
3436 class ReadColorControlPrimary4Y : public ModelCommand
3439 ReadColorControlPrimary4Y() : ModelCommand("read")
3441 AddArgument("attr-name", "primary4y");
3442 ModelCommand::AddArguments();
3445 ~ReadColorControlPrimary4Y()
3447 delete onSuccessCallback;
3448 delete onFailureCallback;
3451 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3453 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3455 chip::Controller::ColorControlCluster cluster;
3456 cluster.Associate(device, endpointId);
3457 return cluster.ReadAttributePrimary4Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3461 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3462 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3463 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3464 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3468 * Attribute Primary4Intensity
3470 class ReadColorControlPrimary4Intensity : public ModelCommand
3473 ReadColorControlPrimary4Intensity() : ModelCommand("read")
3475 AddArgument("attr-name", "primary4intensity");
3476 ModelCommand::AddArguments();
3479 ~ReadColorControlPrimary4Intensity()
3481 delete onSuccessCallback;
3482 delete onFailureCallback;
3485 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3487 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3489 chip::Controller::ColorControlCluster cluster;
3490 cluster.Associate(device, endpointId);
3491 return cluster.ReadAttributePrimary4Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3495 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3496 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3497 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3498 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3502 * Attribute Primary5X
3504 class ReadColorControlPrimary5X : public ModelCommand
3507 ReadColorControlPrimary5X() : ModelCommand("read")
3509 AddArgument("attr-name", "primary5x");
3510 ModelCommand::AddArguments();
3513 ~ReadColorControlPrimary5X()
3515 delete onSuccessCallback;
3516 delete onFailureCallback;
3519 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3521 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3523 chip::Controller::ColorControlCluster cluster;
3524 cluster.Associate(device, endpointId);
3525 return cluster.ReadAttributePrimary5X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3529 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3530 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3531 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3532 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3536 * Attribute Primary5Y
3538 class ReadColorControlPrimary5Y : public ModelCommand
3541 ReadColorControlPrimary5Y() : ModelCommand("read")
3543 AddArgument("attr-name", "primary5y");
3544 ModelCommand::AddArguments();
3547 ~ReadColorControlPrimary5Y()
3549 delete onSuccessCallback;
3550 delete onFailureCallback;
3553 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3555 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3557 chip::Controller::ColorControlCluster cluster;
3558 cluster.Associate(device, endpointId);
3559 return cluster.ReadAttributePrimary5Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3563 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3564 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3565 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3566 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3570 * Attribute Primary5Intensity
3572 class ReadColorControlPrimary5Intensity : public ModelCommand
3575 ReadColorControlPrimary5Intensity() : ModelCommand("read")
3577 AddArgument("attr-name", "primary5intensity");
3578 ModelCommand::AddArguments();
3581 ~ReadColorControlPrimary5Intensity()
3583 delete onSuccessCallback;
3584 delete onFailureCallback;
3587 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3589 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3591 chip::Controller::ColorControlCluster cluster;
3592 cluster.Associate(device, endpointId);
3593 return cluster.ReadAttributePrimary5Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3597 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3598 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3599 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3600 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3604 * Attribute Primary6X
3606 class ReadColorControlPrimary6X : public ModelCommand
3609 ReadColorControlPrimary6X() : ModelCommand("read")
3611 AddArgument("attr-name", "primary6x");
3612 ModelCommand::AddArguments();
3615 ~ReadColorControlPrimary6X()
3617 delete onSuccessCallback;
3618 delete onFailureCallback;
3621 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3623 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3625 chip::Controller::ColorControlCluster cluster;
3626 cluster.Associate(device, endpointId);
3627 return cluster.ReadAttributePrimary6X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3631 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3632 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3633 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3634 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3638 * Attribute Primary6Y
3640 class ReadColorControlPrimary6Y : public ModelCommand
3643 ReadColorControlPrimary6Y() : ModelCommand("read")
3645 AddArgument("attr-name", "primary6y");
3646 ModelCommand::AddArguments();
3649 ~ReadColorControlPrimary6Y()
3651 delete onSuccessCallback;
3652 delete onFailureCallback;
3655 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3657 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3659 chip::Controller::ColorControlCluster cluster;
3660 cluster.Associate(device, endpointId);
3661 return cluster.ReadAttributePrimary6Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3665 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3666 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3667 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3668 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3672 * Attribute Primary6Intensity
3674 class ReadColorControlPrimary6Intensity : public ModelCommand
3677 ReadColorControlPrimary6Intensity() : ModelCommand("read")
3679 AddArgument("attr-name", "primary6intensity");
3680 ModelCommand::AddArguments();
3683 ~ReadColorControlPrimary6Intensity()
3685 delete onSuccessCallback;
3686 delete onFailureCallback;
3689 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3691 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3693 chip::Controller::ColorControlCluster cluster;
3694 cluster.Associate(device, endpointId);
3695 return cluster.ReadAttributePrimary6Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3699 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
3700 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
3701 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3702 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3706 * Attribute WhitePointX
3708 class ReadColorControlWhitePointX : public ModelCommand
3711 ReadColorControlWhitePointX() : ModelCommand("read")
3713 AddArgument("attr-name", "white-point-x");
3714 ModelCommand::AddArguments();
3717 ~ReadColorControlWhitePointX()
3719 delete onSuccessCallback;
3720 delete onFailureCallback;
3723 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3725 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3727 chip::Controller::ColorControlCluster cluster;
3728 cluster.Associate(device, endpointId);
3729 return cluster.ReadAttributeWhitePointX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3733 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3734 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3735 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3736 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3739 class WriteColorControlWhitePointX : public ModelCommand
3742 WriteColorControlWhitePointX() : ModelCommand("write")
3744 AddArgument("attr-name", "white-point-x");
3745 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3746 ModelCommand::AddArguments();
3749 ~WriteColorControlWhitePointX()
3751 delete onSuccessCallback;
3752 delete onFailureCallback;
3755 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3757 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3759 chip::Controller::ColorControlCluster cluster;
3760 cluster.Associate(device, endpointId);
3761 return cluster.WriteAttributeWhitePointX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3765 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3766 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3767 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3768 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3773 * Attribute WhitePointY
3775 class ReadColorControlWhitePointY : public ModelCommand
3778 ReadColorControlWhitePointY() : ModelCommand("read")
3780 AddArgument("attr-name", "white-point-y");
3781 ModelCommand::AddArguments();
3784 ~ReadColorControlWhitePointY()
3786 delete onSuccessCallback;
3787 delete onFailureCallback;
3790 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3792 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3794 chip::Controller::ColorControlCluster cluster;
3795 cluster.Associate(device, endpointId);
3796 return cluster.ReadAttributeWhitePointY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3800 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3801 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3802 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3803 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3806 class WriteColorControlWhitePointY : public ModelCommand
3809 WriteColorControlWhitePointY() : ModelCommand("write")
3811 AddArgument("attr-name", "white-point-y");
3812 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3813 ModelCommand::AddArguments();
3816 ~WriteColorControlWhitePointY()
3818 delete onSuccessCallback;
3819 delete onFailureCallback;
3822 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3824 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3826 chip::Controller::ColorControlCluster cluster;
3827 cluster.Associate(device, endpointId);
3828 return cluster.WriteAttributeWhitePointY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3832 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3833 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3834 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3835 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3840 * Attribute ColorPointRX
3842 class ReadColorControlColorPointRX : public ModelCommand
3845 ReadColorControlColorPointRX() : ModelCommand("read")
3847 AddArgument("attr-name", "color-point-rx");
3848 ModelCommand::AddArguments();
3851 ~ReadColorControlColorPointRX()
3853 delete onSuccessCallback;
3854 delete onFailureCallback;
3857 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3859 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3861 chip::Controller::ColorControlCluster cluster;
3862 cluster.Associate(device, endpointId);
3863 return cluster.ReadAttributeColorPointRX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3867 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3868 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3869 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3870 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3873 class WriteColorControlColorPointRX : public ModelCommand
3876 WriteColorControlColorPointRX() : ModelCommand("write")
3878 AddArgument("attr-name", "color-point-rx");
3879 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3880 ModelCommand::AddArguments();
3883 ~WriteColorControlColorPointRX()
3885 delete onSuccessCallback;
3886 delete onFailureCallback;
3889 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3891 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3893 chip::Controller::ColorControlCluster cluster;
3894 cluster.Associate(device, endpointId);
3895 return cluster.WriteAttributeColorPointRX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3899 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3900 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3901 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3902 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3907 * Attribute ColorPointRY
3909 class ReadColorControlColorPointRY : public ModelCommand
3912 ReadColorControlColorPointRY() : ModelCommand("read")
3914 AddArgument("attr-name", "color-point-ry");
3915 ModelCommand::AddArguments();
3918 ~ReadColorControlColorPointRY()
3920 delete onSuccessCallback;
3921 delete onFailureCallback;
3924 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3926 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3928 chip::Controller::ColorControlCluster cluster;
3929 cluster.Associate(device, endpointId);
3930 return cluster.ReadAttributeColorPointRY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
3934 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
3935 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
3936 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3937 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3940 class WriteColorControlColorPointRY : public ModelCommand
3943 WriteColorControlColorPointRY() : ModelCommand("write")
3945 AddArgument("attr-name", "color-point-ry");
3946 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
3947 ModelCommand::AddArguments();
3950 ~WriteColorControlColorPointRY()
3952 delete onSuccessCallback;
3953 delete onFailureCallback;
3956 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3958 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
3960 chip::Controller::ColorControlCluster cluster;
3961 cluster.Associate(device, endpointId);
3962 return cluster.WriteAttributeColorPointRY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
3966 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
3967 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
3968 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
3969 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
3974 * Attribute ColorPointRIntensity
3976 class ReadColorControlColorPointRIntensity : public ModelCommand
3979 ReadColorControlColorPointRIntensity() : ModelCommand("read")
3981 AddArgument("attr-name", "color-point-rintensity");
3982 ModelCommand::AddArguments();
3985 ~ReadColorControlColorPointRIntensity()
3987 delete onSuccessCallback;
3988 delete onFailureCallback;
3991 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
3993 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
3995 chip::Controller::ColorControlCluster cluster;
3996 cluster.Associate(device, endpointId);
3997 return cluster.ReadAttributeColorPointRIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4001 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
4002 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
4003 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4004 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4007 class WriteColorControlColorPointRIntensity : public ModelCommand
4010 WriteColorControlColorPointRIntensity() : ModelCommand("write")
4012 AddArgument("attr-name", "color-point-rintensity");
4013 AddArgument("attr-value", 0, UINT8_MAX, &mValue);
4014 ModelCommand::AddArguments();
4017 ~WriteColorControlColorPointRIntensity()
4019 delete onSuccessCallback;
4020 delete onFailureCallback;
4023 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4025 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
4027 chip::Controller::ColorControlCluster cluster;
4028 cluster.Associate(device, endpointId);
4029 return cluster.WriteAttributeColorPointRIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
4033 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
4034 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
4035 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4036 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4041 * Attribute ColorPointGX
4043 class ReadColorControlColorPointGX : public ModelCommand
4046 ReadColorControlColorPointGX() : ModelCommand("read")
4048 AddArgument("attr-name", "color-point-gx");
4049 ModelCommand::AddArguments();
4052 ~ReadColorControlColorPointGX()
4054 delete onSuccessCallback;
4055 delete onFailureCallback;
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.ReadAttributeColorPointGX(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);
4074 class WriteColorControlColorPointGX : public ModelCommand
4077 WriteColorControlColorPointGX() : ModelCommand("write")
4079 AddArgument("attr-name", "color-point-gx");
4080 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
4081 ModelCommand::AddArguments();
4084 ~WriteColorControlColorPointGX()
4086 delete onSuccessCallback;
4087 delete onFailureCallback;
4090 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4092 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
4094 chip::Controller::ColorControlCluster cluster;
4095 cluster.Associate(device, endpointId);
4096 return cluster.WriteAttributeColorPointGX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
4100 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
4101 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
4102 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4103 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4108 * Attribute ColorPointGY
4110 class ReadColorControlColorPointGY : public ModelCommand
4113 ReadColorControlColorPointGY() : ModelCommand("read")
4115 AddArgument("attr-name", "color-point-gy");
4116 ModelCommand::AddArguments();
4119 ~ReadColorControlColorPointGY()
4121 delete onSuccessCallback;
4122 delete onFailureCallback;
4125 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4127 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4129 chip::Controller::ColorControlCluster cluster;
4130 cluster.Associate(device, endpointId);
4131 return cluster.ReadAttributeColorPointGY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4135 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4136 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4137 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4138 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4141 class WriteColorControlColorPointGY : public ModelCommand
4144 WriteColorControlColorPointGY() : ModelCommand("write")
4146 AddArgument("attr-name", "color-point-gy");
4147 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
4148 ModelCommand::AddArguments();
4151 ~WriteColorControlColorPointGY()
4153 delete onSuccessCallback;
4154 delete onFailureCallback;
4157 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4159 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
4161 chip::Controller::ColorControlCluster cluster;
4162 cluster.Associate(device, endpointId);
4163 return cluster.WriteAttributeColorPointGY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
4167 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
4168 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
4169 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4170 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4175 * Attribute ColorPointGIntensity
4177 class ReadColorControlColorPointGIntensity : public ModelCommand
4180 ReadColorControlColorPointGIntensity() : ModelCommand("read")
4182 AddArgument("attr-name", "color-point-gintensity");
4183 ModelCommand::AddArguments();
4186 ~ReadColorControlColorPointGIntensity()
4188 delete onSuccessCallback;
4189 delete onFailureCallback;
4192 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4194 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4196 chip::Controller::ColorControlCluster cluster;
4197 cluster.Associate(device, endpointId);
4198 return cluster.ReadAttributeColorPointGIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4202 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
4203 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
4204 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4205 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4208 class WriteColorControlColorPointGIntensity : public ModelCommand
4211 WriteColorControlColorPointGIntensity() : ModelCommand("write")
4213 AddArgument("attr-name", "color-point-gintensity");
4214 AddArgument("attr-value", 0, UINT8_MAX, &mValue);
4215 ModelCommand::AddArguments();
4218 ~WriteColorControlColorPointGIntensity()
4220 delete onSuccessCallback;
4221 delete onFailureCallback;
4224 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4226 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
4228 chip::Controller::ColorControlCluster cluster;
4229 cluster.Associate(device, endpointId);
4230 return cluster.WriteAttributeColorPointGIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
4234 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
4235 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
4236 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4237 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4242 * Attribute ColorPointBX
4244 class ReadColorControlColorPointBX : public ModelCommand
4247 ReadColorControlColorPointBX() : ModelCommand("read")
4249 AddArgument("attr-name", "color-point-bx");
4250 ModelCommand::AddArguments();
4253 ~ReadColorControlColorPointBX()
4255 delete onSuccessCallback;
4256 delete onFailureCallback;
4259 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4261 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4263 chip::Controller::ColorControlCluster cluster;
4264 cluster.Associate(device, endpointId);
4265 return cluster.ReadAttributeColorPointBX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4269 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4270 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4271 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4272 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4275 class WriteColorControlColorPointBX : public ModelCommand
4278 WriteColorControlColorPointBX() : ModelCommand("write")
4280 AddArgument("attr-name", "color-point-bx");
4281 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
4282 ModelCommand::AddArguments();
4285 ~WriteColorControlColorPointBX()
4287 delete onSuccessCallback;
4288 delete onFailureCallback;
4291 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4293 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
4295 chip::Controller::ColorControlCluster cluster;
4296 cluster.Associate(device, endpointId);
4297 return cluster.WriteAttributeColorPointBX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
4301 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
4302 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
4303 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4304 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4309 * Attribute ColorPointBY
4311 class ReadColorControlColorPointBY : public ModelCommand
4314 ReadColorControlColorPointBY() : ModelCommand("read")
4316 AddArgument("attr-name", "color-point-by");
4317 ModelCommand::AddArguments();
4320 ~ReadColorControlColorPointBY()
4322 delete onSuccessCallback;
4323 delete onFailureCallback;
4326 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4328 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4330 chip::Controller::ColorControlCluster cluster;
4331 cluster.Associate(device, endpointId);
4332 return cluster.ReadAttributeColorPointBY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4336 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4337 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4338 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4339 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4342 class WriteColorControlColorPointBY : public ModelCommand
4345 WriteColorControlColorPointBY() : ModelCommand("write")
4347 AddArgument("attr-name", "color-point-by");
4348 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
4349 ModelCommand::AddArguments();
4352 ~WriteColorControlColorPointBY()
4354 delete onSuccessCallback;
4355 delete onFailureCallback;
4358 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4360 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
4362 chip::Controller::ColorControlCluster cluster;
4363 cluster.Associate(device, endpointId);
4364 return cluster.WriteAttributeColorPointBY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
4368 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
4369 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
4370 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4371 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4376 * Attribute ColorPointBIntensity
4378 class ReadColorControlColorPointBIntensity : public ModelCommand
4381 ReadColorControlColorPointBIntensity() : ModelCommand("read")
4383 AddArgument("attr-name", "color-point-bintensity");
4384 ModelCommand::AddArguments();
4387 ~ReadColorControlColorPointBIntensity()
4389 delete onSuccessCallback;
4390 delete onFailureCallback;
4393 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4395 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4397 chip::Controller::ColorControlCluster cluster;
4398 cluster.Associate(device, endpointId);
4399 return cluster.ReadAttributeColorPointBIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4403 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
4404 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
4405 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4406 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4409 class WriteColorControlColorPointBIntensity : public ModelCommand
4412 WriteColorControlColorPointBIntensity() : ModelCommand("write")
4414 AddArgument("attr-name", "color-point-bintensity");
4415 AddArgument("attr-value", 0, UINT8_MAX, &mValue);
4416 ModelCommand::AddArguments();
4419 ~WriteColorControlColorPointBIntensity()
4421 delete onSuccessCallback;
4422 delete onFailureCallback;
4425 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4427 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
4429 chip::Controller::ColorControlCluster cluster;
4430 cluster.Associate(device, endpointId);
4431 return cluster.WriteAttributeColorPointBIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
4435 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
4436 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
4437 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4438 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4443 * Attribute EnhancedCurrentHue
4445 class ReadColorControlEnhancedCurrentHue : public ModelCommand
4448 ReadColorControlEnhancedCurrentHue() : ModelCommand("read")
4450 AddArgument("attr-name", "enhanced-current-hue");
4451 ModelCommand::AddArguments();
4454 ~ReadColorControlEnhancedCurrentHue()
4456 delete onSuccessCallback;
4457 delete onFailureCallback;
4460 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4462 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4464 chip::Controller::ColorControlCluster cluster;
4465 cluster.Associate(device, endpointId);
4466 return cluster.ReadAttributeEnhancedCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4470 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4471 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4472 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4473 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4477 * Attribute EnhancedColorMode
4479 class ReadColorControlEnhancedColorMode : public ModelCommand
4482 ReadColorControlEnhancedColorMode() : ModelCommand("read")
4484 AddArgument("attr-name", "enhanced-color-mode");
4485 ModelCommand::AddArguments();
4488 ~ReadColorControlEnhancedColorMode()
4490 delete onSuccessCallback;
4491 delete onFailureCallback;
4494 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4496 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4498 chip::Controller::ColorControlCluster cluster;
4499 cluster.Associate(device, endpointId);
4500 return cluster.ReadAttributeEnhancedColorMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4504 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
4505 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
4506 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4507 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4511 * Attribute ColorLoopActive
4513 class ReadColorControlColorLoopActive : public ModelCommand
4516 ReadColorControlColorLoopActive() : ModelCommand("read")
4518 AddArgument("attr-name", "color-loop-active");
4519 ModelCommand::AddArguments();
4522 ~ReadColorControlColorLoopActive()
4524 delete onSuccessCallback;
4525 delete onFailureCallback;
4528 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4530 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4532 chip::Controller::ColorControlCluster cluster;
4533 cluster.Associate(device, endpointId);
4534 return cluster.ReadAttributeColorLoopActive(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4538 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
4539 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
4540 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4541 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4545 * Attribute ColorLoopDirection
4547 class ReadColorControlColorLoopDirection : public ModelCommand
4550 ReadColorControlColorLoopDirection() : ModelCommand("read")
4552 AddArgument("attr-name", "color-loop-direction");
4553 ModelCommand::AddArguments();
4556 ~ReadColorControlColorLoopDirection()
4558 delete onSuccessCallback;
4559 delete onFailureCallback;
4562 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4564 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4566 chip::Controller::ColorControlCluster cluster;
4567 cluster.Associate(device, endpointId);
4568 return cluster.ReadAttributeColorLoopDirection(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4572 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
4573 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
4574 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4575 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4579 * Attribute ColorLoopTime
4581 class ReadColorControlColorLoopTime : public ModelCommand
4584 ReadColorControlColorLoopTime() : ModelCommand("read")
4586 AddArgument("attr-name", "color-loop-time");
4587 ModelCommand::AddArguments();
4590 ~ReadColorControlColorLoopTime()
4592 delete onSuccessCallback;
4593 delete onFailureCallback;
4596 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4598 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4600 chip::Controller::ColorControlCluster cluster;
4601 cluster.Associate(device, endpointId);
4602 return cluster.ReadAttributeColorLoopTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4606 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4607 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4608 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4609 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4613 * Attribute ColorCapabilities
4615 class ReadColorControlColorCapabilities : public ModelCommand
4618 ReadColorControlColorCapabilities() : ModelCommand("read")
4620 AddArgument("attr-name", "color-capabilities");
4621 ModelCommand::AddArguments();
4624 ~ReadColorControlColorCapabilities()
4626 delete onSuccessCallback;
4627 delete onFailureCallback;
4630 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4632 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4634 chip::Controller::ColorControlCluster cluster;
4635 cluster.Associate(device, endpointId);
4636 return cluster.ReadAttributeColorCapabilities(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4640 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4641 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4642 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4643 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4647 * Attribute ColorTempPhysicalMin
4649 class ReadColorControlColorTempPhysicalMin : public ModelCommand
4652 ReadColorControlColorTempPhysicalMin() : ModelCommand("read")
4654 AddArgument("attr-name", "color-temp-physical-min");
4655 ModelCommand::AddArguments();
4658 ~ReadColorControlColorTempPhysicalMin()
4660 delete onSuccessCallback;
4661 delete onFailureCallback;
4664 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4666 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4668 chip::Controller::ColorControlCluster cluster;
4669 cluster.Associate(device, endpointId);
4670 return cluster.ReadAttributeColorTempPhysicalMin(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4674 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4675 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4676 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4677 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4681 * Attribute ColorTempPhysicalMax
4683 class ReadColorControlColorTempPhysicalMax : public ModelCommand
4686 ReadColorControlColorTempPhysicalMax() : ModelCommand("read")
4688 AddArgument("attr-name", "color-temp-physical-max");
4689 ModelCommand::AddArguments();
4692 ~ReadColorControlColorTempPhysicalMax()
4694 delete onSuccessCallback;
4695 delete onFailureCallback;
4698 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4700 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4702 chip::Controller::ColorControlCluster cluster;
4703 cluster.Associate(device, endpointId);
4704 return cluster.ReadAttributeColorTempPhysicalMax(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4708 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4709 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4710 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4711 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4715 * Attribute CoupleColorTempToLevelMinMireds
4717 class ReadColorControlCoupleColorTempToLevelMinMireds : public ModelCommand
4720 ReadColorControlCoupleColorTempToLevelMinMireds() : ModelCommand("read")
4722 AddArgument("attr-name", "couple-color-temp-to-level-min-mireds");
4723 ModelCommand::AddArguments();
4726 ~ReadColorControlCoupleColorTempToLevelMinMireds()
4728 delete onSuccessCallback;
4729 delete onFailureCallback;
4732 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4734 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4736 chip::Controller::ColorControlCluster cluster;
4737 cluster.Associate(device, endpointId);
4738 return cluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4742 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4743 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4744 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4745 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4749 * Attribute StartUpColorTemperatureMireds
4751 class ReadColorControlStartUpColorTemperatureMireds : public ModelCommand
4754 ReadColorControlStartUpColorTemperatureMireds() : ModelCommand("read")
4756 AddArgument("attr-name", "start-up-color-temperature-mireds");
4757 ModelCommand::AddArguments();
4760 ~ReadColorControlStartUpColorTemperatureMireds()
4762 delete onSuccessCallback;
4763 delete onFailureCallback;
4766 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4768 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4770 chip::Controller::ColorControlCluster cluster;
4771 cluster.Associate(device, endpointId);
4772 return cluster.ReadAttributeStartUpColorTemperatureMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4776 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4777 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4778 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4779 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4782 class WriteColorControlStartUpColorTemperatureMireds : public ModelCommand
4785 WriteColorControlStartUpColorTemperatureMireds() : ModelCommand("write")
4787 AddArgument("attr-name", "start-up-color-temperature-mireds");
4788 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
4789 ModelCommand::AddArguments();
4792 ~WriteColorControlStartUpColorTemperatureMireds()
4794 delete onSuccessCallback;
4795 delete onFailureCallback;
4798 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4800 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);
4802 chip::Controller::ColorControlCluster cluster;
4803 cluster.Associate(device, endpointId);
4804 return cluster.WriteAttributeStartUpColorTemperatureMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
4809 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
4810 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
4811 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4812 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4817 * Attribute ClusterRevision
4819 class ReadColorControlClusterRevision : public ModelCommand
4822 ReadColorControlClusterRevision() : ModelCommand("read")
4824 AddArgument("attr-name", "cluster-revision");
4825 ModelCommand::AddArguments();
4828 ~ReadColorControlClusterRevision()
4830 delete onSuccessCallback;
4831 delete onFailureCallback;
4834 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4836 ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);
4838 chip::Controller::ColorControlCluster cluster;
4839 cluster.Associate(device, endpointId);
4840 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4844 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
4845 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
4846 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4847 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4850 /*----------------------------------------------------------------------------*\
4851 | Cluster DoorLock | 0x0101 |
4852 |------------------------------------------------------------------------------|
4854 | * ClearAllPins | 0x08 |
4855 | * ClearAllRfids | 0x19 |
4856 | * ClearHolidaySchedule | 0x13 |
4857 | * ClearPin | 0x07 |
4858 | * ClearRfid | 0x18 |
4859 | * ClearWeekdaySchedule | 0x0D |
4860 | * ClearYeardaySchedule | 0x10 |
4861 | * GetHolidaySchedule | 0x12 |
4862 | * GetLogRecord | 0x04 |
4864 | * GetRfid | 0x17 |
4865 | * GetUserType | 0x15 |
4866 | * GetWeekdaySchedule | 0x0C |
4867 | * GetYeardaySchedule | 0x0F |
4868 | * LockDoor | 0x00 |
4869 | * SetHolidaySchedule | 0x11 |
4871 | * SetRfid | 0x16 |
4872 | * SetUserType | 0x14 |
4873 | * SetWeekdaySchedule | 0x0B |
4874 | * SetYeardaySchedule | 0x0E |
4875 | * UnlockDoor | 0x01 |
4876 | * UnlockWithTimeout | 0x03 |
4877 |------------------------------------------------------------------------------|
4879 | * LockState | 0x0000 |
4880 | * LockType | 0x0001 |
4881 | * ActuatorEnabled | 0x0002 |
4882 | * ClusterRevision | 0xFFFD |
4883 \*----------------------------------------------------------------------------*/
4886 * Command ClearAllPins
4888 class DoorLockClearAllPins : public ModelCommand
4891 DoorLockClearAllPins() : ModelCommand("clear-all-pins") { ModelCommand::AddArguments(); }
4892 ~DoorLockClearAllPins()
4894 delete onSuccessCallback;
4895 delete onFailureCallback;
4898 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4900 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x08) on endpoint %" PRIu16, endpointId);
4902 chip::Controller::DoorLockCluster cluster;
4903 cluster.Associate(device, endpointId);
4904 return cluster.ClearAllPins(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4908 chip::Callback::Callback<DoorLockClusterClearAllPinsResponseCallback> * onSuccessCallback =
4909 new chip::Callback::Callback<DoorLockClusterClearAllPinsResponseCallback>(OnDoorLockClusterClearAllPinsResponse, this);
4910 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4911 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4915 * Command ClearAllRfids
4917 class DoorLockClearAllRfids : public ModelCommand
4920 DoorLockClearAllRfids() : ModelCommand("clear-all-rfids") { ModelCommand::AddArguments(); }
4921 ~DoorLockClearAllRfids()
4923 delete onSuccessCallback;
4924 delete onFailureCallback;
4927 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4929 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x19) on endpoint %" PRIu16, endpointId);
4931 chip::Controller::DoorLockCluster cluster;
4932 cluster.Associate(device, endpointId);
4933 return cluster.ClearAllRfids(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
4937 chip::Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback> * onSuccessCallback =
4938 new chip::Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback>(OnDoorLockClusterClearAllRfidsResponse, this);
4939 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4940 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4944 * Command ClearHolidaySchedule
4946 class DoorLockClearHolidaySchedule : public ModelCommand
4949 DoorLockClearHolidaySchedule() : ModelCommand("clear-holiday-schedule")
4951 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
4952 ModelCommand::AddArguments();
4954 ~DoorLockClearHolidaySchedule()
4956 delete onSuccessCallback;
4957 delete onFailureCallback;
4960 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4962 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x13) on endpoint %" PRIu16, endpointId);
4964 chip::Controller::DoorLockCluster cluster;
4965 cluster.Associate(device, endpointId);
4966 return cluster.ClearHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId);
4970 chip::Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback> * onSuccessCallback =
4971 new chip::Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback>(
4972 OnDoorLockClusterClearHolidayScheduleResponse, this);
4973 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
4974 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
4975 uint8_t mScheduleId;
4981 class DoorLockClearPin : public ModelCommand
4984 DoorLockClearPin() : ModelCommand("clear-pin")
4986 AddArgument("userId", 0, UINT16_MAX, &mUserId);
4987 ModelCommand::AddArguments();
4991 delete onSuccessCallback;
4992 delete onFailureCallback;
4995 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
4997 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x07) on endpoint %" PRIu16, endpointId);
4999 chip::Controller::DoorLockCluster cluster;
5000 cluster.Associate(device, endpointId);
5001 return cluster.ClearPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
5005 chip::Callback::Callback<DoorLockClusterClearPinResponseCallback> * onSuccessCallback =
5006 new chip::Callback::Callback<DoorLockClusterClearPinResponseCallback>(OnDoorLockClusterClearPinResponse, this);
5007 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5008 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5015 class DoorLockClearRfid : public ModelCommand
5018 DoorLockClearRfid() : ModelCommand("clear-rfid")
5020 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5021 ModelCommand::AddArguments();
5023 ~DoorLockClearRfid()
5025 delete onSuccessCallback;
5026 delete onFailureCallback;
5029 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5031 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x18) on endpoint %" PRIu16, endpointId);
5033 chip::Controller::DoorLockCluster cluster;
5034 cluster.Associate(device, endpointId);
5035 return cluster.ClearRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
5039 chip::Callback::Callback<DoorLockClusterClearRfidResponseCallback> * onSuccessCallback =
5040 new chip::Callback::Callback<DoorLockClusterClearRfidResponseCallback>(OnDoorLockClusterClearRfidResponse, this);
5041 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5042 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5047 * Command ClearWeekdaySchedule
5049 class DoorLockClearWeekdaySchedule : public ModelCommand
5052 DoorLockClearWeekdaySchedule() : ModelCommand("clear-weekday-schedule")
5054 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
5055 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5056 ModelCommand::AddArguments();
5058 ~DoorLockClearWeekdaySchedule()
5060 delete onSuccessCallback;
5061 delete onFailureCallback;
5064 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5066 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0D) on endpoint %" PRIu16, endpointId);
5068 chip::Controller::DoorLockCluster cluster;
5069 cluster.Associate(device, endpointId);
5070 return cluster.ClearWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
5074 chip::Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback> * onSuccessCallback =
5075 new chip::Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback>(
5076 OnDoorLockClusterClearWeekdayScheduleResponse, this);
5077 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5078 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5079 uint8_t mScheduleId;
5084 * Command ClearYeardaySchedule
5086 class DoorLockClearYeardaySchedule : public ModelCommand
5089 DoorLockClearYeardaySchedule() : ModelCommand("clear-yearday-schedule")
5091 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
5092 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5093 ModelCommand::AddArguments();
5095 ~DoorLockClearYeardaySchedule()
5097 delete onSuccessCallback;
5098 delete onFailureCallback;
5101 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5103 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x10) on endpoint %" PRIu16, endpointId);
5105 chip::Controller::DoorLockCluster cluster;
5106 cluster.Associate(device, endpointId);
5107 return cluster.ClearYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
5111 chip::Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback> * onSuccessCallback =
5112 new chip::Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback>(
5113 OnDoorLockClusterClearYeardayScheduleResponse, this);
5114 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5115 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5116 uint8_t mScheduleId;
5121 * Command GetHolidaySchedule
5123 class DoorLockGetHolidaySchedule : public ModelCommand
5126 DoorLockGetHolidaySchedule() : ModelCommand("get-holiday-schedule")
5128 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
5129 ModelCommand::AddArguments();
5131 ~DoorLockGetHolidaySchedule()
5133 delete onSuccessCallback;
5134 delete onFailureCallback;
5137 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5139 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x12) on endpoint %" PRIu16, endpointId);
5141 chip::Controller::DoorLockCluster cluster;
5142 cluster.Associate(device, endpointId);
5143 return cluster.GetHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId);
5147 chip::Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback> * onSuccessCallback =
5148 new chip::Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback>(OnDoorLockClusterGetHolidayScheduleResponse,
5150 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5151 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5152 uint8_t mScheduleId;
5156 * Command GetLogRecord
5158 class DoorLockGetLogRecord : public ModelCommand
5161 DoorLockGetLogRecord() : ModelCommand("get-log-record")
5163 AddArgument("logIndex", 0, UINT16_MAX, &mLogIndex);
5164 ModelCommand::AddArguments();
5166 ~DoorLockGetLogRecord()
5168 delete onSuccessCallback;
5169 delete onFailureCallback;
5172 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5174 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x04) on endpoint %" PRIu16, endpointId);
5176 chip::Controller::DoorLockCluster cluster;
5177 cluster.Associate(device, endpointId);
5178 return cluster.GetLogRecord(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLogIndex);
5182 chip::Callback::Callback<DoorLockClusterGetLogRecordResponseCallback> * onSuccessCallback =
5183 new chip::Callback::Callback<DoorLockClusterGetLogRecordResponseCallback>(OnDoorLockClusterGetLogRecordResponse, this);
5184 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5185 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5192 class DoorLockGetPin : public ModelCommand
5195 DoorLockGetPin() : ModelCommand("get-pin")
5197 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5198 ModelCommand::AddArguments();
5202 delete onSuccessCallback;
5203 delete onFailureCallback;
5206 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5208 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x06) on endpoint %" PRIu16, endpointId);
5210 chip::Controller::DoorLockCluster cluster;
5211 cluster.Associate(device, endpointId);
5212 return cluster.GetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
5216 chip::Callback::Callback<DoorLockClusterGetPinResponseCallback> * onSuccessCallback =
5217 new chip::Callback::Callback<DoorLockClusterGetPinResponseCallback>(OnDoorLockClusterGetPinResponse, this);
5218 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5219 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5226 class DoorLockGetRfid : public ModelCommand
5229 DoorLockGetRfid() : ModelCommand("get-rfid")
5231 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5232 ModelCommand::AddArguments();
5236 delete onSuccessCallback;
5237 delete onFailureCallback;
5240 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5242 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x17) on endpoint %" PRIu16, endpointId);
5244 chip::Controller::DoorLockCluster cluster;
5245 cluster.Associate(device, endpointId);
5246 return cluster.GetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
5250 chip::Callback::Callback<DoorLockClusterGetRfidResponseCallback> * onSuccessCallback =
5251 new chip::Callback::Callback<DoorLockClusterGetRfidResponseCallback>(OnDoorLockClusterGetRfidResponse, this);
5252 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5253 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5258 * Command GetUserType
5260 class DoorLockGetUserType : public ModelCommand
5263 DoorLockGetUserType() : ModelCommand("get-user-type")
5265 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5266 ModelCommand::AddArguments();
5268 ~DoorLockGetUserType()
5270 delete onSuccessCallback;
5271 delete onFailureCallback;
5274 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5276 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x15) on endpoint %" PRIu16, endpointId);
5278 chip::Controller::DoorLockCluster cluster;
5279 cluster.Associate(device, endpointId);
5280 return cluster.GetUserType(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
5284 chip::Callback::Callback<DoorLockClusterGetUserTypeResponseCallback> * onSuccessCallback =
5285 new chip::Callback::Callback<DoorLockClusterGetUserTypeResponseCallback>(OnDoorLockClusterGetUserTypeResponse, this);
5286 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5287 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5292 * Command GetWeekdaySchedule
5294 class DoorLockGetWeekdaySchedule : public ModelCommand
5297 DoorLockGetWeekdaySchedule() : ModelCommand("get-weekday-schedule")
5299 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
5300 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5301 ModelCommand::AddArguments();
5303 ~DoorLockGetWeekdaySchedule()
5305 delete onSuccessCallback;
5306 delete onFailureCallback;
5309 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5311 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0C) on endpoint %" PRIu16, endpointId);
5313 chip::Controller::DoorLockCluster cluster;
5314 cluster.Associate(device, endpointId);
5315 return cluster.GetWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
5319 chip::Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback> * onSuccessCallback =
5320 new chip::Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback>(OnDoorLockClusterGetWeekdayScheduleResponse,
5322 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5323 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5324 uint8_t mScheduleId;
5329 * Command GetYeardaySchedule
5331 class DoorLockGetYeardaySchedule : public ModelCommand
5334 DoorLockGetYeardaySchedule() : ModelCommand("get-yearday-schedule")
5336 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
5337 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5338 ModelCommand::AddArguments();
5340 ~DoorLockGetYeardaySchedule()
5342 delete onSuccessCallback;
5343 delete onFailureCallback;
5346 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5348 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0F) on endpoint %" PRIu16, endpointId);
5350 chip::Controller::DoorLockCluster cluster;
5351 cluster.Associate(device, endpointId);
5352 return cluster.GetYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
5356 chip::Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback> * onSuccessCallback =
5357 new chip::Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback>(OnDoorLockClusterGetYeardayScheduleResponse,
5359 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5360 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5361 uint8_t mScheduleId;
5368 class DoorLockLockDoor : public ModelCommand
5371 DoorLockLockDoor() : ModelCommand("lock-door")
5373 AddArgument("pin", &mPin);
5374 ModelCommand::AddArguments();
5378 delete onSuccessCallback;
5379 delete onFailureCallback;
5382 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5384 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);
5386 chip::Controller::DoorLockCluster cluster;
5387 cluster.Associate(device, endpointId);
5388 return cluster.LockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
5389 chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
5393 chip::Callback::Callback<DoorLockClusterLockDoorResponseCallback> * onSuccessCallback =
5394 new chip::Callback::Callback<DoorLockClusterLockDoorResponseCallback>(OnDoorLockClusterLockDoorResponse, this);
5395 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5396 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5401 * Command SetHolidaySchedule
5403 class DoorLockSetHolidaySchedule : public ModelCommand
5406 DoorLockSetHolidaySchedule() : ModelCommand("set-holiday-schedule")
5408 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
5409 AddArgument("localStartTime", 0, UINT32_MAX, &mLocalStartTime);
5410 AddArgument("localEndTime", 0, UINT32_MAX, &mLocalEndTime);
5411 AddArgument("operatingModeDuringHoliday", 0, UINT8_MAX, &mOperatingModeDuringHoliday);
5412 ModelCommand::AddArguments();
5414 ~DoorLockSetHolidaySchedule()
5416 delete onSuccessCallback;
5417 delete onFailureCallback;
5420 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5422 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x11) on endpoint %" PRIu16, endpointId);
5424 chip::Controller::DoorLockCluster cluster;
5425 cluster.Associate(device, endpointId);
5426 return cluster.SetHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mLocalStartTime,
5427 mLocalEndTime, mOperatingModeDuringHoliday);
5431 chip::Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback> * onSuccessCallback =
5432 new chip::Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback>(OnDoorLockClusterSetHolidayScheduleResponse,
5434 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5435 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5436 uint8_t mScheduleId;
5437 uint32_t mLocalStartTime;
5438 uint32_t mLocalEndTime;
5439 uint8_t mOperatingModeDuringHoliday;
5445 class DoorLockSetPin : public ModelCommand
5448 DoorLockSetPin() : ModelCommand("set-pin")
5450 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5451 AddArgument("userStatus", 0, UINT8_MAX, &mUserStatus);
5452 AddArgument("userType", 0, UINT8_MAX, &mUserType);
5453 AddArgument("pin", &mPin);
5454 ModelCommand::AddArguments();
5458 delete onSuccessCallback;
5459 delete onFailureCallback;
5462 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5464 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x05) on endpoint %" PRIu16, endpointId);
5466 chip::Controller::DoorLockCluster cluster;
5467 cluster.Associate(device, endpointId);
5468 return cluster.SetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
5469 chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
5473 chip::Callback::Callback<DoorLockClusterSetPinResponseCallback> * onSuccessCallback =
5474 new chip::Callback::Callback<DoorLockClusterSetPinResponseCallback>(OnDoorLockClusterSetPinResponse, this);
5475 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5476 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5478 uint8_t mUserStatus;
5486 class DoorLockSetRfid : public ModelCommand
5489 DoorLockSetRfid() : ModelCommand("set-rfid")
5491 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5492 AddArgument("userStatus", 0, UINT8_MAX, &mUserStatus);
5493 AddArgument("userType", 0, UINT8_MAX, &mUserType);
5494 AddArgument("id", &mId);
5495 ModelCommand::AddArguments();
5499 delete onSuccessCallback;
5500 delete onFailureCallback;
5503 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5505 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x16) on endpoint %" PRIu16, endpointId);
5507 chip::Controller::DoorLockCluster cluster;
5508 cluster.Associate(device, endpointId);
5509 return cluster.SetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
5510 chip::ByteSpan(chip::Uint8::from_char(mId), strlen(mId)));
5514 chip::Callback::Callback<DoorLockClusterSetRfidResponseCallback> * onSuccessCallback =
5515 new chip::Callback::Callback<DoorLockClusterSetRfidResponseCallback>(OnDoorLockClusterSetRfidResponse, this);
5516 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5517 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5519 uint8_t mUserStatus;
5525 * Command SetUserType
5527 class DoorLockSetUserType : public ModelCommand
5530 DoorLockSetUserType() : ModelCommand("set-user-type")
5532 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5533 AddArgument("userType", 0, UINT8_MAX, &mUserType);
5534 ModelCommand::AddArguments();
5536 ~DoorLockSetUserType()
5538 delete onSuccessCallback;
5539 delete onFailureCallback;
5542 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5544 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x14) on endpoint %" PRIu16, endpointId);
5546 chip::Controller::DoorLockCluster cluster;
5547 cluster.Associate(device, endpointId);
5548 return cluster.SetUserType(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserType);
5552 chip::Callback::Callback<DoorLockClusterSetUserTypeResponseCallback> * onSuccessCallback =
5553 new chip::Callback::Callback<DoorLockClusterSetUserTypeResponseCallback>(OnDoorLockClusterSetUserTypeResponse, this);
5554 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5555 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5561 * Command SetWeekdaySchedule
5563 class DoorLockSetWeekdaySchedule : public ModelCommand
5566 DoorLockSetWeekdaySchedule() : ModelCommand("set-weekday-schedule")
5568 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
5569 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5570 AddArgument("daysMask", 0, UINT8_MAX, &mDaysMask);
5571 AddArgument("startHour", 0, UINT8_MAX, &mStartHour);
5572 AddArgument("startMinute", 0, UINT8_MAX, &mStartMinute);
5573 AddArgument("endHour", 0, UINT8_MAX, &mEndHour);
5574 AddArgument("endMinute", 0, UINT8_MAX, &mEndMinute);
5575 ModelCommand::AddArguments();
5577 ~DoorLockSetWeekdaySchedule()
5579 delete onSuccessCallback;
5580 delete onFailureCallback;
5583 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5585 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0B) on endpoint %" PRIu16, endpointId);
5587 chip::Controller::DoorLockCluster cluster;
5588 cluster.Associate(device, endpointId);
5589 return cluster.SetWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId, mDaysMask,
5590 mStartHour, mStartMinute, mEndHour, mEndMinute);
5594 chip::Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback> * onSuccessCallback =
5595 new chip::Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback>(OnDoorLockClusterSetWeekdayScheduleResponse,
5597 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5598 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5599 uint8_t mScheduleId;
5603 uint8_t mStartMinute;
5609 * Command SetYeardaySchedule
5611 class DoorLockSetYeardaySchedule : public ModelCommand
5614 DoorLockSetYeardaySchedule() : ModelCommand("set-yearday-schedule")
5616 AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
5617 AddArgument("userId", 0, UINT16_MAX, &mUserId);
5618 AddArgument("localStartTime", 0, UINT32_MAX, &mLocalStartTime);
5619 AddArgument("localEndTime", 0, UINT32_MAX, &mLocalEndTime);
5620 ModelCommand::AddArguments();
5622 ~DoorLockSetYeardaySchedule()
5624 delete onSuccessCallback;
5625 delete onFailureCallback;
5628 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5630 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0E) on endpoint %" PRIu16, endpointId);
5632 chip::Controller::DoorLockCluster cluster;
5633 cluster.Associate(device, endpointId);
5634 return cluster.SetYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId,
5635 mLocalStartTime, mLocalEndTime);
5639 chip::Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback> * onSuccessCallback =
5640 new chip::Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback>(OnDoorLockClusterSetYeardayScheduleResponse,
5642 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5643 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5644 uint8_t mScheduleId;
5646 uint32_t mLocalStartTime;
5647 uint32_t mLocalEndTime;
5651 * Command UnlockDoor
5653 class DoorLockUnlockDoor : public ModelCommand
5656 DoorLockUnlockDoor() : ModelCommand("unlock-door")
5658 AddArgument("pin", &mPin);
5659 ModelCommand::AddArguments();
5661 ~DoorLockUnlockDoor()
5663 delete onSuccessCallback;
5664 delete onFailureCallback;
5667 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5669 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x01) on endpoint %" PRIu16, endpointId);
5671 chip::Controller::DoorLockCluster cluster;
5672 cluster.Associate(device, endpointId);
5673 return cluster.UnlockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
5674 chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
5678 chip::Callback::Callback<DoorLockClusterUnlockDoorResponseCallback> * onSuccessCallback =
5679 new chip::Callback::Callback<DoorLockClusterUnlockDoorResponseCallback>(OnDoorLockClusterUnlockDoorResponse, this);
5680 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5681 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5686 * Command UnlockWithTimeout
5688 class DoorLockUnlockWithTimeout : public ModelCommand
5691 DoorLockUnlockWithTimeout() : ModelCommand("unlock-with-timeout")
5693 AddArgument("timeoutInSeconds", 0, UINT16_MAX, &mTimeoutInSeconds);
5694 AddArgument("pin", &mPin);
5695 ModelCommand::AddArguments();
5697 ~DoorLockUnlockWithTimeout()
5699 delete onSuccessCallback;
5700 delete onFailureCallback;
5703 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5705 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x03) on endpoint %" PRIu16, endpointId);
5707 chip::Controller::DoorLockCluster cluster;
5708 cluster.Associate(device, endpointId);
5709 return cluster.UnlockWithTimeout(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTimeoutInSeconds,
5710 chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
5714 chip::Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback> * onSuccessCallback =
5715 new chip::Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback>(OnDoorLockClusterUnlockWithTimeoutResponse,
5717 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5718 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5719 uint16_t mTimeoutInSeconds;
5724 * Discover Attributes
5726 class DiscoverDoorLockAttributes : public ModelCommand
5729 DiscoverDoorLockAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
5731 ~DiscoverDoorLockAttributes()
5733 delete onSuccessCallback;
5734 delete onFailureCallback;
5737 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5739 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
5741 chip::Controller::DoorLockCluster cluster;
5742 cluster.Associate(device, endpointId);
5743 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5747 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5748 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5749 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5750 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5754 * Attribute LockState
5756 class ReadDoorLockLockState : public ModelCommand
5759 ReadDoorLockLockState() : ModelCommand("read")
5761 AddArgument("attr-name", "lock-state");
5762 ModelCommand::AddArguments();
5765 ~ReadDoorLockLockState()
5767 delete onSuccessCallback;
5768 delete onFailureCallback;
5771 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5773 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);
5775 chip::Controller::DoorLockCluster cluster;
5776 cluster.Associate(device, endpointId);
5777 return cluster.ReadAttributeLockState(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5781 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
5782 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
5783 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5784 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5787 class ReportDoorLockLockState : public ModelCommand
5790 ReportDoorLockLockState() : ModelCommand("report")
5792 AddArgument("attr-name", "lock-state");
5793 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
5794 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
5795 ModelCommand::AddArguments();
5798 ~ReportDoorLockLockState()
5800 delete onSuccessCallback;
5801 delete onFailureCallback;
5802 delete onReportCallback;
5805 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5807 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x06) on endpoint %" PRIu16, endpointId);
5809 chip::Controller::DoorLockCluster cluster;
5810 cluster.Associate(device, endpointId);
5812 CHIP_ERROR err = cluster.ReportAttributeLockState(onReportCallback->Cancel());
5813 if (err != CHIP_NO_ERROR)
5818 return cluster.ConfigureAttributeLockState(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
5823 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
5824 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
5825 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5826 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5827 chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
5828 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
5829 uint16_t mMinInterval;
5830 uint16_t mMaxInterval;
5834 * Attribute LockType
5836 class ReadDoorLockLockType : public ModelCommand
5839 ReadDoorLockLockType() : ModelCommand("read")
5841 AddArgument("attr-name", "lock-type");
5842 ModelCommand::AddArguments();
5845 ~ReadDoorLockLockType()
5847 delete onSuccessCallback;
5848 delete onFailureCallback;
5851 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5853 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);
5855 chip::Controller::DoorLockCluster cluster;
5856 cluster.Associate(device, endpointId);
5857 return cluster.ReadAttributeLockType(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5861 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
5862 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
5863 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5864 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5868 * Attribute ActuatorEnabled
5870 class ReadDoorLockActuatorEnabled : public ModelCommand
5873 ReadDoorLockActuatorEnabled() : ModelCommand("read")
5875 AddArgument("attr-name", "actuator-enabled");
5876 ModelCommand::AddArguments();
5879 ~ReadDoorLockActuatorEnabled()
5881 delete onSuccessCallback;
5882 delete onFailureCallback;
5885 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5887 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);
5889 chip::Controller::DoorLockCluster cluster;
5890 cluster.Associate(device, endpointId);
5891 return cluster.ReadAttributeActuatorEnabled(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5895 chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
5896 new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
5897 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5898 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5902 * Attribute ClusterRevision
5904 class ReadDoorLockClusterRevision : public ModelCommand
5907 ReadDoorLockClusterRevision() : ModelCommand("read")
5909 AddArgument("attr-name", "cluster-revision");
5910 ModelCommand::AddArguments();
5913 ~ReadDoorLockClusterRevision()
5915 delete onSuccessCallback;
5916 delete onFailureCallback;
5919 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5921 ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);
5923 chip::Controller::DoorLockCluster cluster;
5924 cluster.Associate(device, endpointId);
5925 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
5929 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
5930 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
5931 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5932 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5935 /*----------------------------------------------------------------------------*\
5936 | Cluster GeneralCommissioning | 0x0030 |
5937 |------------------------------------------------------------------------------|
5939 | * ArmFailSafe | 0x02 |
5940 | * CommissioningComplete | 0x06 |
5941 | * SetFabric | 0x00 |
5942 |------------------------------------------------------------------------------|
5944 | * FabricId | 0x0000 |
5945 | * Breadcrumb | 0x0001 |
5946 | * ClusterRevision | 0xFFFD |
5947 \*----------------------------------------------------------------------------*/
5950 * Command ArmFailSafe
5952 class GeneralCommissioningArmFailSafe : public ModelCommand
5955 GeneralCommissioningArmFailSafe() : ModelCommand("arm-fail-safe")
5957 AddArgument("expiryLengthSeconds", 0, UINT16_MAX, &mExpiryLengthSeconds);
5958 AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
5959 AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
5960 ModelCommand::AddArguments();
5962 ~GeneralCommissioningArmFailSafe()
5964 delete onSuccessCallback;
5965 delete onFailureCallback;
5968 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
5970 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x02) on endpoint %" PRIu16, endpointId);
5972 chip::Controller::GeneralCommissioningCluster cluster;
5973 cluster.Associate(device, endpointId);
5974 return cluster.ArmFailSafe(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mExpiryLengthSeconds, mBreadcrumb,
5979 chip::Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback> * onSuccessCallback =
5980 new chip::Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback>(
5981 OnGeneralCommissioningClusterArmFailSafeResponse, this);
5982 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
5983 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
5984 uint16_t mExpiryLengthSeconds;
5985 uint64_t mBreadcrumb;
5986 uint32_t mTimeoutMs;
5990 * Command CommissioningComplete
5992 class GeneralCommissioningCommissioningComplete : public ModelCommand
5995 GeneralCommissioningCommissioningComplete() : ModelCommand("commissioning-complete") { ModelCommand::AddArguments(); }
5996 ~GeneralCommissioningCommissioningComplete()
5998 delete onSuccessCallback;
5999 delete onFailureCallback;
6002 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6004 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x06) on endpoint %" PRIu16, endpointId);
6006 chip::Controller::GeneralCommissioningCluster cluster;
6007 cluster.Associate(device, endpointId);
6008 return cluster.CommissioningComplete(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6012 chip::Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback> * onSuccessCallback =
6013 new chip::Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback>(
6014 OnGeneralCommissioningClusterCommissioningCompleteResponse, this);
6015 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6016 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6022 class GeneralCommissioningSetFabric : public ModelCommand
6025 GeneralCommissioningSetFabric() : ModelCommand("set-fabric")
6027 AddArgument("fabricId", &mFabricId);
6028 AddArgument("fabricSecret", &mFabricSecret);
6029 AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
6030 AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
6031 ModelCommand::AddArguments();
6033 ~GeneralCommissioningSetFabric()
6035 delete onSuccessCallback;
6036 delete onFailureCallback;
6039 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6041 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);
6043 chip::Controller::GeneralCommissioningCluster cluster;
6044 cluster.Associate(device, endpointId);
6045 return cluster.SetFabric(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
6046 chip::ByteSpan(chip::Uint8::from_char(mFabricId), strlen(mFabricId)),
6047 chip::ByteSpan(chip::Uint8::from_char(mFabricSecret), strlen(mFabricSecret)), mBreadcrumb,
6052 chip::Callback::Callback<GeneralCommissioningClusterSetFabricResponseCallback> * onSuccessCallback =
6053 new chip::Callback::Callback<GeneralCommissioningClusterSetFabricResponseCallback>(
6054 OnGeneralCommissioningClusterSetFabricResponse, this);
6055 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6056 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6058 char * mFabricSecret;
6059 uint64_t mBreadcrumb;
6060 uint32_t mTimeoutMs;
6064 * Discover Attributes
6066 class DiscoverGeneralCommissioningAttributes : public ModelCommand
6069 DiscoverGeneralCommissioningAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
6071 ~DiscoverGeneralCommissioningAttributes()
6073 delete onSuccessCallback;
6074 delete onFailureCallback;
6077 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6079 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
6081 chip::Controller::GeneralCommissioningCluster cluster;
6082 cluster.Associate(device, endpointId);
6083 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6087 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6088 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6089 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6090 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6094 * Attribute FabricId
6096 class ReadGeneralCommissioningFabricId : public ModelCommand
6099 ReadGeneralCommissioningFabricId() : ModelCommand("read")
6101 AddArgument("attr-name", "fabric-id");
6102 ModelCommand::AddArguments();
6105 ~ReadGeneralCommissioningFabricId()
6107 delete onSuccessCallback;
6108 delete onFailureCallback;
6111 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6113 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);
6115 chip::Controller::GeneralCommissioningCluster cluster;
6116 cluster.Associate(device, endpointId);
6117 return cluster.ReadAttributeFabricId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6121 chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
6122 new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
6123 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6124 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6128 * Attribute Breadcrumb
6130 class ReadGeneralCommissioningBreadcrumb : public ModelCommand
6133 ReadGeneralCommissioningBreadcrumb() : ModelCommand("read")
6135 AddArgument("attr-name", "breadcrumb");
6136 ModelCommand::AddArguments();
6139 ~ReadGeneralCommissioningBreadcrumb()
6141 delete onSuccessCallback;
6142 delete onFailureCallback;
6145 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6147 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);
6149 chip::Controller::GeneralCommissioningCluster cluster;
6150 cluster.Associate(device, endpointId);
6151 return cluster.ReadAttributeBreadcrumb(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6155 chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
6156 new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
6157 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6158 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6161 class WriteGeneralCommissioningBreadcrumb : public ModelCommand
6164 WriteGeneralCommissioningBreadcrumb() : ModelCommand("write")
6166 AddArgument("attr-name", "breadcrumb");
6167 AddArgument("attr-value", 0, UINT64_MAX, &mValue);
6168 ModelCommand::AddArguments();
6171 ~WriteGeneralCommissioningBreadcrumb()
6173 delete onSuccessCallback;
6174 delete onFailureCallback;
6177 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6179 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x01) on endpoint %" PRIu16, endpointId);
6181 chip::Controller::GeneralCommissioningCluster cluster;
6182 cluster.Associate(device, endpointId);
6183 return cluster.WriteAttributeBreadcrumb(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
6187 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6188 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6189 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6190 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6195 * Attribute ClusterRevision
6197 class ReadGeneralCommissioningClusterRevision : public ModelCommand
6200 ReadGeneralCommissioningClusterRevision() : ModelCommand("read")
6202 AddArgument("attr-name", "cluster-revision");
6203 ModelCommand::AddArguments();
6206 ~ReadGeneralCommissioningClusterRevision()
6208 delete onSuccessCallback;
6209 delete onFailureCallback;
6212 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6214 ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);
6216 chip::Controller::GeneralCommissioningCluster cluster;
6217 cluster.Associate(device, endpointId);
6218 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6222 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
6223 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
6224 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6225 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6228 /*----------------------------------------------------------------------------*\
6229 | Cluster Groups | 0x0004 |
6230 |------------------------------------------------------------------------------|
6232 | * AddGroup | 0x00 |
6233 | * AddGroupIfIdentifying | 0x05 |
6234 | * GetGroupMembership | 0x02 |
6235 | * RemoveAllGroups | 0x04 |
6236 | * RemoveGroup | 0x03 |
6237 | * ViewGroup | 0x01 |
6238 |------------------------------------------------------------------------------|
6240 | * NameSupport | 0x0000 |
6241 | * ClusterRevision | 0xFFFD |
6242 \*----------------------------------------------------------------------------*/
6247 class GroupsAddGroup : public ModelCommand
6250 GroupsAddGroup() : ModelCommand("add-group")
6252 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
6253 AddArgument("groupName", &mGroupName);
6254 ModelCommand::AddArguments();
6258 delete onSuccessCallback;
6259 delete onFailureCallback;
6262 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6264 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu16, endpointId);
6266 chip::Controller::GroupsCluster cluster;
6267 cluster.Associate(device, endpointId);
6268 return cluster.AddGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
6269 chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
6273 chip::Callback::Callback<GroupsClusterAddGroupResponseCallback> * onSuccessCallback =
6274 new chip::Callback::Callback<GroupsClusterAddGroupResponseCallback>(OnGroupsClusterAddGroupResponse, this);
6275 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6276 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6282 * Command AddGroupIfIdentifying
6284 class GroupsAddGroupIfIdentifying : public ModelCommand
6287 GroupsAddGroupIfIdentifying() : ModelCommand("add-group-if-identifying")
6289 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
6290 AddArgument("groupName", &mGroupName);
6291 ModelCommand::AddArguments();
6293 ~GroupsAddGroupIfIdentifying()
6295 delete onSuccessCallback;
6296 delete onFailureCallback;
6299 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6301 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x05) on endpoint %" PRIu16, endpointId);
6303 chip::Controller::GroupsCluster cluster;
6304 cluster.Associate(device, endpointId);
6305 return cluster.AddGroupIfIdentifying(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
6306 chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
6310 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6311 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6312 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6313 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6319 * Command GetGroupMembership
6321 class GroupsGetGroupMembership : public ModelCommand
6324 GroupsGetGroupMembership() : ModelCommand("get-group-membership")
6326 AddArgument("groupCount", 0, UINT8_MAX, &mGroupCount);
6327 AddArgument("groupList", 0, UINT16_MAX, &mGroupList);
6328 ModelCommand::AddArguments();
6330 ~GroupsGetGroupMembership()
6332 delete onSuccessCallback;
6333 delete onFailureCallback;
6336 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6338 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x02) on endpoint %" PRIu16, endpointId);
6340 chip::Controller::GroupsCluster cluster;
6341 cluster.Associate(device, endpointId);
6342 return cluster.GetGroupMembership(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupCount, mGroupList);
6346 chip::Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback> * onSuccessCallback =
6347 new chip::Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback>(OnGroupsClusterGetGroupMembershipResponse,
6349 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6350 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6351 uint8_t mGroupCount;
6352 uint16_t mGroupList;
6356 * Command RemoveAllGroups
6358 class GroupsRemoveAllGroups : public ModelCommand
6361 GroupsRemoveAllGroups() : ModelCommand("remove-all-groups") { ModelCommand::AddArguments(); }
6362 ~GroupsRemoveAllGroups()
6364 delete onSuccessCallback;
6365 delete onFailureCallback;
6368 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6370 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x04) on endpoint %" PRIu16, endpointId);
6372 chip::Controller::GroupsCluster cluster;
6373 cluster.Associate(device, endpointId);
6374 return cluster.RemoveAllGroups(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6378 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6379 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6380 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6381 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6385 * Command RemoveGroup
6387 class GroupsRemoveGroup : public ModelCommand
6390 GroupsRemoveGroup() : ModelCommand("remove-group")
6392 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
6393 ModelCommand::AddArguments();
6395 ~GroupsRemoveGroup()
6397 delete onSuccessCallback;
6398 delete onFailureCallback;
6401 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6403 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x03) on endpoint %" PRIu16, endpointId);
6405 chip::Controller::GroupsCluster cluster;
6406 cluster.Associate(device, endpointId);
6407 return cluster.RemoveGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
6411 chip::Callback::Callback<GroupsClusterRemoveGroupResponseCallback> * onSuccessCallback =
6412 new chip::Callback::Callback<GroupsClusterRemoveGroupResponseCallback>(OnGroupsClusterRemoveGroupResponse, this);
6413 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6414 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6421 class GroupsViewGroup : public ModelCommand
6424 GroupsViewGroup() : ModelCommand("view-group")
6426 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
6427 ModelCommand::AddArguments();
6431 delete onSuccessCallback;
6432 delete onFailureCallback;
6435 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6437 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x01) on endpoint %" PRIu16, endpointId);
6439 chip::Controller::GroupsCluster cluster;
6440 cluster.Associate(device, endpointId);
6441 return cluster.ViewGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
6445 chip::Callback::Callback<GroupsClusterViewGroupResponseCallback> * onSuccessCallback =
6446 new chip::Callback::Callback<GroupsClusterViewGroupResponseCallback>(OnGroupsClusterViewGroupResponse, this);
6447 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6448 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6453 * Discover Attributes
6455 class DiscoverGroupsAttributes : public ModelCommand
6458 DiscoverGroupsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
6460 ~DiscoverGroupsAttributes()
6462 delete onSuccessCallback;
6463 delete onFailureCallback;
6466 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6468 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
6470 chip::Controller::GroupsCluster cluster;
6471 cluster.Associate(device, endpointId);
6472 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6476 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6477 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6478 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6479 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6483 * Attribute NameSupport
6485 class ReadGroupsNameSupport : public ModelCommand
6488 ReadGroupsNameSupport() : ModelCommand("read")
6490 AddArgument("attr-name", "name-support");
6491 ModelCommand::AddArguments();
6494 ~ReadGroupsNameSupport()
6496 delete onSuccessCallback;
6497 delete onFailureCallback;
6500 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6502 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu16, endpointId);
6504 chip::Controller::GroupsCluster cluster;
6505 cluster.Associate(device, endpointId);
6506 return cluster.ReadAttributeNameSupport(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6510 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
6511 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
6512 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6513 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6517 * Attribute ClusterRevision
6519 class ReadGroupsClusterRevision : public ModelCommand
6522 ReadGroupsClusterRevision() : ModelCommand("read")
6524 AddArgument("attr-name", "cluster-revision");
6525 ModelCommand::AddArguments();
6528 ~ReadGroupsClusterRevision()
6530 delete onSuccessCallback;
6531 delete onFailureCallback;
6534 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6536 ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu16, endpointId);
6538 chip::Controller::GroupsCluster cluster;
6539 cluster.Associate(device, endpointId);
6540 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6544 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
6545 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
6546 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6547 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6550 /*----------------------------------------------------------------------------*\
6551 | Cluster Identify | 0x0003 |
6552 |------------------------------------------------------------------------------|
6554 | * Identify | 0x00 |
6555 | * IdentifyQuery | 0x01 |
6556 |------------------------------------------------------------------------------|
6558 | * IdentifyTime | 0x0000 |
6559 | * ClusterRevision | 0xFFFD |
6560 \*----------------------------------------------------------------------------*/
6565 class IdentifyIdentify : public ModelCommand
6568 IdentifyIdentify() : ModelCommand("identify")
6570 AddArgument("identifyTime", 0, UINT16_MAX, &mIdentifyTime);
6571 ModelCommand::AddArguments();
6575 delete onSuccessCallback;
6576 delete onFailureCallback;
6579 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6581 ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu16, endpointId);
6583 chip::Controller::IdentifyCluster cluster;
6584 cluster.Associate(device, endpointId);
6585 return cluster.Identify(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIdentifyTime);
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);
6593 uint16_t mIdentifyTime;
6597 * Command IdentifyQuery
6599 class IdentifyIdentifyQuery : public ModelCommand
6602 IdentifyIdentifyQuery() : ModelCommand("identify-query") { ModelCommand::AddArguments(); }
6603 ~IdentifyIdentifyQuery()
6605 delete onSuccessCallback;
6606 delete onFailureCallback;
6609 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6611 ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x01) on endpoint %" PRIu16, endpointId);
6613 chip::Controller::IdentifyCluster cluster;
6614 cluster.Associate(device, endpointId);
6615 return cluster.IdentifyQuery(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6619 chip::Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback> * onSuccessCallback =
6620 new chip::Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback>(OnIdentifyClusterIdentifyQueryResponse, this);
6621 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6622 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6626 * Discover Attributes
6628 class DiscoverIdentifyAttributes : public ModelCommand
6631 DiscoverIdentifyAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
6633 ~DiscoverIdentifyAttributes()
6635 delete onSuccessCallback;
6636 delete onFailureCallback;
6639 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6641 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
6643 chip::Controller::IdentifyCluster cluster;
6644 cluster.Associate(device, endpointId);
6645 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6649 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6650 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6651 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6652 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6656 * Attribute IdentifyTime
6658 class ReadIdentifyIdentifyTime : public ModelCommand
6661 ReadIdentifyIdentifyTime() : ModelCommand("read")
6663 AddArgument("attr-name", "identify-time");
6664 ModelCommand::AddArguments();
6667 ~ReadIdentifyIdentifyTime()
6669 delete onSuccessCallback;
6670 delete onFailureCallback;
6673 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6675 ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu16, endpointId);
6677 chip::Controller::IdentifyCluster cluster;
6678 cluster.Associate(device, endpointId);
6679 return cluster.ReadAttributeIdentifyTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6683 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
6684 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
6685 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6686 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6689 class WriteIdentifyIdentifyTime : public ModelCommand
6692 WriteIdentifyIdentifyTime() : ModelCommand("write")
6694 AddArgument("attr-name", "identify-time");
6695 AddArgument("attr-value", 0, UINT16_MAX, &mValue);
6696 ModelCommand::AddArguments();
6699 ~WriteIdentifyIdentifyTime()
6701 delete onSuccessCallback;
6702 delete onFailureCallback;
6705 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6707 ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x01) on endpoint %" PRIu16, endpointId);
6709 chip::Controller::IdentifyCluster cluster;
6710 cluster.Associate(device, endpointId);
6711 return cluster.WriteAttributeIdentifyTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
6715 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6716 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6717 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6718 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6723 * Attribute ClusterRevision
6725 class ReadIdentifyClusterRevision : public ModelCommand
6728 ReadIdentifyClusterRevision() : ModelCommand("read")
6730 AddArgument("attr-name", "cluster-revision");
6731 ModelCommand::AddArguments();
6734 ~ReadIdentifyClusterRevision()
6736 delete onSuccessCallback;
6737 delete onFailureCallback;
6740 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6742 ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu16, endpointId);
6744 chip::Controller::IdentifyCluster cluster;
6745 cluster.Associate(device, endpointId);
6746 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
6750 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
6751 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
6752 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6753 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6756 /*----------------------------------------------------------------------------*\
6757 | Cluster LevelControl | 0x0008 |
6758 |------------------------------------------------------------------------------|
6761 | * MoveToLevel | 0x00 |
6762 | * MoveToLevelWithOnOff | 0x04 |
6763 | * MoveWithOnOff | 0x05 |
6765 | * StepWithOnOff | 0x06 |
6767 | * StopWithOnOff | 0x07 |
6768 |------------------------------------------------------------------------------|
6770 | * CurrentLevel | 0x0000 |
6771 | * ClusterRevision | 0xFFFD |
6772 \*----------------------------------------------------------------------------*/
6777 class LevelControlMove : public ModelCommand
6780 LevelControlMove() : ModelCommand("move")
6782 AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
6783 AddArgument("rate", 0, UINT8_MAX, &mRate);
6784 AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
6785 AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
6786 ModelCommand::AddArguments();
6790 delete onSuccessCallback;
6791 delete onFailureCallback;
6794 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6796 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x01) on endpoint %" PRIu16, endpointId);
6798 chip::Controller::LevelControlCluster cluster;
6799 cluster.Associate(device, endpointId);
6800 return cluster.Move(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionMask,
6805 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6806 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6807 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6808 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6811 uint8_t mOptionMask;
6812 uint8_t mOptionOverride;
6816 * Command MoveToLevel
6818 class LevelControlMoveToLevel : public ModelCommand
6821 LevelControlMoveToLevel() : ModelCommand("move-to-level")
6823 AddArgument("level", 0, UINT8_MAX, &mLevel);
6824 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
6825 AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
6826 AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
6827 ModelCommand::AddArguments();
6829 ~LevelControlMoveToLevel()
6831 delete onSuccessCallback;
6832 delete onFailureCallback;
6835 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6837 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu16, endpointId);
6839 chip::Controller::LevelControlCluster cluster;
6840 cluster.Associate(device, endpointId);
6841 return cluster.MoveToLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLevel, mTransitionTime, mOptionMask,
6846 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6847 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6848 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6849 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6851 uint16_t mTransitionTime;
6852 uint8_t mOptionMask;
6853 uint8_t mOptionOverride;
6857 * Command MoveToLevelWithOnOff
6859 class LevelControlMoveToLevelWithOnOff : public ModelCommand
6862 LevelControlMoveToLevelWithOnOff() : ModelCommand("move-to-level-with-on-off")
6864 AddArgument("level", 0, UINT8_MAX, &mLevel);
6865 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
6866 ModelCommand::AddArguments();
6868 ~LevelControlMoveToLevelWithOnOff()
6870 delete onSuccessCallback;
6871 delete onFailureCallback;
6874 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6876 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x04) on endpoint %" PRIu16, endpointId);
6878 chip::Controller::LevelControlCluster cluster;
6879 cluster.Associate(device, endpointId);
6880 return cluster.MoveToLevelWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLevel, mTransitionTime);
6884 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6885 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6886 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6887 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6889 uint16_t mTransitionTime;
6893 * Command MoveWithOnOff
6895 class LevelControlMoveWithOnOff : public ModelCommand
6898 LevelControlMoveWithOnOff() : ModelCommand("move-with-on-off")
6900 AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
6901 AddArgument("rate", 0, UINT8_MAX, &mRate);
6902 ModelCommand::AddArguments();
6904 ~LevelControlMoveWithOnOff()
6906 delete onSuccessCallback;
6907 delete onFailureCallback;
6910 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6912 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x05) on endpoint %" PRIu16, endpointId);
6914 chip::Controller::LevelControlCluster cluster;
6915 cluster.Associate(device, endpointId);
6916 return cluster.MoveWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate);
6920 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6921 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6922 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6923 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6931 class LevelControlStep : public ModelCommand
6934 LevelControlStep() : ModelCommand("step")
6936 AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
6937 AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
6938 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
6939 AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
6940 AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
6941 ModelCommand::AddArguments();
6945 delete onSuccessCallback;
6946 delete onFailureCallback;
6949 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6951 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x02) on endpoint %" PRIu16, endpointId);
6953 chip::Controller::LevelControlCluster cluster;
6954 cluster.Associate(device, endpointId);
6955 return cluster.Step(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize, mTransitionTime,
6956 mOptionMask, mOptionOverride);
6960 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
6961 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
6962 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
6963 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
6966 uint16_t mTransitionTime;
6967 uint8_t mOptionMask;
6968 uint8_t mOptionOverride;
6972 * Command StepWithOnOff
6974 class LevelControlStepWithOnOff : public ModelCommand
6977 LevelControlStepWithOnOff() : ModelCommand("step-with-on-off")
6979 AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
6980 AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
6981 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
6982 ModelCommand::AddArguments();
6984 ~LevelControlStepWithOnOff()
6986 delete onSuccessCallback;
6987 delete onFailureCallback;
6990 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
6992 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x06) on endpoint %" PRIu16, endpointId);
6994 chip::Controller::LevelControlCluster cluster;
6995 cluster.Associate(device, endpointId);
6996 return cluster.StepWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
7001 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7002 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7003 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7004 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7007 uint16_t mTransitionTime;
7013 class LevelControlStop : public ModelCommand
7016 LevelControlStop() : ModelCommand("stop")
7018 AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
7019 AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
7020 ModelCommand::AddArguments();
7024 delete onSuccessCallback;
7025 delete onFailureCallback;
7028 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7030 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x03) on endpoint %" PRIu16, endpointId);
7032 chip::Controller::LevelControlCluster cluster;
7033 cluster.Associate(device, endpointId);
7034 return cluster.Stop(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOptionMask, mOptionOverride);
7038 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7039 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7040 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7041 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7042 uint8_t mOptionMask;
7043 uint8_t mOptionOverride;
7047 * Command StopWithOnOff
7049 class LevelControlStopWithOnOff : public ModelCommand
7052 LevelControlStopWithOnOff() : ModelCommand("stop-with-on-off") { ModelCommand::AddArguments(); }
7053 ~LevelControlStopWithOnOff()
7055 delete onSuccessCallback;
7056 delete onFailureCallback;
7059 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7061 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x07) on endpoint %" PRIu16, endpointId);
7063 chip::Controller::LevelControlCluster cluster;
7064 cluster.Associate(device, endpointId);
7065 return cluster.StopWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7069 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7070 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7071 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7072 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7076 * Discover Attributes
7078 class DiscoverLevelControlAttributes : public ModelCommand
7081 DiscoverLevelControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
7083 ~DiscoverLevelControlAttributes()
7085 delete onSuccessCallback;
7086 delete onFailureCallback;
7089 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7091 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
7093 chip::Controller::LevelControlCluster cluster;
7094 cluster.Associate(device, endpointId);
7095 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7099 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7100 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7101 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7102 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7106 * Attribute CurrentLevel
7108 class ReadLevelControlCurrentLevel : public ModelCommand
7111 ReadLevelControlCurrentLevel() : ModelCommand("read")
7113 AddArgument("attr-name", "current-level");
7114 ModelCommand::AddArguments();
7117 ~ReadLevelControlCurrentLevel()
7119 delete onSuccessCallback;
7120 delete onFailureCallback;
7123 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7125 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu16, endpointId);
7127 chip::Controller::LevelControlCluster cluster;
7128 cluster.Associate(device, endpointId);
7129 return cluster.ReadAttributeCurrentLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7133 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
7134 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
7135 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7136 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7139 class ReportLevelControlCurrentLevel : public ModelCommand
7142 ReportLevelControlCurrentLevel() : ModelCommand("report")
7144 AddArgument("attr-name", "current-level");
7145 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
7146 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
7147 AddArgument("change", 0, UINT8_MAX, &mChange);
7148 ModelCommand::AddArguments();
7151 ~ReportLevelControlCurrentLevel()
7153 delete onSuccessCallback;
7154 delete onFailureCallback;
7155 delete onReportCallback;
7158 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7160 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x06) on endpoint %" PRIu16, endpointId);
7162 chip::Controller::LevelControlCluster cluster;
7163 cluster.Associate(device, endpointId);
7165 CHIP_ERROR err = cluster.ReportAttributeCurrentLevel(onReportCallback->Cancel());
7166 if (err != CHIP_NO_ERROR)
7171 return cluster.ConfigureAttributeCurrentLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
7172 mMaxInterval, mChange);
7176 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7177 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7178 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7179 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7180 chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
7181 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
7182 uint16_t mMinInterval;
7183 uint16_t mMaxInterval;
7188 * Attribute ClusterRevision
7190 class ReadLevelControlClusterRevision : public ModelCommand
7193 ReadLevelControlClusterRevision() : ModelCommand("read")
7195 AddArgument("attr-name", "cluster-revision");
7196 ModelCommand::AddArguments();
7199 ~ReadLevelControlClusterRevision()
7201 delete onSuccessCallback;
7202 delete onFailureCallback;
7205 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7207 ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu16, endpointId);
7209 chip::Controller::LevelControlCluster cluster;
7210 cluster.Associate(device, endpointId);
7211 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7215 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
7216 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
7217 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7218 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7221 /*----------------------------------------------------------------------------*\
7222 | Cluster LowPower | 0x0508 |
7223 |------------------------------------------------------------------------------|
7226 |------------------------------------------------------------------------------|
7228 | * ClusterRevision | 0xFFFD |
7229 \*----------------------------------------------------------------------------*/
7234 class LowPowerSleep : public ModelCommand
7237 LowPowerSleep() : ModelCommand("sleep") { ModelCommand::AddArguments(); }
7240 delete onSuccessCallback;
7241 delete onFailureCallback;
7244 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7246 ChipLogProgress(chipTool, "Sending cluster (0x0508) command (0x00) on endpoint %" PRIu16, endpointId);
7248 chip::Controller::LowPowerCluster cluster;
7249 cluster.Associate(device, endpointId);
7250 return cluster.Sleep(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7254 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7255 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7256 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7257 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7261 * Discover Attributes
7263 class DiscoverLowPowerAttributes : public ModelCommand
7266 DiscoverLowPowerAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
7268 ~DiscoverLowPowerAttributes()
7270 delete onSuccessCallback;
7271 delete onFailureCallback;
7274 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7276 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
7278 chip::Controller::LowPowerCluster cluster;
7279 cluster.Associate(device, endpointId);
7280 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7284 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7285 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7286 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7287 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7291 * Attribute ClusterRevision
7293 class ReadLowPowerClusterRevision : public ModelCommand
7296 ReadLowPowerClusterRevision() : ModelCommand("read")
7298 AddArgument("attr-name", "cluster-revision");
7299 ModelCommand::AddArguments();
7302 ~ReadLowPowerClusterRevision()
7304 delete onSuccessCallback;
7305 delete onFailureCallback;
7308 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7310 ChipLogProgress(chipTool, "Sending cluster (0x0508) command (0x00) on endpoint %" PRIu16, endpointId);
7312 chip::Controller::LowPowerCluster cluster;
7313 cluster.Associate(device, endpointId);
7314 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7318 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
7319 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
7320 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7321 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7324 /*----------------------------------------------------------------------------*\
7325 | Cluster OnOff | 0x0006 |
7326 |------------------------------------------------------------------------------|
7331 |------------------------------------------------------------------------------|
7333 | * OnOff | 0x0000 |
7334 | * ClusterRevision | 0xFFFD |
7335 \*----------------------------------------------------------------------------*/
7340 class OnOffOff : public ModelCommand
7343 OnOffOff() : ModelCommand("off") { ModelCommand::AddArguments(); }
7346 delete onSuccessCallback;
7347 delete onFailureCallback;
7350 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7352 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu16, endpointId);
7354 chip::Controller::OnOffCluster cluster;
7355 cluster.Associate(device, endpointId);
7356 return cluster.Off(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7360 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7361 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7362 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7363 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7369 class OnOffOn : public ModelCommand
7372 OnOffOn() : ModelCommand("on") { ModelCommand::AddArguments(); }
7375 delete onSuccessCallback;
7376 delete onFailureCallback;
7379 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7381 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x01) on endpoint %" PRIu16, endpointId);
7383 chip::Controller::OnOffCluster cluster;
7384 cluster.Associate(device, endpointId);
7385 return cluster.On(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7389 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7390 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7391 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7392 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7398 class OnOffToggle : public ModelCommand
7401 OnOffToggle() : ModelCommand("toggle") { ModelCommand::AddArguments(); }
7404 delete onSuccessCallback;
7405 delete onFailureCallback;
7408 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7410 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x02) on endpoint %" PRIu16, endpointId);
7412 chip::Controller::OnOffCluster cluster;
7413 cluster.Associate(device, endpointId);
7414 return cluster.Toggle(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7418 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7419 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7420 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7421 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7425 * Discover Attributes
7427 class DiscoverOnOffAttributes : public ModelCommand
7430 DiscoverOnOffAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
7432 ~DiscoverOnOffAttributes()
7434 delete onSuccessCallback;
7435 delete onFailureCallback;
7438 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7440 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
7442 chip::Controller::OnOffCluster cluster;
7443 cluster.Associate(device, endpointId);
7444 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7448 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7449 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7450 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7451 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7457 class ReadOnOffOnOff : public ModelCommand
7460 ReadOnOffOnOff() : ModelCommand("read")
7462 AddArgument("attr-name", "on-off");
7463 ModelCommand::AddArguments();
7468 delete onSuccessCallback;
7469 delete onFailureCallback;
7472 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7474 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu16, endpointId);
7476 chip::Controller::OnOffCluster cluster;
7477 cluster.Associate(device, endpointId);
7478 return cluster.ReadAttributeOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7482 chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
7483 new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
7484 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7485 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7488 class ReportOnOffOnOff : public ModelCommand
7491 ReportOnOffOnOff() : ModelCommand("report")
7493 AddArgument("attr-name", "on-off");
7494 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
7495 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
7496 ModelCommand::AddArguments();
7501 delete onSuccessCallback;
7502 delete onFailureCallback;
7503 delete onReportCallback;
7506 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7508 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x06) on endpoint %" PRIu16, endpointId);
7510 chip::Controller::OnOffCluster cluster;
7511 cluster.Associate(device, endpointId);
7513 CHIP_ERROR err = cluster.ReportAttributeOnOff(onReportCallback->Cancel());
7514 if (err != CHIP_NO_ERROR)
7519 return cluster.ConfigureAttributeOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
7524 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7525 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7526 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7527 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7528 chip::Callback::Callback<BooleanAttributeCallback> * onReportCallback =
7529 new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
7530 uint16_t mMinInterval;
7531 uint16_t mMaxInterval;
7535 * Attribute ClusterRevision
7537 class ReadOnOffClusterRevision : public ModelCommand
7540 ReadOnOffClusterRevision() : ModelCommand("read")
7542 AddArgument("attr-name", "cluster-revision");
7543 ModelCommand::AddArguments();
7546 ~ReadOnOffClusterRevision()
7548 delete onSuccessCallback;
7549 delete onFailureCallback;
7552 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7554 ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu16, endpointId);
7556 chip::Controller::OnOffCluster cluster;
7557 cluster.Associate(device, endpointId);
7558 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7562 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
7563 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
7564 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7565 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7568 /*----------------------------------------------------------------------------*\
7569 | Cluster Scenes | 0x0005 |
7570 |------------------------------------------------------------------------------|
7572 | * AddScene | 0x00 |
7573 | * GetSceneMembership | 0x06 |
7574 | * RecallScene | 0x05 |
7575 | * RemoveAllScenes | 0x03 |
7576 | * RemoveScene | 0x02 |
7577 | * StoreScene | 0x04 |
7578 | * ViewScene | 0x01 |
7579 |------------------------------------------------------------------------------|
7581 | * SceneCount | 0x0000 |
7582 | * CurrentScene | 0x0001 |
7583 | * CurrentGroup | 0x0002 |
7584 | * SceneValid | 0x0003 |
7585 | * NameSupport | 0x0004 |
7586 | * ClusterRevision | 0xFFFD |
7587 \*----------------------------------------------------------------------------*/
7592 class ScenesAddScene : public ModelCommand
7595 ScenesAddScene() : ModelCommand("add-scene")
7597 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7598 AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
7599 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
7600 AddArgument("sceneName", &mSceneName);
7601 AddArgument("clusterId", 0, UINT16_MAX, &mClusterId);
7602 AddArgument("length", 0, UINT8_MAX, &mLength);
7603 AddArgument("value", 0, UINT8_MAX, &mValue);
7604 ModelCommand::AddArguments();
7608 delete onSuccessCallback;
7609 delete onFailureCallback;
7612 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7614 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
7616 chip::Controller::ScenesCluster cluster;
7617 cluster.Associate(device, endpointId);
7618 return cluster.AddScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId, mTransitionTime,
7619 chip::ByteSpan(chip::Uint8::from_char(mSceneName), strlen(mSceneName)), mClusterId, mLength,
7624 chip::Callback::Callback<ScenesClusterAddSceneResponseCallback> * onSuccessCallback =
7625 new chip::Callback::Callback<ScenesClusterAddSceneResponseCallback>(OnScenesClusterAddSceneResponse, this);
7626 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7627 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7630 uint16_t mTransitionTime;
7632 chip::ClusterId mClusterId;
7638 * Command GetSceneMembership
7640 class ScenesGetSceneMembership : public ModelCommand
7643 ScenesGetSceneMembership() : ModelCommand("get-scene-membership")
7645 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7646 ModelCommand::AddArguments();
7648 ~ScenesGetSceneMembership()
7650 delete onSuccessCallback;
7651 delete onFailureCallback;
7654 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7656 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x06) on endpoint %" PRIu16, endpointId);
7658 chip::Controller::ScenesCluster cluster;
7659 cluster.Associate(device, endpointId);
7660 return cluster.GetSceneMembership(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
7664 chip::Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback> * onSuccessCallback =
7665 new chip::Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback>(OnScenesClusterGetSceneMembershipResponse,
7667 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7668 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7673 * Command RecallScene
7675 class ScenesRecallScene : public ModelCommand
7678 ScenesRecallScene() : ModelCommand("recall-scene")
7680 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7681 AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
7682 AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
7683 ModelCommand::AddArguments();
7685 ~ScenesRecallScene()
7687 delete onSuccessCallback;
7688 delete onFailureCallback;
7691 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7693 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x05) on endpoint %" PRIu16, endpointId);
7695 chip::Controller::ScenesCluster cluster;
7696 cluster.Associate(device, endpointId);
7697 return cluster.RecallScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId, mTransitionTime);
7701 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7702 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7703 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7704 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7707 uint16_t mTransitionTime;
7711 * Command RemoveAllScenes
7713 class ScenesRemoveAllScenes : public ModelCommand
7716 ScenesRemoveAllScenes() : ModelCommand("remove-all-scenes")
7718 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7719 ModelCommand::AddArguments();
7721 ~ScenesRemoveAllScenes()
7723 delete onSuccessCallback;
7724 delete onFailureCallback;
7727 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7729 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x03) on endpoint %" PRIu16, endpointId);
7731 chip::Controller::ScenesCluster cluster;
7732 cluster.Associate(device, endpointId);
7733 return cluster.RemoveAllScenes(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
7737 chip::Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback> * onSuccessCallback =
7738 new chip::Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback>(OnScenesClusterRemoveAllScenesResponse, this);
7739 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7740 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7745 * Command RemoveScene
7747 class ScenesRemoveScene : public ModelCommand
7750 ScenesRemoveScene() : ModelCommand("remove-scene")
7752 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7753 AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
7754 ModelCommand::AddArguments();
7756 ~ScenesRemoveScene()
7758 delete onSuccessCallback;
7759 delete onFailureCallback;
7762 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7764 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x02) on endpoint %" PRIu16, endpointId);
7766 chip::Controller::ScenesCluster cluster;
7767 cluster.Associate(device, endpointId);
7768 return cluster.RemoveScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
7772 chip::Callback::Callback<ScenesClusterRemoveSceneResponseCallback> * onSuccessCallback =
7773 new chip::Callback::Callback<ScenesClusterRemoveSceneResponseCallback>(OnScenesClusterRemoveSceneResponse, this);
7774 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7775 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7781 * Command StoreScene
7783 class ScenesStoreScene : public ModelCommand
7786 ScenesStoreScene() : ModelCommand("store-scene")
7788 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7789 AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
7790 ModelCommand::AddArguments();
7794 delete onSuccessCallback;
7795 delete onFailureCallback;
7798 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7800 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x04) on endpoint %" PRIu16, endpointId);
7802 chip::Controller::ScenesCluster cluster;
7803 cluster.Associate(device, endpointId);
7804 return cluster.StoreScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
7808 chip::Callback::Callback<ScenesClusterStoreSceneResponseCallback> * onSuccessCallback =
7809 new chip::Callback::Callback<ScenesClusterStoreSceneResponseCallback>(OnScenesClusterStoreSceneResponse, this);
7810 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7811 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7819 class ScenesViewScene : public ModelCommand
7822 ScenesViewScene() : ModelCommand("view-scene")
7824 AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
7825 AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
7826 ModelCommand::AddArguments();
7830 delete onSuccessCallback;
7831 delete onFailureCallback;
7834 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7836 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x01) on endpoint %" PRIu16, endpointId);
7838 chip::Controller::ScenesCluster cluster;
7839 cluster.Associate(device, endpointId);
7840 return cluster.ViewScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
7844 chip::Callback::Callback<ScenesClusterViewSceneResponseCallback> * onSuccessCallback =
7845 new chip::Callback::Callback<ScenesClusterViewSceneResponseCallback>(OnScenesClusterViewSceneResponse, this);
7846 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7847 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7853 * Discover Attributes
7855 class DiscoverScenesAttributes : public ModelCommand
7858 DiscoverScenesAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
7860 ~DiscoverScenesAttributes()
7862 delete onSuccessCallback;
7863 delete onFailureCallback;
7866 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7868 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
7870 chip::Controller::ScenesCluster cluster;
7871 cluster.Associate(device, endpointId);
7872 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7876 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
7877 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
7878 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7879 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7883 * Attribute SceneCount
7885 class ReadScenesSceneCount : public ModelCommand
7888 ReadScenesSceneCount() : ModelCommand("read")
7890 AddArgument("attr-name", "scene-count");
7891 ModelCommand::AddArguments();
7894 ~ReadScenesSceneCount()
7896 delete onSuccessCallback;
7897 delete onFailureCallback;
7900 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7902 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
7904 chip::Controller::ScenesCluster cluster;
7905 cluster.Associate(device, endpointId);
7906 return cluster.ReadAttributeSceneCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7910 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
7911 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
7912 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7913 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7917 * Attribute CurrentScene
7919 class ReadScenesCurrentScene : public ModelCommand
7922 ReadScenesCurrentScene() : ModelCommand("read")
7924 AddArgument("attr-name", "current-scene");
7925 ModelCommand::AddArguments();
7928 ~ReadScenesCurrentScene()
7930 delete onSuccessCallback;
7931 delete onFailureCallback;
7934 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7936 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
7938 chip::Controller::ScenesCluster cluster;
7939 cluster.Associate(device, endpointId);
7940 return cluster.ReadAttributeCurrentScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7944 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
7945 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
7946 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7947 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7951 * Attribute CurrentGroup
7953 class ReadScenesCurrentGroup : public ModelCommand
7956 ReadScenesCurrentGroup() : ModelCommand("read")
7958 AddArgument("attr-name", "current-group");
7959 ModelCommand::AddArguments();
7962 ~ReadScenesCurrentGroup()
7964 delete onSuccessCallback;
7965 delete onFailureCallback;
7968 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
7970 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
7972 chip::Controller::ScenesCluster cluster;
7973 cluster.Associate(device, endpointId);
7974 return cluster.ReadAttributeCurrentGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
7978 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
7979 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
7980 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
7981 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
7985 * Attribute SceneValid
7987 class ReadScenesSceneValid : public ModelCommand
7990 ReadScenesSceneValid() : ModelCommand("read")
7992 AddArgument("attr-name", "scene-valid");
7993 ModelCommand::AddArguments();
7996 ~ReadScenesSceneValid()
7998 delete onSuccessCallback;
7999 delete onFailureCallback;
8002 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
8004 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
8006 chip::Controller::ScenesCluster cluster;
8007 cluster.Associate(device, endpointId);
8008 return cluster.ReadAttributeSceneValid(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
8012 chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
8013 new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
8014 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
8015 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
8019 * Attribute NameSupport
8021 class ReadScenesNameSupport : public ModelCommand
8024 ReadScenesNameSupport() : ModelCommand("read")
8026 AddArgument("attr-name", "name-support");
8027 ModelCommand::AddArguments();
8030 ~ReadScenesNameSupport()
8032 delete onSuccessCallback;
8033 delete onFailureCallback;
8036 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
8038 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
8040 chip::Controller::ScenesCluster cluster;
8041 cluster.Associate(device, endpointId);
8042 return cluster.ReadAttributeNameSupport(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
8046 chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
8047 new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
8048 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
8049 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
8053 * Attribute ClusterRevision
8055 class ReadScenesClusterRevision : public ModelCommand
8058 ReadScenesClusterRevision() : ModelCommand("read")
8060 AddArgument("attr-name", "cluster-revision");
8061 ModelCommand::AddArguments();
8064 ~ReadScenesClusterRevision()
8066 delete onSuccessCallback;
8067 delete onFailureCallback;
8070 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
8072 ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);
8074 chip::Controller::ScenesCluster cluster;
8075 cluster.Associate(device, endpointId);
8076 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
8080 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
8081 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
8082 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
8083 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
8086 /*----------------------------------------------------------------------------*\
8087 | Cluster TemperatureMeasurement | 0x0402 |
8088 |------------------------------------------------------------------------------|
8090 |------------------------------------------------------------------------------|
8092 | * MeasuredValue | 0x0000 |
8093 | * MinMeasuredValue | 0x0001 |
8094 | * MaxMeasuredValue | 0x0002 |
8095 | * ClusterRevision | 0xFFFD |
8096 \*----------------------------------------------------------------------------*/
8099 * Discover Attributes
8101 class DiscoverTemperatureMeasurementAttributes : public ModelCommand
8104 DiscoverTemperatureMeasurementAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
8106 ~DiscoverTemperatureMeasurementAttributes()
8108 delete onSuccessCallback;
8109 delete onFailureCallback;
8112 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
8114 ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
8116 chip::Controller::TemperatureMeasurementCluster cluster;
8117 cluster.Associate(device, endpointId);
8118 return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
8122 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
8123 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
8124 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
8125 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
8129 * Attribute MeasuredValue
8131 class ReadTemperatureMeasurementMeasuredValue : public ModelCommand
8134 ReadTemperatureMeasurementMeasuredValue() : ModelCommand("read")
8136 AddArgument("attr-name", "measured-value");
8137 ModelCommand::AddArguments();
8140 ~ReadTemperatureMeasurementMeasuredValue()
8142 delete onSuccessCallback;
8143 delete onFailureCallback;
8146 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
8148 ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);
8150 chip::Controller::TemperatureMeasurementCluster cluster;
8151 cluster.Associate(device, endpointId);
8152 return cluster.ReadAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
8156 chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
8157 new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
8158 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
8159 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
8162 class ReportTemperatureMeasurementMeasuredValue : public ModelCommand
8165 ReportTemperatureMeasurementMeasuredValue() : ModelCommand("report")
8167 AddArgument("attr-name", "measured-value");
8168 AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
8169 AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
8170 AddArgument("change", INT16_MIN, INT16_MAX, &mChange);
8171 ModelCommand::AddArguments();
8174 ~ReportTemperatureMeasurementMeasuredValue()
8176 delete onSuccessCallback;
8177 delete onFailureCallback;
8178 delete onReportCallback;
8181 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
8183 ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x06) on endpoint %" PRIu16, endpointId);
8185 chip::Controller::TemperatureMeasurementCluster cluster;
8186 cluster.Associate(device, endpointId);
8188 CHIP_ERROR err = cluster.ReportAttributeMeasuredValue(onReportCallback->Cancel());
8189 if (err != CHIP_NO_ERROR)
8194 return cluster.ConfigureAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
8195 mMaxInterval, mChange);
8199 chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
8200 new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
8201 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
8202 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
8203 chip::Callback::Callback<Int16sAttributeCallback> * onReportCallback =
8204 new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
8205 uint16_t mMinInterval;
8206 uint16_t mMaxInterval;
8211 * Attribute MinMeasuredValue
8213 class ReadTemperatureMeasurementMinMeasuredValue : public ModelCommand
8216 ReadTemperatureMeasurementMinMeasuredValue() : ModelCommand("read")
8218 AddArgument("attr-name", "min-measured-value");
8219 ModelCommand::AddArguments();
8222 ~ReadTemperatureMeasurementMinMeasuredValue()
8224 delete onSuccessCallback;
8225 delete onFailureCallback;
8228 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
8230 ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);
8232 chip::Controller::TemperatureMeasurementCluster cluster;
8233 cluster.Associate(device, endpointId);
8234 return cluster.ReadAttributeMinMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
8238 chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
8239 new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
8240 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
8241 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
8245 * Attribute MaxMeasuredValue
8247 class ReadTemperatureMeasurementMaxMeasuredValue : public ModelCommand
8250 ReadTemperatureMeasurementMaxMeasuredValue() : ModelCommand("read")
8252 AddArgument("attr-name", "max-measured-value");
8253 ModelCommand::AddArguments();
8256 ~ReadTemperatureMeasurementMaxMeasuredValue()
8258 delete onSuccessCallback;
8259 delete onFailureCallback;
8262 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
8264 ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);
8266 chip::Controller::TemperatureMeasurementCluster cluster;
8267 cluster.Associate(device, endpointId);
8268 return cluster.ReadAttributeMaxMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
8272 chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
8273 new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
8274 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
8275 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
8279 * Attribute ClusterRevision
8281 class ReadTemperatureMeasurementClusterRevision : public ModelCommand
8284 ReadTemperatureMeasurementClusterRevision() : ModelCommand("read")
8286 AddArgument("attr-name", "cluster-revision");
8287 ModelCommand::AddArguments();
8290 ~ReadTemperatureMeasurementClusterRevision()
8292 delete onSuccessCallback;
8293 delete onFailureCallback;
8296 CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
8298 ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);
8300 chip::Controller::TemperatureMeasurementCluster cluster;
8301 cluster.Associate(device, endpointId);
8302 return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
8306 chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
8307 new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
8308 chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
8309 new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
8312 /*----------------------------------------------------------------------------*\
8313 | Register all Clusters commands |
8314 \*----------------------------------------------------------------------------*/
8315 void registerClusterApplicationBasic(Commands & commands)
8317 const char * clusterName = "ApplicationBasic";
8319 commands_list clusterCommands = {
8320 make_unique<DiscoverApplicationBasicAttributes>(), make_unique<ReadApplicationBasicVendorName>(),
8321 make_unique<ReadApplicationBasicVendorId>(), make_unique<ReadApplicationBasicApplicationName>(),
8322 make_unique<ReadApplicationBasicProductId>(), make_unique<ReadApplicationBasicApplicationId>(),
8323 make_unique<ReadApplicationBasicCatalogVendorId>(), make_unique<ReadApplicationBasicApplicationSatus>(),
8324 make_unique<ReadApplicationBasicClusterRevision>(),
8327 commands.Register(clusterName, clusterCommands);
8329 void registerClusterBarrierControl(Commands & commands)
8331 const char * clusterName = "BarrierControl";
8333 commands_list clusterCommands = {
8334 make_unique<BarrierControlBarrierControlGoToPercent>(), make_unique<BarrierControlBarrierControlStop>(),
8335 make_unique<DiscoverBarrierControlAttributes>(), make_unique<ReadBarrierControlBarrierMovingState>(),
8336 make_unique<ReadBarrierControlBarrierSafetyStatus>(), make_unique<ReadBarrierControlBarrierCapabilities>(),
8337 make_unique<ReadBarrierControlBarrierPosition>(), make_unique<ReadBarrierControlClusterRevision>(),
8340 commands.Register(clusterName, clusterCommands);
8342 void registerClusterBasic(Commands & commands)
8344 const char * clusterName = "Basic";
8346 commands_list clusterCommands = {
8347 make_unique<BasicMfgSpecificPing>(),
8348 make_unique<DiscoverBasicAttributes>(),
8349 make_unique<ReadBasicInteractionModelVersion>(),
8350 make_unique<ReadBasicVendorName>(),
8351 make_unique<ReadBasicVendorID>(),
8352 make_unique<ReadBasicProductName>(),
8353 make_unique<ReadBasicProductID>(),
8354 make_unique<ReadBasicUserLabel>(),
8355 make_unique<WriteBasicUserLabel>(),
8356 make_unique<ReadBasicLocation>(),
8357 make_unique<WriteBasicLocation>(),
8358 make_unique<ReadBasicHardwareVersion>(),
8359 make_unique<ReadBasicHardwareVersionString>(),
8360 make_unique<ReadBasicSoftwareVersion>(),
8361 make_unique<ReadBasicSoftwareVersionString>(),
8362 make_unique<ReadBasicClusterRevision>(),
8365 commands.Register(clusterName, clusterCommands);
8367 void registerClusterBinding(Commands & commands)
8369 const char * clusterName = "Binding";
8371 commands_list clusterCommands = {
8372 make_unique<BindingBind>(),
8373 make_unique<BindingUnbind>(),
8374 make_unique<DiscoverBindingAttributes>(),
8375 make_unique<ReadBindingClusterRevision>(),
8378 commands.Register(clusterName, clusterCommands);
8380 void registerClusterColorControl(Commands & commands)
8382 const char * clusterName = "ColorControl";
8384 commands_list clusterCommands = {
8385 make_unique<ColorControlMoveColor>(),
8386 make_unique<ColorControlMoveColorTemperature>(),
8387 make_unique<ColorControlMoveHue>(),
8388 make_unique<ColorControlMoveSaturation>(),
8389 make_unique<ColorControlMoveToColor>(),
8390 make_unique<ColorControlMoveToColorTemperature>(),
8391 make_unique<ColorControlMoveToHue>(),
8392 make_unique<ColorControlMoveToHueAndSaturation>(),
8393 make_unique<ColorControlMoveToSaturation>(),
8394 make_unique<ColorControlStepColor>(),
8395 make_unique<ColorControlStepColorTemperature>(),
8396 make_unique<ColorControlStepHue>(),
8397 make_unique<ColorControlStepSaturation>(),
8398 make_unique<ColorControlStopMoveStep>(),
8399 make_unique<DiscoverColorControlAttributes>(),
8400 make_unique<ReadColorControlCurrentHue>(),
8401 make_unique<ReportColorControlCurrentHue>(),
8402 make_unique<ReadColorControlCurrentSaturation>(),
8403 make_unique<ReportColorControlCurrentSaturation>(),
8404 make_unique<ReadColorControlRemainingTime>(),
8405 make_unique<ReadColorControlCurrentX>(),
8406 make_unique<ReportColorControlCurrentX>(),
8407 make_unique<ReadColorControlCurrentY>(),
8408 make_unique<ReportColorControlCurrentY>(),
8409 make_unique<ReadColorControlDriftCompensation>(),
8410 make_unique<ReadColorControlCompensationText>(),
8411 make_unique<ReadColorControlColorTemperature>(),
8412 make_unique<ReportColorControlColorTemperature>(),
8413 make_unique<ReadColorControlColorMode>(),
8414 make_unique<ReadColorControlColorControlOptions>(),
8415 make_unique<WriteColorControlColorControlOptions>(),
8416 make_unique<ReadColorControlNumberOfPrimaries>(),
8417 make_unique<ReadColorControlPrimary1X>(),
8418 make_unique<ReadColorControlPrimary1Y>(),
8419 make_unique<ReadColorControlPrimary1Intensity>(),
8420 make_unique<ReadColorControlPrimary2X>(),
8421 make_unique<ReadColorControlPrimary2Y>(),
8422 make_unique<ReadColorControlPrimary2Intensity>(),
8423 make_unique<ReadColorControlPrimary3X>(),
8424 make_unique<ReadColorControlPrimary3Y>(),
8425 make_unique<ReadColorControlPrimary3Intensity>(),
8426 make_unique<ReadColorControlPrimary4X>(),
8427 make_unique<ReadColorControlPrimary4Y>(),
8428 make_unique<ReadColorControlPrimary4Intensity>(),
8429 make_unique<ReadColorControlPrimary5X>(),
8430 make_unique<ReadColorControlPrimary5Y>(),
8431 make_unique<ReadColorControlPrimary5Intensity>(),
8432 make_unique<ReadColorControlPrimary6X>(),
8433 make_unique<ReadColorControlPrimary6Y>(),
8434 make_unique<ReadColorControlPrimary6Intensity>(),
8435 make_unique<ReadColorControlWhitePointX>(),
8436 make_unique<WriteColorControlWhitePointX>(),
8437 make_unique<ReadColorControlWhitePointY>(),
8438 make_unique<WriteColorControlWhitePointY>(),
8439 make_unique<ReadColorControlColorPointRX>(),
8440 make_unique<WriteColorControlColorPointRX>(),
8441 make_unique<ReadColorControlColorPointRY>(),
8442 make_unique<WriteColorControlColorPointRY>(),
8443 make_unique<ReadColorControlColorPointRIntensity>(),
8444 make_unique<WriteColorControlColorPointRIntensity>(),
8445 make_unique<ReadColorControlColorPointGX>(),
8446 make_unique<WriteColorControlColorPointGX>(),
8447 make_unique<ReadColorControlColorPointGY>(),
8448 make_unique<WriteColorControlColorPointGY>(),
8449 make_unique<ReadColorControlColorPointGIntensity>(),
8450 make_unique<WriteColorControlColorPointGIntensity>(),
8451 make_unique<ReadColorControlColorPointBX>(),
8452 make_unique<WriteColorControlColorPointBX>(),
8453 make_unique<ReadColorControlColorPointBY>(),
8454 make_unique<WriteColorControlColorPointBY>(),
8455 make_unique<ReadColorControlColorPointBIntensity>(),
8456 make_unique<WriteColorControlColorPointBIntensity>(),
8457 make_unique<ReadColorControlEnhancedCurrentHue>(),
8458 make_unique<ReadColorControlEnhancedColorMode>(),
8459 make_unique<ReadColorControlColorLoopActive>(),
8460 make_unique<ReadColorControlColorLoopDirection>(),
8461 make_unique<ReadColorControlColorLoopTime>(),
8462 make_unique<ReadColorControlColorCapabilities>(),
8463 make_unique<ReadColorControlColorTempPhysicalMin>(),
8464 make_unique<ReadColorControlColorTempPhysicalMax>(),
8465 make_unique<ReadColorControlCoupleColorTempToLevelMinMireds>(),
8466 make_unique<ReadColorControlStartUpColorTemperatureMireds>(),
8467 make_unique<WriteColorControlStartUpColorTemperatureMireds>(),
8468 make_unique<ReadColorControlClusterRevision>(),
8471 commands.Register(clusterName, clusterCommands);
8473 void registerClusterDoorLock(Commands & commands)
8475 const char * clusterName = "DoorLock";
8477 commands_list clusterCommands = {
8478 make_unique<DoorLockClearAllPins>(),
8479 make_unique<DoorLockClearAllRfids>(),
8480 make_unique<DoorLockClearHolidaySchedule>(),
8481 make_unique<DoorLockClearPin>(),
8482 make_unique<DoorLockClearRfid>(),
8483 make_unique<DoorLockClearWeekdaySchedule>(),
8484 make_unique<DoorLockClearYeardaySchedule>(),
8485 make_unique<DoorLockGetHolidaySchedule>(),
8486 make_unique<DoorLockGetLogRecord>(),
8487 make_unique<DoorLockGetPin>(),
8488 make_unique<DoorLockGetRfid>(),
8489 make_unique<DoorLockGetUserType>(),
8490 make_unique<DoorLockGetWeekdaySchedule>(),
8491 make_unique<DoorLockGetYeardaySchedule>(),
8492 make_unique<DoorLockLockDoor>(),
8493 make_unique<DoorLockSetHolidaySchedule>(),
8494 make_unique<DoorLockSetPin>(),
8495 make_unique<DoorLockSetRfid>(),
8496 make_unique<DoorLockSetUserType>(),
8497 make_unique<DoorLockSetWeekdaySchedule>(),
8498 make_unique<DoorLockSetYeardaySchedule>(),
8499 make_unique<DoorLockUnlockDoor>(),
8500 make_unique<DoorLockUnlockWithTimeout>(),
8501 make_unique<DiscoverDoorLockAttributes>(),
8502 make_unique<ReadDoorLockLockState>(),
8503 make_unique<ReportDoorLockLockState>(),
8504 make_unique<ReadDoorLockLockType>(),
8505 make_unique<ReadDoorLockActuatorEnabled>(),
8506 make_unique<ReadDoorLockClusterRevision>(),
8509 commands.Register(clusterName, clusterCommands);
8511 void registerClusterGeneralCommissioning(Commands & commands)
8513 const char * clusterName = "GeneralCommissioning";
8515 commands_list clusterCommands = {
8516 make_unique<GeneralCommissioningArmFailSafe>(), make_unique<GeneralCommissioningCommissioningComplete>(),
8517 make_unique<GeneralCommissioningSetFabric>(), make_unique<DiscoverGeneralCommissioningAttributes>(),
8518 make_unique<ReadGeneralCommissioningFabricId>(), make_unique<ReadGeneralCommissioningBreadcrumb>(),
8519 make_unique<WriteGeneralCommissioningBreadcrumb>(), make_unique<ReadGeneralCommissioningClusterRevision>(),
8522 commands.Register(clusterName, clusterCommands);
8524 void registerClusterGroups(Commands & commands)
8526 const char * clusterName = "Groups";
8528 commands_list clusterCommands = {
8529 make_unique<GroupsAddGroup>(),
8530 make_unique<GroupsAddGroupIfIdentifying>(),
8531 make_unique<GroupsGetGroupMembership>(),
8532 make_unique<GroupsRemoveAllGroups>(),
8533 make_unique<GroupsRemoveGroup>(),
8534 make_unique<GroupsViewGroup>(),
8535 make_unique<DiscoverGroupsAttributes>(),
8536 make_unique<ReadGroupsNameSupport>(),
8537 make_unique<ReadGroupsClusterRevision>(),
8540 commands.Register(clusterName, clusterCommands);
8542 void registerClusterIdentify(Commands & commands)
8544 const char * clusterName = "Identify";
8546 commands_list clusterCommands = {
8547 make_unique<IdentifyIdentify>(), make_unique<IdentifyIdentifyQuery>(),
8548 make_unique<DiscoverIdentifyAttributes>(), make_unique<ReadIdentifyIdentifyTime>(),
8549 make_unique<WriteIdentifyIdentifyTime>(), make_unique<ReadIdentifyClusterRevision>(),
8552 commands.Register(clusterName, clusterCommands);
8554 void registerClusterLevelControl(Commands & commands)
8556 const char * clusterName = "LevelControl";
8558 commands_list clusterCommands = {
8559 make_unique<LevelControlMove>(),
8560 make_unique<LevelControlMoveToLevel>(),
8561 make_unique<LevelControlMoveToLevelWithOnOff>(),
8562 make_unique<LevelControlMoveWithOnOff>(),
8563 make_unique<LevelControlStep>(),
8564 make_unique<LevelControlStepWithOnOff>(),
8565 make_unique<LevelControlStop>(),
8566 make_unique<LevelControlStopWithOnOff>(),
8567 make_unique<DiscoverLevelControlAttributes>(),
8568 make_unique<ReadLevelControlCurrentLevel>(),
8569 make_unique<ReportLevelControlCurrentLevel>(),
8570 make_unique<ReadLevelControlClusterRevision>(),
8573 commands.Register(clusterName, clusterCommands);
8575 void registerClusterLowPower(Commands & commands)
8577 const char * clusterName = "LowPower";
8579 commands_list clusterCommands = {
8580 make_unique<LowPowerSleep>(),
8581 make_unique<DiscoverLowPowerAttributes>(),
8582 make_unique<ReadLowPowerClusterRevision>(),
8585 commands.Register(clusterName, clusterCommands);
8587 void registerClusterOnOff(Commands & commands)
8589 const char * clusterName = "OnOff";
8591 commands_list clusterCommands = {
8592 make_unique<OnOffOff>(),
8593 make_unique<OnOffOn>(),
8594 make_unique<OnOffToggle>(),
8595 make_unique<DiscoverOnOffAttributes>(),
8596 make_unique<ReadOnOffOnOff>(),
8597 make_unique<ReportOnOffOnOff>(),
8598 make_unique<ReadOnOffClusterRevision>(),
8601 commands.Register(clusterName, clusterCommands);
8603 void registerClusterScenes(Commands & commands)
8605 const char * clusterName = "Scenes";
8607 commands_list clusterCommands = {
8608 make_unique<ScenesAddScene>(), make_unique<ScenesGetSceneMembership>(), make_unique<ScenesRecallScene>(),
8609 make_unique<ScenesRemoveAllScenes>(), make_unique<ScenesRemoveScene>(), make_unique<ScenesStoreScene>(),
8610 make_unique<ScenesViewScene>(), make_unique<DiscoverScenesAttributes>(), make_unique<ReadScenesSceneCount>(),
8611 make_unique<ReadScenesCurrentScene>(), make_unique<ReadScenesCurrentGroup>(), make_unique<ReadScenesSceneValid>(),
8612 make_unique<ReadScenesNameSupport>(), make_unique<ReadScenesClusterRevision>(),
8615 commands.Register(clusterName, clusterCommands);
8617 void registerClusterTemperatureMeasurement(Commands & commands)
8619 const char * clusterName = "TemperatureMeasurement";
8621 commands_list clusterCommands = {
8622 make_unique<DiscoverTemperatureMeasurementAttributes>(), make_unique<ReadTemperatureMeasurementMeasuredValue>(),
8623 make_unique<ReportTemperatureMeasurementMeasuredValue>(), make_unique<ReadTemperatureMeasurementMinMeasuredValue>(),
8624 make_unique<ReadTemperatureMeasurementMaxMeasuredValue>(), make_unique<ReadTemperatureMeasurementClusterRevision>(),
8627 commands.Register(clusterName, clusterCommands);
8630 void registerClusters(Commands & commands)
8632 registerClusterApplicationBasic(commands);
8633 registerClusterBarrierControl(commands);
8634 registerClusterBasic(commands);
8635 registerClusterBinding(commands);
8636 registerClusterColorControl(commands);
8637 registerClusterDoorLock(commands);
8638 registerClusterGeneralCommissioning(commands);
8639 registerClusterGroups(commands);
8640 registerClusterIdentify(commands);
8641 registerClusterLevelControl(commands);
8642 registerClusterLowPower(commands);
8643 registerClusterOnOff(commands);
8644 registerClusterScenes(commands);
8645 registerClusterTemperatureMeasurement(commands);