3 * Copyright (c) 2021 Project CHIP Authors
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 // THIS FILE IS GENERATED BY ZAP
20 #import <Foundation/Foundation.h>
22 #import "CHIPDevice.h"
23 #import "CHIPDevice_Internal.h"
25 #import "gen/CHIPClientCallbacks.h"
26 #import "gen/CHIPClustersObjc.h"
28 #include <controller/CHIPClusters.h>
29 #include <lib/support/Span.h>
31 using namespace ::chip;
33 class CHIPDefaultSuccessCallbackBridge : public Callback::Callback<DefaultSuccessCallback> {
35 CHIPDefaultSuccessCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
36 : Callback::Callback<DefaultSuccessCallback>(CallbackFn, this)
42 ~CHIPDefaultSuccessCallbackBridge() {};
44 static void CallbackFn(void * context)
46 CHIPDefaultSuccessCallbackBridge * callback = reinterpret_cast<CHIPDefaultSuccessCallbackBridge *>(context);
47 if (callback && callback->mQueue) {
48 dispatch_async(callback->mQueue, ^{
49 callback->mHandler(nil, nil);
57 ResponseHandler mHandler;
58 dispatch_queue_t mQueue;
61 class CHIPDefaultFailureCallbackBridge : public Callback::Callback<DefaultFailureCallback> {
63 CHIPDefaultFailureCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
64 : Callback::Callback<DefaultFailureCallback>(CallbackFn, this)
70 ~CHIPDefaultFailureCallbackBridge() {};
72 static void CallbackFn(void * context, uint8_t status)
74 CHIPDefaultFailureCallbackBridge * callback = reinterpret_cast<CHIPDefaultFailureCallbackBridge *>(context);
75 if (callback && callback->mQueue) {
76 dispatch_async(callback->mQueue, ^{
77 NSError * error = [CHIPError errorForCHIPErrorCode:status];
78 callback->mHandler(error, nil);
86 ResponseHandler mHandler;
87 dispatch_queue_t mQueue;
90 class CHIPStringAttributeCallbackBridge : public Callback::Callback<StringAttributeCallback> {
92 CHIPStringAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool octetString, bool keepAlive = false)
93 : Callback::Callback<StringAttributeCallback>(CallbackFn, this)
96 , mOctetString(octetString)
97 , mKeepAlive(keepAlive)
101 ~CHIPStringAttributeCallbackBridge() {};
103 static void CallbackFn(void * context, chip::ByteSpan value)
105 CHIPStringAttributeCallbackBridge * callback = reinterpret_cast<CHIPStringAttributeCallbackBridge *>(context);
106 if (callback && callback->mQueue) {
107 dispatch_async(callback->mQueue, ^{
108 if (callback->mOctetString) {
109 NSData * data = [NSData dataWithBytes:value.data() length:value.size()];
110 callback->mHandler(nil, @ { @"value" : data });
112 NSString * str = [[NSString alloc] initWithBytes:value.data()
114 encoding:NSUTF8StringEncoding];
115 callback->mHandler(nil, @ { @"value" : str });
118 if (!callback->mKeepAlive) {
127 ResponseHandler mHandler;
128 dispatch_queue_t mQueue;
133 class CHIPBooleanAttributeCallbackBridge : public Callback::Callback<BooleanAttributeCallback> {
135 CHIPBooleanAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
136 : Callback::Callback<BooleanAttributeCallback>(CallbackFn, this)
139 , mKeepAlive(keepAlive)
143 ~CHIPBooleanAttributeCallbackBridge() {};
145 static void CallbackFn(void * context, bool value)
147 CHIPBooleanAttributeCallbackBridge * callback = reinterpret_cast<CHIPBooleanAttributeCallbackBridge *>(context);
148 if (callback && callback->mQueue) {
149 dispatch_async(callback->mQueue, ^{
150 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithBool:value] });
151 if (!callback->mKeepAlive) {
160 ResponseHandler mHandler;
161 dispatch_queue_t mQueue;
165 class CHIPInt8uAttributeCallbackBridge : public Callback::Callback<Int8uAttributeCallback> {
167 CHIPInt8uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
168 : Callback::Callback<Int8uAttributeCallback>(CallbackFn, this)
171 , mKeepAlive(keepAlive)
175 ~CHIPInt8uAttributeCallbackBridge() {};
177 static void CallbackFn(void * context, uint8_t value)
179 CHIPInt8uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt8uAttributeCallbackBridge *>(context);
180 if (callback && callback->mQueue) {
181 dispatch_async(callback->mQueue, ^{
182 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedChar:value] });
183 if (!callback->mKeepAlive) {
192 ResponseHandler mHandler;
193 dispatch_queue_t mQueue;
197 class CHIPInt8sAttributeCallbackBridge : public Callback::Callback<Int8sAttributeCallback> {
199 CHIPInt8sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
200 : Callback::Callback<Int8sAttributeCallback>(CallbackFn, this)
203 , mKeepAlive(keepAlive)
207 ~CHIPInt8sAttributeCallbackBridge() {};
209 static void CallbackFn(void * context, int8_t value)
211 CHIPInt8sAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt8sAttributeCallbackBridge *>(context);
212 if (callback && callback->mQueue) {
213 dispatch_async(callback->mQueue, ^{
214 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithChar:value] });
215 if (!callback->mKeepAlive) {
224 ResponseHandler mHandler;
225 dispatch_queue_t mQueue;
229 class CHIPInt16uAttributeCallbackBridge : public Callback::Callback<Int16uAttributeCallback> {
231 CHIPInt16uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
232 : Callback::Callback<Int16uAttributeCallback>(CallbackFn, this)
235 , mKeepAlive(keepAlive)
239 ~CHIPInt16uAttributeCallbackBridge() {};
241 static void CallbackFn(void * context, uint16_t value)
243 CHIPInt16uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt16uAttributeCallbackBridge *>(context);
244 if (callback && callback->mQueue) {
245 dispatch_async(callback->mQueue, ^{
246 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedShort:value] });
247 if (!callback->mKeepAlive) {
256 ResponseHandler mHandler;
257 dispatch_queue_t mQueue;
261 class CHIPInt32uAttributeCallbackBridge : public Callback::Callback<Int32uAttributeCallback> {
263 CHIPInt32uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
264 : Callback::Callback<Int32uAttributeCallback>(CallbackFn, this)
267 , mKeepAlive(keepAlive)
271 ~CHIPInt32uAttributeCallbackBridge() {};
273 static void CallbackFn(void * context, uint32_t value)
275 CHIPInt32uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt32uAttributeCallbackBridge *>(context);
276 if (callback && callback->mQueue) {
277 dispatch_async(callback->mQueue, ^{
278 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedLong:value] });
279 if (!callback->mKeepAlive) {
288 ResponseHandler mHandler;
289 dispatch_queue_t mQueue;
293 class CHIPInt64uAttributeCallbackBridge : public Callback::Callback<Int64uAttributeCallback> {
295 CHIPInt64uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
296 : Callback::Callback<Int64uAttributeCallback>(CallbackFn, this)
299 , mKeepAlive(keepAlive)
303 ~CHIPInt64uAttributeCallbackBridge() {};
305 static void CallbackFn(void * context, uint64_t value)
307 CHIPInt64uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt64uAttributeCallbackBridge *>(context);
308 if (callback && callback->mQueue) {
309 dispatch_async(callback->mQueue, ^{
310 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedLongLong:value] });
311 if (!callback->mKeepAlive) {
320 ResponseHandler mHandler;
321 dispatch_queue_t mQueue;
325 class CHIPInt16sAttributeCallbackBridge : public Callback::Callback<Int16sAttributeCallback> {
327 CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
328 : Callback::Callback<Int16sAttributeCallback>(CallbackFn, this)
331 , mKeepAlive(keepAlive)
335 ~CHIPInt16sAttributeCallbackBridge() {};
337 static void CallbackFn(void * context, int16_t value)
339 CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt16sAttributeCallbackBridge *>(context);
340 if (callback && callback->mQueue) {
341 dispatch_async(callback->mQueue, ^{
342 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] });
343 if (!callback->mKeepAlive) {
352 ResponseHandler mHandler;
353 dispatch_queue_t mQueue;
357 class CHIPDoorLockClusterLockDoorResponseCallbackBridge : public Callback::Callback<DoorLockClusterLockDoorResponseCallback> {
359 CHIPDoorLockClusterLockDoorResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
360 : Callback::Callback<DoorLockClusterLockDoorResponseCallback>(CallbackFn, this)
366 ~CHIPDoorLockClusterLockDoorResponseCallbackBridge() {};
368 static void CallbackFn(void * context)
370 CHIPDoorLockClusterLockDoorResponseCallbackBridge * callback
371 = reinterpret_cast<CHIPDoorLockClusterLockDoorResponseCallbackBridge *>(context);
372 if (callback && callback->mQueue) {
373 dispatch_async(callback->mQueue, ^{
374 callback->mHandler(nil, @ {});
382 ResponseHandler mHandler;
383 dispatch_queue_t mQueue;
386 class CHIPDoorLockClusterUnlockDoorResponseCallbackBridge : public Callback::Callback<DoorLockClusterUnlockDoorResponseCallback> {
388 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
389 : Callback::Callback<DoorLockClusterUnlockDoorResponseCallback>(CallbackFn, this)
395 ~CHIPDoorLockClusterUnlockDoorResponseCallbackBridge() {};
397 static void CallbackFn(void * context)
399 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * callback
400 = reinterpret_cast<CHIPDoorLockClusterUnlockDoorResponseCallbackBridge *>(context);
401 if (callback && callback->mQueue) {
402 dispatch_async(callback->mQueue, ^{
403 callback->mHandler(nil, @ {});
411 ResponseHandler mHandler;
412 dispatch_queue_t mQueue;
415 @interface CHIPCluster ()
416 @property (readonly, nonatomic) dispatch_queue_t callbackQueue;
417 - (Controller::ClusterBase *)getCluster;
420 @implementation CHIPCluster
421 - (instancetype)initWithDevice:(CHIPDevice *)device endpoint:(EndpointId)endpoint queue:(dispatch_queue_t)queue
423 if (self = [super init]) {
424 Controller::ClusterBase * cppCluster = [self getCluster];
425 if (cppCluster == nullptr) {
429 CHIP_ERROR err = cppCluster->Associate([device internalDevice], endpoint);
430 if (err != CHIP_NO_ERROR) {
434 _callbackQueue = queue;
439 - (Controller::ClusterBase *)getCluster
445 @interface CHIPBarrierControl ()
446 @property (readonly) Controller::BarrierControlCluster cppCluster;
449 @implementation CHIPBarrierControl
451 - (Controller::ClusterBase *)getCluster
456 - (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler
458 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
460 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
464 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
467 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
471 CHIP_ERROR err = self.cppCluster.BarrierControlGoToPercent(onSuccess->Cancel(), onFailure->Cancel(), percentOpen);
472 if (err != CHIP_NO_ERROR) {
475 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
478 - (void)barrierControlStop:(ResponseHandler)completionHandler
480 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
482 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
486 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
489 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
493 CHIP_ERROR err = self.cppCluster.BarrierControlStop(onSuccess->Cancel(), onFailure->Cancel());
494 if (err != CHIP_NO_ERROR) {
497 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
501 - (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler
503 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
505 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
509 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
512 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
516 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierMovingState(onSuccess->Cancel(), onFailure->Cancel());
517 if (err != CHIP_NO_ERROR) {
520 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
524 - (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler
526 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
528 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
532 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
535 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
539 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierSafetyStatus(onSuccess->Cancel(), onFailure->Cancel());
540 if (err != CHIP_NO_ERROR) {
543 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
547 - (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler
549 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
551 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
555 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
558 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
562 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierCapabilities(onSuccess->Cancel(), onFailure->Cancel());
563 if (err != CHIP_NO_ERROR) {
566 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
570 - (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler
572 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
574 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
578 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
581 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
585 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierPosition(onSuccess->Cancel(), onFailure->Cancel());
586 if (err != CHIP_NO_ERROR) {
589 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
593 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
595 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
597 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
601 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
604 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
608 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
609 if (err != CHIP_NO_ERROR) {
612 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
618 @interface CHIPColorControl ()
619 @property (readonly) Controller::ColorControlCluster cppCluster;
622 @implementation CHIPColorControl
624 - (Controller::ClusterBase *)getCluster
629 - (void)moveColor:(int16_t)rateX
631 optionsMask:(uint8_t)optionsMask
632 optionsOverride:(uint8_t)optionsOverride
633 completionHandler:(ResponseHandler)completionHandler
635 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
637 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
641 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
644 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
649 = self.cppCluster.MoveColor(onSuccess->Cancel(), onFailure->Cancel(), rateX, rateY, optionsMask, optionsOverride);
650 if (err != CHIP_NO_ERROR) {
653 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
656 - (void)moveColorTemperature:(uint8_t)moveMode
658 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
659 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
660 optionsMask:(uint8_t)optionsMask
661 optionsOverride:(uint8_t)optionsOverride
662 completionHandler:(ResponseHandler)completionHandler
664 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
666 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
670 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
673 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
677 CHIP_ERROR err = self.cppCluster.MoveColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate,
678 colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
679 if (err != CHIP_NO_ERROR) {
682 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
685 - (void)moveHue:(uint8_t)moveMode
687 optionsMask:(uint8_t)optionsMask
688 optionsOverride:(uint8_t)optionsOverride
689 completionHandler:(ResponseHandler)completionHandler
691 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
693 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
697 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
700 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
705 = self.cppCluster.MoveHue(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
706 if (err != CHIP_NO_ERROR) {
709 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
712 - (void)moveSaturation:(uint8_t)moveMode
714 optionsMask:(uint8_t)optionsMask
715 optionsOverride:(uint8_t)optionsOverride
716 completionHandler:(ResponseHandler)completionHandler
718 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
720 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
724 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
727 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
732 = self.cppCluster.MoveSaturation(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
733 if (err != CHIP_NO_ERROR) {
736 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
739 - (void)moveToColor:(uint16_t)colorX
740 colorY:(uint16_t)colorY
741 transitionTime:(uint16_t)transitionTime
742 optionsMask:(uint8_t)optionsMask
743 optionsOverride:(uint8_t)optionsOverride
744 completionHandler:(ResponseHandler)completionHandler
746 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
748 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
752 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
755 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
759 CHIP_ERROR err = self.cppCluster.MoveToColor(
760 onSuccess->Cancel(), onFailure->Cancel(), colorX, colorY, transitionTime, optionsMask, optionsOverride);
761 if (err != CHIP_NO_ERROR) {
764 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
767 - (void)moveToColorTemperature:(uint16_t)colorTemperature
768 transitionTime:(uint16_t)transitionTime
769 optionsMask:(uint8_t)optionsMask
770 optionsOverride:(uint8_t)optionsOverride
771 completionHandler:(ResponseHandler)completionHandler
773 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
775 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
779 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
782 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
786 CHIP_ERROR err = self.cppCluster.MoveToColorTemperature(
787 onSuccess->Cancel(), onFailure->Cancel(), colorTemperature, transitionTime, optionsMask, optionsOverride);
788 if (err != CHIP_NO_ERROR) {
791 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
794 - (void)moveToHue:(uint8_t)hue
795 direction:(uint8_t)direction
796 transitionTime:(uint16_t)transitionTime
797 optionsMask:(uint8_t)optionsMask
798 optionsOverride:(uint8_t)optionsOverride
799 completionHandler:(ResponseHandler)completionHandler
801 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
803 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
807 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
810 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
814 CHIP_ERROR err = self.cppCluster.MoveToHue(
815 onSuccess->Cancel(), onFailure->Cancel(), hue, direction, transitionTime, optionsMask, optionsOverride);
816 if (err != CHIP_NO_ERROR) {
819 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
822 - (void)moveToHueAndSaturation:(uint8_t)hue
823 saturation:(uint8_t)saturation
824 transitionTime:(uint16_t)transitionTime
825 optionsMask:(uint8_t)optionsMask
826 optionsOverride:(uint8_t)optionsOverride
827 completionHandler:(ResponseHandler)completionHandler
829 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
831 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
835 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
838 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
842 CHIP_ERROR err = self.cppCluster.MoveToHueAndSaturation(
843 onSuccess->Cancel(), onFailure->Cancel(), hue, saturation, transitionTime, optionsMask, optionsOverride);
844 if (err != CHIP_NO_ERROR) {
847 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
850 - (void)moveToSaturation:(uint8_t)saturation
851 transitionTime:(uint16_t)transitionTime
852 optionsMask:(uint8_t)optionsMask
853 optionsOverride:(uint8_t)optionsOverride
854 completionHandler:(ResponseHandler)completionHandler
856 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
858 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
862 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
865 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
869 CHIP_ERROR err = self.cppCluster.MoveToSaturation(
870 onSuccess->Cancel(), onFailure->Cancel(), saturation, transitionTime, optionsMask, optionsOverride);
871 if (err != CHIP_NO_ERROR) {
874 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
877 - (void)stepColor:(int16_t)stepX
879 transitionTime:(uint16_t)transitionTime
880 optionsMask:(uint8_t)optionsMask
881 optionsOverride:(uint8_t)optionsOverride
882 completionHandler:(ResponseHandler)completionHandler
884 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
886 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
890 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
893 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
897 CHIP_ERROR err = self.cppCluster.StepColor(
898 onSuccess->Cancel(), onFailure->Cancel(), stepX, stepY, transitionTime, optionsMask, optionsOverride);
899 if (err != CHIP_NO_ERROR) {
902 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
905 - (void)stepColorTemperature:(uint8_t)stepMode
906 stepSize:(uint16_t)stepSize
907 transitionTime:(uint16_t)transitionTime
908 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
909 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
910 optionsMask:(uint8_t)optionsMask
911 optionsOverride:(uint8_t)optionsOverride
912 completionHandler:(ResponseHandler)completionHandler
914 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
916 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
920 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
923 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
927 CHIP_ERROR err = self.cppCluster.StepColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize,
928 transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
929 if (err != CHIP_NO_ERROR) {
932 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
935 - (void)stepHue:(uint8_t)stepMode
936 stepSize:(uint8_t)stepSize
937 transitionTime:(uint8_t)transitionTime
938 optionsMask:(uint8_t)optionsMask
939 optionsOverride:(uint8_t)optionsOverride
940 completionHandler:(ResponseHandler)completionHandler
942 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
944 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
948 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
951 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
955 CHIP_ERROR err = self.cppCluster.StepHue(
956 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
957 if (err != CHIP_NO_ERROR) {
960 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
963 - (void)stepSaturation:(uint8_t)stepMode
964 stepSize:(uint8_t)stepSize
965 transitionTime:(uint8_t)transitionTime
966 optionsMask:(uint8_t)optionsMask
967 optionsOverride:(uint8_t)optionsOverride
968 completionHandler:(ResponseHandler)completionHandler
970 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
972 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
976 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
979 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
983 CHIP_ERROR err = self.cppCluster.StepSaturation(
984 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
985 if (err != CHIP_NO_ERROR) {
988 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
991 - (void)stopMoveStep:(uint8_t)optionsMask
992 optionsOverride:(uint8_t)optionsOverride
993 completionHandler:(ResponseHandler)completionHandler
995 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
997 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1001 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1004 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1008 CHIP_ERROR err = self.cppCluster.StopMoveStep(onSuccess->Cancel(), onFailure->Cancel(), optionsMask, optionsOverride);
1009 if (err != CHIP_NO_ERROR) {
1012 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1016 - (void)readAttributeCurrentHue:(ResponseHandler)completionHandler
1018 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1020 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1024 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1027 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1031 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
1032 if (err != CHIP_NO_ERROR) {
1035 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1039 - (void)configureAttributeCurrentHue:(uint16_t)minInterval
1040 maxInterval:(uint16_t)maxInterval
1041 change:(uint8_t)change
1042 completionHandler:(ResponseHandler)completionHandler
1044 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1046 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1050 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1053 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1058 = self.cppCluster.ConfigureAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1059 if (err != CHIP_NO_ERROR) {
1062 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1066 - (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler
1068 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1070 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1074 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentHue(onReport->Cancel());
1075 if (err != CHIP_NO_ERROR) {
1077 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1081 - (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler
1083 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1085 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1089 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1092 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1096 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentSaturation(onSuccess->Cancel(), onFailure->Cancel());
1097 if (err != CHIP_NO_ERROR) {
1100 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1104 - (void)configureAttributeCurrentSaturation:(uint16_t)minInterval
1105 maxInterval:(uint16_t)maxInterval
1106 change:(uint8_t)change
1107 completionHandler:(ResponseHandler)completionHandler
1109 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1111 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1115 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1118 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1122 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentSaturation(
1123 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1124 if (err != CHIP_NO_ERROR) {
1127 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1131 - (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler
1133 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1135 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1139 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentSaturation(onReport->Cancel());
1140 if (err != CHIP_NO_ERROR) {
1142 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1146 - (void)readAttributeRemainingTime:(ResponseHandler)completionHandler
1148 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1150 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1154 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1157 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1161 CHIP_ERROR err = self.cppCluster.ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel());
1162 if (err != CHIP_NO_ERROR) {
1165 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1169 - (void)readAttributeCurrentX:(ResponseHandler)completionHandler
1171 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1173 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1177 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1180 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1184 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel());
1185 if (err != CHIP_NO_ERROR) {
1188 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1192 - (void)configureAttributeCurrentX:(uint16_t)minInterval
1193 maxInterval:(uint16_t)maxInterval
1194 change:(uint16_t)change
1195 completionHandler:(ResponseHandler)completionHandler
1197 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1199 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1203 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1206 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1211 = self.cppCluster.ConfigureAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1212 if (err != CHIP_NO_ERROR) {
1215 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1219 - (void)reportAttributeCurrentX:(ResponseHandler)reportHandler
1221 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1223 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1227 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentX(onReport->Cancel());
1228 if (err != CHIP_NO_ERROR) {
1230 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1234 - (void)readAttributeCurrentY:(ResponseHandler)completionHandler
1236 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1238 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1242 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1245 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1249 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel());
1250 if (err != CHIP_NO_ERROR) {
1253 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1257 - (void)configureAttributeCurrentY:(uint16_t)minInterval
1258 maxInterval:(uint16_t)maxInterval
1259 change:(uint16_t)change
1260 completionHandler:(ResponseHandler)completionHandler
1262 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1264 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1268 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1271 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1276 = self.cppCluster.ConfigureAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1277 if (err != CHIP_NO_ERROR) {
1280 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1284 - (void)reportAttributeCurrentY:(ResponseHandler)reportHandler
1286 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1288 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1292 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentY(onReport->Cancel());
1293 if (err != CHIP_NO_ERROR) {
1295 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1299 - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler
1301 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1303 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1307 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1310 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1314 CHIP_ERROR err = self.cppCluster.ReadAttributeDriftCompensation(onSuccess->Cancel(), onFailure->Cancel());
1315 if (err != CHIP_NO_ERROR) {
1318 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1322 - (void)readAttributeCompensationText:(ResponseHandler)completionHandler
1324 CHIPStringAttributeCallbackBridge * onSuccess
1325 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
1327 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1331 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1334 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1338 CHIP_ERROR err = self.cppCluster.ReadAttributeCompensationText(onSuccess->Cancel(), onFailure->Cancel());
1339 if (err != CHIP_NO_ERROR) {
1342 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1346 - (void)readAttributeColorTemperature:(ResponseHandler)completionHandler
1348 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1350 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1354 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1357 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1361 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTemperature(onSuccess->Cancel(), onFailure->Cancel());
1362 if (err != CHIP_NO_ERROR) {
1365 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1369 - (void)configureAttributeColorTemperature:(uint16_t)minInterval
1370 maxInterval:(uint16_t)maxInterval
1371 change:(uint16_t)change
1372 completionHandler:(ResponseHandler)completionHandler
1374 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1376 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1380 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1383 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1387 CHIP_ERROR err = self.cppCluster.ConfigureAttributeColorTemperature(
1388 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1389 if (err != CHIP_NO_ERROR) {
1392 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1396 - (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler
1398 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1400 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1404 CHIP_ERROR err = self.cppCluster.ReportAttributeColorTemperature(onReport->Cancel());
1405 if (err != CHIP_NO_ERROR) {
1407 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1411 - (void)readAttributeColorMode:(ResponseHandler)completionHandler
1413 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1415 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1419 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1422 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1426 CHIP_ERROR err = self.cppCluster.ReadAttributeColorMode(onSuccess->Cancel(), onFailure->Cancel());
1427 if (err != CHIP_NO_ERROR) {
1430 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1434 - (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler
1436 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1438 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1442 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1445 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1449 CHIP_ERROR err = self.cppCluster.ReadAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel());
1450 if (err != CHIP_NO_ERROR) {
1453 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1457 - (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
1459 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1461 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1465 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1468 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1472 CHIP_ERROR err = self.cppCluster.WriteAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel(), value);
1473 if (err != CHIP_NO_ERROR) {
1476 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1480 - (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler
1482 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1484 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1488 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1491 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1495 CHIP_ERROR err = self.cppCluster.ReadAttributeNumberOfPrimaries(onSuccess->Cancel(), onFailure->Cancel());
1496 if (err != CHIP_NO_ERROR) {
1499 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1503 - (void)readAttributePrimary1X:(ResponseHandler)completionHandler
1505 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1507 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1511 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1514 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1518 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1X(onSuccess->Cancel(), onFailure->Cancel());
1519 if (err != CHIP_NO_ERROR) {
1522 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1526 - (void)readAttributePrimary1Y:(ResponseHandler)completionHandler
1528 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1530 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1534 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1537 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1541 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Y(onSuccess->Cancel(), onFailure->Cancel());
1542 if (err != CHIP_NO_ERROR) {
1545 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1549 - (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler
1551 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1553 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1557 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1560 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1564 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Intensity(onSuccess->Cancel(), onFailure->Cancel());
1565 if (err != CHIP_NO_ERROR) {
1568 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1572 - (void)readAttributePrimary2X:(ResponseHandler)completionHandler
1574 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1576 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1580 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1583 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1587 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2X(onSuccess->Cancel(), onFailure->Cancel());
1588 if (err != CHIP_NO_ERROR) {
1591 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1595 - (void)readAttributePrimary2Y:(ResponseHandler)completionHandler
1597 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1599 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1603 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1606 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1610 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Y(onSuccess->Cancel(), onFailure->Cancel());
1611 if (err != CHIP_NO_ERROR) {
1614 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1618 - (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler
1620 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1622 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1626 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1629 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1633 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Intensity(onSuccess->Cancel(), onFailure->Cancel());
1634 if (err != CHIP_NO_ERROR) {
1637 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1641 - (void)readAttributePrimary3X:(ResponseHandler)completionHandler
1643 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1645 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1649 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1652 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1656 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3X(onSuccess->Cancel(), onFailure->Cancel());
1657 if (err != CHIP_NO_ERROR) {
1660 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1664 - (void)readAttributePrimary3Y:(ResponseHandler)completionHandler
1666 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1668 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1672 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1675 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1679 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Y(onSuccess->Cancel(), onFailure->Cancel());
1680 if (err != CHIP_NO_ERROR) {
1683 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1687 - (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler
1689 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1691 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1695 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1698 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1702 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Intensity(onSuccess->Cancel(), onFailure->Cancel());
1703 if (err != CHIP_NO_ERROR) {
1706 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1710 - (void)readAttributePrimary4X:(ResponseHandler)completionHandler
1712 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1714 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1718 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1721 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1725 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4X(onSuccess->Cancel(), onFailure->Cancel());
1726 if (err != CHIP_NO_ERROR) {
1729 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1733 - (void)readAttributePrimary4Y:(ResponseHandler)completionHandler
1735 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1737 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1741 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1744 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1748 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Y(onSuccess->Cancel(), onFailure->Cancel());
1749 if (err != CHIP_NO_ERROR) {
1752 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1756 - (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler
1758 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1760 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1764 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1767 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1771 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Intensity(onSuccess->Cancel(), onFailure->Cancel());
1772 if (err != CHIP_NO_ERROR) {
1775 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1779 - (void)readAttributePrimary5X:(ResponseHandler)completionHandler
1781 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1783 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1787 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1790 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1794 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5X(onSuccess->Cancel(), onFailure->Cancel());
1795 if (err != CHIP_NO_ERROR) {
1798 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1802 - (void)readAttributePrimary5Y:(ResponseHandler)completionHandler
1804 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1806 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1810 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1813 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1817 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Y(onSuccess->Cancel(), onFailure->Cancel());
1818 if (err != CHIP_NO_ERROR) {
1821 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1825 - (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler
1827 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1829 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1833 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1836 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1840 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Intensity(onSuccess->Cancel(), onFailure->Cancel());
1841 if (err != CHIP_NO_ERROR) {
1844 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1848 - (void)readAttributePrimary6X:(ResponseHandler)completionHandler
1850 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1852 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1856 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1859 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1863 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6X(onSuccess->Cancel(), onFailure->Cancel());
1864 if (err != CHIP_NO_ERROR) {
1867 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1871 - (void)readAttributePrimary6Y:(ResponseHandler)completionHandler
1873 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1875 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1879 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1882 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1886 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Y(onSuccess->Cancel(), onFailure->Cancel());
1887 if (err != CHIP_NO_ERROR) {
1890 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1894 - (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler
1896 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1898 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1902 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1905 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1909 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Intensity(onSuccess->Cancel(), onFailure->Cancel());
1910 if (err != CHIP_NO_ERROR) {
1913 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1917 - (void)readAttributeWhitePointX:(ResponseHandler)completionHandler
1919 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1921 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1925 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1928 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1932 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel());
1933 if (err != CHIP_NO_ERROR) {
1936 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1940 - (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
1942 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1944 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1948 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1951 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1955 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel(), value);
1956 if (err != CHIP_NO_ERROR) {
1959 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1963 - (void)readAttributeWhitePointY:(ResponseHandler)completionHandler
1965 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1967 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1971 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1974 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1978 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel());
1979 if (err != CHIP_NO_ERROR) {
1982 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1986 - (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
1988 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1990 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1994 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1997 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2001 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel(), value);
2002 if (err != CHIP_NO_ERROR) {
2005 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2009 - (void)readAttributeColorPointRX:(ResponseHandler)completionHandler
2011 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2013 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2017 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2020 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2024 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel());
2025 if (err != CHIP_NO_ERROR) {
2028 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2032 - (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2034 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2036 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2040 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2043 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2047 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel(), value);
2048 if (err != CHIP_NO_ERROR) {
2051 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2055 - (void)readAttributeColorPointRY:(ResponseHandler)completionHandler
2057 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2059 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2063 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2066 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2070 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel());
2071 if (err != CHIP_NO_ERROR) {
2074 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2078 - (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2080 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2082 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2086 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2089 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2093 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel(), value);
2094 if (err != CHIP_NO_ERROR) {
2097 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2101 - (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler
2103 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2105 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2109 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2112 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2116 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel());
2117 if (err != CHIP_NO_ERROR) {
2120 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2124 - (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2126 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2128 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2132 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2135 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2139 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2140 if (err != CHIP_NO_ERROR) {
2143 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2147 - (void)readAttributeColorPointGX:(ResponseHandler)completionHandler
2149 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2151 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2155 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2158 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2162 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel());
2163 if (err != CHIP_NO_ERROR) {
2166 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2170 - (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2172 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2174 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2178 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2181 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2185 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel(), value);
2186 if (err != CHIP_NO_ERROR) {
2189 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2193 - (void)readAttributeColorPointGY:(ResponseHandler)completionHandler
2195 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2197 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2201 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2204 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2208 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel());
2209 if (err != CHIP_NO_ERROR) {
2212 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2216 - (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2218 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2220 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2224 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2227 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2231 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel(), value);
2232 if (err != CHIP_NO_ERROR) {
2235 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2239 - (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler
2241 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2243 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2247 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2250 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2254 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel());
2255 if (err != CHIP_NO_ERROR) {
2258 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2262 - (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2264 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2266 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2270 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2273 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2277 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2278 if (err != CHIP_NO_ERROR) {
2281 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2285 - (void)readAttributeColorPointBX:(ResponseHandler)completionHandler
2287 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2289 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2293 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2296 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2300 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel());
2301 if (err != CHIP_NO_ERROR) {
2304 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2308 - (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2310 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2312 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2316 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2319 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2323 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel(), value);
2324 if (err != CHIP_NO_ERROR) {
2327 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2331 - (void)readAttributeColorPointBY:(ResponseHandler)completionHandler
2333 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2335 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2339 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2342 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2346 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel());
2347 if (err != CHIP_NO_ERROR) {
2350 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2354 - (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2356 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2358 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2362 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2365 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2369 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel(), value);
2370 if (err != CHIP_NO_ERROR) {
2373 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2377 - (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler
2379 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2381 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2385 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2388 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2392 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel());
2393 if (err != CHIP_NO_ERROR) {
2396 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2400 - (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2402 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2404 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2408 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2411 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2415 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2416 if (err != CHIP_NO_ERROR) {
2419 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2423 - (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler
2425 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2427 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2431 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2434 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2438 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
2439 if (err != CHIP_NO_ERROR) {
2442 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2446 - (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler
2448 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2450 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2454 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2457 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2461 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedColorMode(onSuccess->Cancel(), onFailure->Cancel());
2462 if (err != CHIP_NO_ERROR) {
2465 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2469 - (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler
2471 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2473 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2477 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2480 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2484 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopActive(onSuccess->Cancel(), onFailure->Cancel());
2485 if (err != CHIP_NO_ERROR) {
2488 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2492 - (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler
2494 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2496 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2500 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2503 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2507 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopDirection(onSuccess->Cancel(), onFailure->Cancel());
2508 if (err != CHIP_NO_ERROR) {
2511 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2515 - (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler
2517 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2519 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2523 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2526 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2530 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopTime(onSuccess->Cancel(), onFailure->Cancel());
2531 if (err != CHIP_NO_ERROR) {
2534 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2538 - (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler
2540 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2542 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2546 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2549 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2553 CHIP_ERROR err = self.cppCluster.ReadAttributeColorCapabilities(onSuccess->Cancel(), onFailure->Cancel());
2554 if (err != CHIP_NO_ERROR) {
2557 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2561 - (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler
2563 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2565 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2569 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2572 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2576 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMin(onSuccess->Cancel(), onFailure->Cancel());
2577 if (err != CHIP_NO_ERROR) {
2580 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2584 - (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler
2586 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2588 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2592 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2595 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2599 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMax(onSuccess->Cancel(), onFailure->Cancel());
2600 if (err != CHIP_NO_ERROR) {
2603 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2607 - (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler
2609 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2611 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2615 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2618 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2622 CHIP_ERROR err = self.cppCluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccess->Cancel(), onFailure->Cancel());
2623 if (err != CHIP_NO_ERROR) {
2626 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2630 - (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler
2632 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2634 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2638 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2641 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2645 CHIP_ERROR err = self.cppCluster.ReadAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel());
2646 if (err != CHIP_NO_ERROR) {
2649 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2653 - (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2655 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2657 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2661 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2664 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2668 CHIP_ERROR err = self.cppCluster.WriteAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel(), value);
2669 if (err != CHIP_NO_ERROR) {
2672 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2676 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
2678 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2680 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2684 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2687 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2691 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
2692 if (err != CHIP_NO_ERROR) {
2695 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2701 @interface CHIPDoorLock ()
2702 @property (readonly) Controller::DoorLockCluster cppCluster;
2705 @implementation CHIPDoorLock
2707 - (Controller::ClusterBase *)getCluster
2709 return &_cppCluster;
2712 - (void)clearAllPins:(ResponseHandler)completionHandler
2714 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2716 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2720 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2723 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2727 CHIP_ERROR err = self.cppCluster.ClearAllPins(onSuccess->Cancel(), onFailure->Cancel());
2728 if (err != CHIP_NO_ERROR) {
2731 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2734 - (void)clearAllRfids:(ResponseHandler)completionHandler
2736 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2738 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2742 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2745 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2749 CHIP_ERROR err = self.cppCluster.ClearAllRfids(onSuccess->Cancel(), onFailure->Cancel());
2750 if (err != CHIP_NO_ERROR) {
2753 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2756 - (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
2758 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2760 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2764 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2767 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2771 CHIP_ERROR err = self.cppCluster.ClearHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
2772 if (err != CHIP_NO_ERROR) {
2775 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2778 - (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
2780 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2782 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2786 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2789 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2793 CHIP_ERROR err = self.cppCluster.ClearPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
2794 if (err != CHIP_NO_ERROR) {
2797 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2800 - (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
2802 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2804 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2808 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2811 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2815 CHIP_ERROR err = self.cppCluster.ClearRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
2816 if (err != CHIP_NO_ERROR) {
2819 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2822 - (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
2824 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2826 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2830 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2833 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2837 CHIP_ERROR err = self.cppCluster.ClearWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
2838 if (err != CHIP_NO_ERROR) {
2841 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2844 - (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
2846 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2848 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2852 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2855 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2859 CHIP_ERROR err = self.cppCluster.ClearYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
2860 if (err != CHIP_NO_ERROR) {
2863 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2866 - (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
2868 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2870 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2874 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2877 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2881 CHIP_ERROR err = self.cppCluster.GetHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
2882 if (err != CHIP_NO_ERROR) {
2885 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2888 - (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler
2890 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2892 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2896 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2899 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2903 CHIP_ERROR err = self.cppCluster.GetLogRecord(onSuccess->Cancel(), onFailure->Cancel(), logIndex);
2904 if (err != CHIP_NO_ERROR) {
2907 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2910 - (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
2912 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2914 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2918 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2921 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2925 CHIP_ERROR err = self.cppCluster.GetPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
2926 if (err != CHIP_NO_ERROR) {
2929 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2932 - (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
2934 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2936 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2940 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2943 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2947 CHIP_ERROR err = self.cppCluster.GetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
2948 if (err != CHIP_NO_ERROR) {
2951 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2954 - (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
2956 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2958 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2962 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2965 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2969 CHIP_ERROR err = self.cppCluster.GetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId);
2970 if (err != CHIP_NO_ERROR) {
2973 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2976 - (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
2978 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2980 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2984 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2987 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2991 CHIP_ERROR err = self.cppCluster.GetWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
2992 if (err != CHIP_NO_ERROR) {
2995 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2998 - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
3000 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3002 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3006 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3009 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3013 CHIP_ERROR err = self.cppCluster.GetYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
3014 if (err != CHIP_NO_ERROR) {
3017 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3020 - (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
3022 CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess
3023 = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
3025 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3029 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3032 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3036 CHIP_ERROR err = self.cppCluster.LockDoor(onSuccess->Cancel(), onFailure->Cancel(),
3037 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
3038 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
3039 if (err != CHIP_NO_ERROR) {
3042 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3045 - (void)setHolidaySchedule:(uint8_t)scheduleId
3046 localStartTime:(uint32_t)localStartTime
3047 localEndTime:(uint32_t)localEndTime
3048 operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday
3049 completionHandler:(ResponseHandler)completionHandler
3051 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3053 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3057 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3060 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3064 CHIP_ERROR err = self.cppCluster.SetHolidaySchedule(
3065 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, localStartTime, localEndTime, operatingModeDuringHoliday);
3066 if (err != CHIP_NO_ERROR) {
3069 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3072 - (void)setPin:(uint16_t)userId
3073 userStatus:(uint8_t)userStatus
3074 userType:(uint8_t)userType
3076 completionHandler:(ResponseHandler)completionHandler
3078 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3080 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3084 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3087 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3091 CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
3092 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
3093 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
3094 if (err != CHIP_NO_ERROR) {
3097 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3100 - (void)setRfid:(uint16_t)userId
3101 userStatus:(uint8_t)userStatus
3102 userType:(uint8_t)userType
3104 completionHandler:(ResponseHandler)completionHandler
3106 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3108 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3112 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3115 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3119 CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
3120 chip::ByteSpan((const uint8_t *) [id dataUsingEncoding:NSUTF8StringEncoding].bytes,
3121 [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
3122 if (err != CHIP_NO_ERROR) {
3125 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3128 - (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler
3130 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3132 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3136 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3139 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3143 CHIP_ERROR err = self.cppCluster.SetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId, userType);
3144 if (err != CHIP_NO_ERROR) {
3147 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3150 - (void)setWeekdaySchedule:(uint8_t)scheduleId
3151 userId:(uint16_t)userId
3152 daysMask:(uint8_t)daysMask
3153 startHour:(uint8_t)startHour
3154 startMinute:(uint8_t)startMinute
3155 endHour:(uint8_t)endHour
3156 endMinute:(uint8_t)endMinute
3157 completionHandler:(ResponseHandler)completionHandler
3159 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3161 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3165 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3168 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3172 CHIP_ERROR err = self.cppCluster.SetWeekdaySchedule(
3173 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, daysMask, startHour, startMinute, endHour, endMinute);
3174 if (err != CHIP_NO_ERROR) {
3177 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3180 - (void)setYeardaySchedule:(uint8_t)scheduleId
3181 userId:(uint16_t)userId
3182 localStartTime:(uint32_t)localStartTime
3183 localEndTime:(uint32_t)localEndTime
3184 completionHandler:(ResponseHandler)completionHandler
3186 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3188 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3192 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3195 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3199 CHIP_ERROR err = self.cppCluster.SetYeardaySchedule(
3200 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, localStartTime, localEndTime);
3201 if (err != CHIP_NO_ERROR) {
3204 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3207 - (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
3209 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess
3210 = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
3212 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3216 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3219 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3223 CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(),
3224 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
3225 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
3226 if (err != CHIP_NO_ERROR) {
3229 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3232 - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
3234 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3236 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3240 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3243 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3247 CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds,
3248 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
3249 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
3250 if (err != CHIP_NO_ERROR) {
3253 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3257 - (void)readAttributeLockState:(ResponseHandler)completionHandler
3259 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3261 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3265 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3268 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3272 CHIP_ERROR err = self.cppCluster.ReadAttributeLockState(onSuccess->Cancel(), onFailure->Cancel());
3273 if (err != CHIP_NO_ERROR) {
3276 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3280 - (void)configureAttributeLockState:(uint16_t)minInterval
3281 maxInterval:(uint16_t)maxInterval
3282 completionHandler:(ResponseHandler)completionHandler
3284 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3286 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3290 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3293 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3298 = self.cppCluster.ConfigureAttributeLockState(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
3299 if (err != CHIP_NO_ERROR) {
3302 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3306 - (void)reportAttributeLockState:(ResponseHandler)reportHandler
3308 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
3310 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3314 CHIP_ERROR err = self.cppCluster.ReportAttributeLockState(onReport->Cancel());
3315 if (err != CHIP_NO_ERROR) {
3317 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
3321 - (void)readAttributeLockType:(ResponseHandler)completionHandler
3323 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3325 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3329 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3332 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3336 CHIP_ERROR err = self.cppCluster.ReadAttributeLockType(onSuccess->Cancel(), onFailure->Cancel());
3337 if (err != CHIP_NO_ERROR) {
3340 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3344 - (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler
3346 CHIPBooleanAttributeCallbackBridge * onSuccess
3347 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3349 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3353 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3356 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3360 CHIP_ERROR err = self.cppCluster.ReadAttributeActuatorEnabled(onSuccess->Cancel(), onFailure->Cancel());
3361 if (err != CHIP_NO_ERROR) {
3364 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3368 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
3370 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3372 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3376 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3379 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3383 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
3384 if (err != CHIP_NO_ERROR) {
3387 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);