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 = [NSError errorWithDomain:CHIPErrorDomain
79 userInfo:@ { NSLocalizedDescriptionKey : @"" }];
80 callback->mHandler(error, nil);
88 ResponseHandler mHandler;
89 dispatch_queue_t mQueue;
92 class CHIPStringAttributeCallbackBridge : public Callback::Callback<StringAttributeCallback> {
94 CHIPStringAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool octetString, bool keepAlive = false)
95 : Callback::Callback<StringAttributeCallback>(CallbackFn, this)
98 , mOctetString(octetString)
99 , mKeepAlive(keepAlive)
103 ~CHIPStringAttributeCallbackBridge() {};
105 static void CallbackFn(void * context, chip::ByteSpan value)
107 CHIPStringAttributeCallbackBridge * callback = reinterpret_cast<CHIPStringAttributeCallbackBridge *>(context);
108 if (callback && callback->mQueue) {
109 dispatch_async(callback->mQueue, ^{
110 if (callback->mOctetString) {
111 NSData * data = [NSData dataWithBytes:value.data() length:value.size()];
112 callback->mHandler(nil, @ { @"value" : data });
114 NSString * str = [[NSString alloc] initWithBytes:value.data()
116 encoding:NSUTF8StringEncoding];
117 callback->mHandler(nil, @ { @"value" : str });
120 if (!callback->mKeepAlive) {
129 ResponseHandler mHandler;
130 dispatch_queue_t mQueue;
135 class CHIPBooleanAttributeCallbackBridge : public Callback::Callback<BooleanAttributeCallback> {
137 CHIPBooleanAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
138 : Callback::Callback<BooleanAttributeCallback>(CallbackFn, this)
141 , mKeepAlive(keepAlive)
145 ~CHIPBooleanAttributeCallbackBridge() {};
147 static void CallbackFn(void * context, bool value)
149 CHIPBooleanAttributeCallbackBridge * callback = reinterpret_cast<CHIPBooleanAttributeCallbackBridge *>(context);
150 if (callback && callback->mQueue) {
151 dispatch_async(callback->mQueue, ^{
152 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithBool:value] });
153 if (!callback->mKeepAlive) {
162 ResponseHandler mHandler;
163 dispatch_queue_t mQueue;
167 class CHIPInt8uAttributeCallbackBridge : public Callback::Callback<Int8uAttributeCallback> {
169 CHIPInt8uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
170 : Callback::Callback<Int8uAttributeCallback>(CallbackFn, this)
173 , mKeepAlive(keepAlive)
177 ~CHIPInt8uAttributeCallbackBridge() {};
179 static void CallbackFn(void * context, uint8_t value)
181 CHIPInt8uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt8uAttributeCallbackBridge *>(context);
182 if (callback && callback->mQueue) {
183 dispatch_async(callback->mQueue, ^{
184 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedChar:value] });
185 if (!callback->mKeepAlive) {
194 ResponseHandler mHandler;
195 dispatch_queue_t mQueue;
199 class CHIPInt8sAttributeCallbackBridge : public Callback::Callback<Int8sAttributeCallback> {
201 CHIPInt8sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
202 : Callback::Callback<Int8sAttributeCallback>(CallbackFn, this)
205 , mKeepAlive(keepAlive)
209 ~CHIPInt8sAttributeCallbackBridge() {};
211 static void CallbackFn(void * context, int8_t value)
213 CHIPInt8sAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt8sAttributeCallbackBridge *>(context);
214 if (callback && callback->mQueue) {
215 dispatch_async(callback->mQueue, ^{
216 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithChar:value] });
217 if (!callback->mKeepAlive) {
226 ResponseHandler mHandler;
227 dispatch_queue_t mQueue;
231 class CHIPInt16uAttributeCallbackBridge : public Callback::Callback<Int16uAttributeCallback> {
233 CHIPInt16uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
234 : Callback::Callback<Int16uAttributeCallback>(CallbackFn, this)
237 , mKeepAlive(keepAlive)
241 ~CHIPInt16uAttributeCallbackBridge() {};
243 static void CallbackFn(void * context, uint16_t value)
245 CHIPInt16uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt16uAttributeCallbackBridge *>(context);
246 if (callback && callback->mQueue) {
247 dispatch_async(callback->mQueue, ^{
248 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedShort:value] });
249 if (!callback->mKeepAlive) {
258 ResponseHandler mHandler;
259 dispatch_queue_t mQueue;
263 class CHIPInt32uAttributeCallbackBridge : public Callback::Callback<Int32uAttributeCallback> {
265 CHIPInt32uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
266 : Callback::Callback<Int32uAttributeCallback>(CallbackFn, this)
269 , mKeepAlive(keepAlive)
273 ~CHIPInt32uAttributeCallbackBridge() {};
275 static void CallbackFn(void * context, uint32_t value)
277 CHIPInt32uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt32uAttributeCallbackBridge *>(context);
278 if (callback && callback->mQueue) {
279 dispatch_async(callback->mQueue, ^{
280 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedLong:value] });
281 if (!callback->mKeepAlive) {
290 ResponseHandler mHandler;
291 dispatch_queue_t mQueue;
295 class CHIPInt16sAttributeCallbackBridge : public Callback::Callback<Int16sAttributeCallback> {
297 CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
298 : Callback::Callback<Int16sAttributeCallback>(CallbackFn, this)
301 , mKeepAlive(keepAlive)
305 ~CHIPInt16sAttributeCallbackBridge() {};
307 static void CallbackFn(void * context, int16_t value)
309 CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt16sAttributeCallbackBridge *>(context);
310 if (callback && callback->mQueue) {
311 dispatch_async(callback->mQueue, ^{
312 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] });
313 if (!callback->mKeepAlive) {
322 ResponseHandler mHandler;
323 dispatch_queue_t mQueue;
327 class CHIPDoorLockClusterLockDoorResponseCallbackBridge : public Callback::Callback<DoorLockClusterLockDoorResponseCallback> {
329 CHIPDoorLockClusterLockDoorResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
330 : Callback::Callback<DoorLockClusterLockDoorResponseCallback>(CallbackFn, this)
336 ~CHIPDoorLockClusterLockDoorResponseCallbackBridge() {};
338 static void CallbackFn(void * context)
340 CHIPDoorLockClusterLockDoorResponseCallbackBridge * callback
341 = reinterpret_cast<CHIPDoorLockClusterLockDoorResponseCallbackBridge *>(context);
342 if (callback && callback->mQueue) {
343 dispatch_async(callback->mQueue, ^{
344 callback->mHandler(nil, @ {});
352 ResponseHandler mHandler;
353 dispatch_queue_t mQueue;
356 class CHIPDoorLockClusterUnlockDoorResponseCallbackBridge : public Callback::Callback<DoorLockClusterUnlockDoorResponseCallback> {
358 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
359 : Callback::Callback<DoorLockClusterUnlockDoorResponseCallback>(CallbackFn, this)
365 ~CHIPDoorLockClusterUnlockDoorResponseCallbackBridge() {};
367 static void CallbackFn(void * context)
369 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * callback
370 = reinterpret_cast<CHIPDoorLockClusterUnlockDoorResponseCallbackBridge *>(context);
371 if (callback && callback->mQueue) {
372 dispatch_async(callback->mQueue, ^{
373 callback->mHandler(nil, @ {});
381 ResponseHandler mHandler;
382 dispatch_queue_t mQueue;
385 @interface CHIPCluster ()
386 @property (readonly, nonatomic) dispatch_queue_t callbackQueue;
387 - (Controller::ClusterBase *)getCluster;
390 @implementation CHIPCluster
391 - (instancetype)initWithDevice:(CHIPDevice *)device endpoint:(EndpointId)endpoint queue:(dispatch_queue_t)queue
393 if (self = [super init]) {
394 Controller::ClusterBase * cppCluster = [self getCluster];
395 if (cppCluster == nullptr) {
399 CHIP_ERROR err = cppCluster->Associate([device internalDevice], endpoint);
400 if (err != CHIP_NO_ERROR) {
404 _callbackQueue = queue;
409 - (Controller::ClusterBase *)getCluster
415 @interface CHIPApplicationBasic ()
416 @property (readonly) Controller::ApplicationBasicCluster cppCluster;
419 @implementation CHIPApplicationBasic
421 - (Controller::ClusterBase *)getCluster
426 - (void)readAttributeVendorName:(ResponseHandler)completionHandler
428 CHIPStringAttributeCallbackBridge * onSuccess
429 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
431 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
435 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
438 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
442 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
443 if (err != CHIP_NO_ERROR) {
446 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
450 - (void)readAttributeVendorId:(ResponseHandler)completionHandler
452 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
454 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
458 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
461 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
465 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel());
466 if (err != CHIP_NO_ERROR) {
469 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
473 - (void)readAttributeApplicationName:(ResponseHandler)completionHandler
475 CHIPStringAttributeCallbackBridge * onSuccess
476 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
478 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
482 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
485 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
489 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationName(onSuccess->Cancel(), onFailure->Cancel());
490 if (err != CHIP_NO_ERROR) {
493 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
497 - (void)readAttributeProductId:(ResponseHandler)completionHandler
499 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
501 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
505 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
508 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
512 CHIP_ERROR err = self.cppCluster.ReadAttributeProductId(onSuccess->Cancel(), onFailure->Cancel());
513 if (err != CHIP_NO_ERROR) {
516 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
520 - (void)readAttributeApplicationId:(ResponseHandler)completionHandler
522 CHIPStringAttributeCallbackBridge * onSuccess
523 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
525 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
529 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
532 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
536 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationId(onSuccess->Cancel(), onFailure->Cancel());
537 if (err != CHIP_NO_ERROR) {
540 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
544 - (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler
546 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
548 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
552 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
555 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
559 CHIP_ERROR err = self.cppCluster.ReadAttributeCatalogVendorId(onSuccess->Cancel(), onFailure->Cancel());
560 if (err != CHIP_NO_ERROR) {
563 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
567 - (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler
569 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
571 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
575 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
578 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
582 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationSatus(onSuccess->Cancel(), onFailure->Cancel());
583 if (err != CHIP_NO_ERROR) {
586 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
590 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
592 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
594 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
598 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
601 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
605 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
606 if (err != CHIP_NO_ERROR) {
609 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
615 @interface CHIPBarrierControl ()
616 @property (readonly) Controller::BarrierControlCluster cppCluster;
619 @implementation CHIPBarrierControl
621 - (Controller::ClusterBase *)getCluster
626 - (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler
628 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
630 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
634 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
637 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
641 CHIP_ERROR err = self.cppCluster.BarrierControlGoToPercent(onSuccess->Cancel(), onFailure->Cancel(), percentOpen);
642 if (err != CHIP_NO_ERROR) {
645 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
648 - (void)barrierControlStop:(ResponseHandler)completionHandler
650 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
652 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
656 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
659 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
663 CHIP_ERROR err = self.cppCluster.BarrierControlStop(onSuccess->Cancel(), onFailure->Cancel());
664 if (err != CHIP_NO_ERROR) {
667 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
671 - (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler
673 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
675 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
679 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
682 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
686 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierMovingState(onSuccess->Cancel(), onFailure->Cancel());
687 if (err != CHIP_NO_ERROR) {
690 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
694 - (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler
696 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
698 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
702 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
705 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
709 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierSafetyStatus(onSuccess->Cancel(), onFailure->Cancel());
710 if (err != CHIP_NO_ERROR) {
713 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
717 - (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler
719 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
721 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
725 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
728 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
732 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierCapabilities(onSuccess->Cancel(), onFailure->Cancel());
733 if (err != CHIP_NO_ERROR) {
736 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
740 - (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler
742 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
744 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
748 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
751 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
755 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierPosition(onSuccess->Cancel(), onFailure->Cancel());
756 if (err != CHIP_NO_ERROR) {
759 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
763 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
765 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
767 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
771 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
774 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
778 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
779 if (err != CHIP_NO_ERROR) {
782 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
788 @interface CHIPBarrierControl ()
789 @property (readonly) Controller::BarrierControlCluster cppCluster;
792 @implementation CHIPBarrierControl
794 - (Controller::ClusterBase *)getCluster
799 - (void)barrierControlGoToPercent:(uint8_t)percentOpen 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.BarrierControlGoToPercent(onSuccess->Cancel(), onFailure->Cancel(), percentOpen);
815 if (err != CHIP_NO_ERROR) {
818 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
821 - (void)barrierControlStop:(ResponseHandler)completionHandler
823 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
825 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
829 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
832 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
836 CHIP_ERROR err = self.cppCluster.BarrierControlStop(onSuccess->Cancel(), onFailure->Cancel());
837 if (err != CHIP_NO_ERROR) {
840 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
844 - (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler
846 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
848 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
852 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
855 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
859 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierMovingState(onSuccess->Cancel(), onFailure->Cancel());
860 if (err != CHIP_NO_ERROR) {
863 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
867 - (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler
869 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
871 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
875 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
878 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
882 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierSafetyStatus(onSuccess->Cancel(), onFailure->Cancel());
883 if (err != CHIP_NO_ERROR) {
886 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
890 - (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler
892 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
894 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
898 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
901 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
905 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierCapabilities(onSuccess->Cancel(), onFailure->Cancel());
906 if (err != CHIP_NO_ERROR) {
909 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
913 - (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler
915 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
917 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
921 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
924 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
928 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierPosition(onSuccess->Cancel(), onFailure->Cancel());
929 if (err != CHIP_NO_ERROR) {
932 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
936 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
938 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
940 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
944 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
947 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
951 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
952 if (err != CHIP_NO_ERROR) {
955 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
961 @interface CHIPBasic ()
962 @property (readonly) Controller::BasicCluster cppCluster;
965 @implementation CHIPBasic
967 - (Controller::ClusterBase *)getCluster
972 - (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler
974 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
976 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
980 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
983 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
987 CHIP_ERROR err = self.cppCluster.ReadAttributeInteractionModelVersion(onSuccess->Cancel(), onFailure->Cancel());
988 if (err != CHIP_NO_ERROR) {
991 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
995 - (void)readAttributeVendorName:(ResponseHandler)completionHandler
997 CHIPStringAttributeCallbackBridge * onSuccess
998 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
1000 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1004 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1007 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1011 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
1012 if (err != CHIP_NO_ERROR) {
1015 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1019 - (void)readAttributeVendorID:(ResponseHandler)completionHandler
1021 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1023 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1027 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1030 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1034 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel());
1035 if (err != CHIP_NO_ERROR) {
1038 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1042 - (void)readAttributeProductName:(ResponseHandler)completionHandler
1044 CHIPStringAttributeCallbackBridge * onSuccess
1045 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
1047 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1051 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1054 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1058 CHIP_ERROR err = self.cppCluster.ReadAttributeProductName(onSuccess->Cancel(), onFailure->Cancel());
1059 if (err != CHIP_NO_ERROR) {
1062 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1066 - (void)readAttributeProductID:(ResponseHandler)completionHandler
1068 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1070 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1074 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1077 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1081 CHIP_ERROR err = self.cppCluster.ReadAttributeProductID(onSuccess->Cancel(), onFailure->Cancel());
1082 if (err != CHIP_NO_ERROR) {
1085 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1089 - (void)readAttributeUserLabel:(ResponseHandler)completionHandler
1091 CHIPStringAttributeCallbackBridge * onSuccess
1092 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
1094 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1098 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1101 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1105 CHIP_ERROR err = self.cppCluster.ReadAttributeUserLabel(onSuccess->Cancel(), onFailure->Cancel());
1106 if (err != CHIP_NO_ERROR) {
1109 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1113 - (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler
1115 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1117 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1121 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1124 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1128 NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
1129 CHIP_ERROR err = self.cppCluster.WriteAttributeUserLabel(
1130 onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
1131 if (err != CHIP_NO_ERROR) {
1134 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1138 - (void)readAttributeLocation:(ResponseHandler)completionHandler
1140 CHIPStringAttributeCallbackBridge * onSuccess
1141 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
1143 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1147 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1150 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1154 CHIP_ERROR err = self.cppCluster.ReadAttributeLocation(onSuccess->Cancel(), onFailure->Cancel());
1155 if (err != CHIP_NO_ERROR) {
1158 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1162 - (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler
1164 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1166 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1170 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1173 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1177 NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
1178 CHIP_ERROR err = self.cppCluster.WriteAttributeLocation(
1179 onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
1180 if (err != CHIP_NO_ERROR) {
1183 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1187 - (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler
1189 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1191 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1195 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1198 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1202 CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel());
1203 if (err != CHIP_NO_ERROR) {
1206 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1210 - (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler
1212 CHIPStringAttributeCallbackBridge * onSuccess
1213 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
1215 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1219 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1222 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1226 CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
1227 if (err != CHIP_NO_ERROR) {
1230 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1234 - (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler
1236 CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(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.ReadAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel());
1250 if (err != CHIP_NO_ERROR) {
1253 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1257 - (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler
1259 CHIPStringAttributeCallbackBridge * onSuccess
1260 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
1262 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1266 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1269 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1273 CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
1274 if (err != CHIP_NO_ERROR) {
1277 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1281 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
1283 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1285 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1289 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1292 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1296 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
1297 if (err != CHIP_NO_ERROR) {
1300 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1306 @interface CHIPColorControl ()
1307 @property (readonly) Controller::ColorControlCluster cppCluster;
1310 @implementation CHIPColorControl
1312 - (Controller::ClusterBase *)getCluster
1314 return &_cppCluster;
1317 - (void)moveColor:(int16_t)rateX
1318 rateY:(int16_t)rateY
1319 optionsMask:(uint8_t)optionsMask
1320 optionsOverride:(uint8_t)optionsOverride
1321 completionHandler:(ResponseHandler)completionHandler
1323 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1325 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1329 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1332 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1337 = self.cppCluster.MoveColor(onSuccess->Cancel(), onFailure->Cancel(), rateX, rateY, optionsMask, optionsOverride);
1338 if (err != CHIP_NO_ERROR) {
1341 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1344 - (void)moveColorTemperature:(uint8_t)moveMode
1346 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
1347 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
1348 optionsMask:(uint8_t)optionsMask
1349 optionsOverride:(uint8_t)optionsOverride
1350 completionHandler:(ResponseHandler)completionHandler
1352 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1354 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1358 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1361 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1365 CHIP_ERROR err = self.cppCluster.MoveColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate,
1366 colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
1367 if (err != CHIP_NO_ERROR) {
1370 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1373 - (void)moveHue:(uint8_t)moveMode
1375 optionsMask:(uint8_t)optionsMask
1376 optionsOverride:(uint8_t)optionsOverride
1377 completionHandler:(ResponseHandler)completionHandler
1379 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1381 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1385 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1388 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1393 = self.cppCluster.MoveHue(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
1394 if (err != CHIP_NO_ERROR) {
1397 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1400 - (void)moveSaturation:(uint8_t)moveMode
1402 optionsMask:(uint8_t)optionsMask
1403 optionsOverride:(uint8_t)optionsOverride
1404 completionHandler:(ResponseHandler)completionHandler
1406 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1408 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1412 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1415 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1420 = self.cppCluster.MoveSaturation(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
1421 if (err != CHIP_NO_ERROR) {
1424 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1427 - (void)moveToColor:(uint16_t)colorX
1428 colorY:(uint16_t)colorY
1429 transitionTime:(uint16_t)transitionTime
1430 optionsMask:(uint8_t)optionsMask
1431 optionsOverride:(uint8_t)optionsOverride
1432 completionHandler:(ResponseHandler)completionHandler
1434 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1436 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1440 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1443 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1447 CHIP_ERROR err = self.cppCluster.MoveToColor(
1448 onSuccess->Cancel(), onFailure->Cancel(), colorX, colorY, transitionTime, optionsMask, optionsOverride);
1449 if (err != CHIP_NO_ERROR) {
1452 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1455 - (void)moveToColorTemperature:(uint16_t)colorTemperature
1456 transitionTime:(uint16_t)transitionTime
1457 optionsMask:(uint8_t)optionsMask
1458 optionsOverride:(uint8_t)optionsOverride
1459 completionHandler:(ResponseHandler)completionHandler
1461 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1463 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1467 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1470 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1474 CHIP_ERROR err = self.cppCluster.MoveToColorTemperature(
1475 onSuccess->Cancel(), onFailure->Cancel(), colorTemperature, transitionTime, optionsMask, optionsOverride);
1476 if (err != CHIP_NO_ERROR) {
1479 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1482 - (void)moveToHue:(uint8_t)hue
1483 direction:(uint8_t)direction
1484 transitionTime:(uint16_t)transitionTime
1485 optionsMask:(uint8_t)optionsMask
1486 optionsOverride:(uint8_t)optionsOverride
1487 completionHandler:(ResponseHandler)completionHandler
1489 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1491 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1495 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1498 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1502 CHIP_ERROR err = self.cppCluster.MoveToHue(
1503 onSuccess->Cancel(), onFailure->Cancel(), hue, direction, transitionTime, optionsMask, optionsOverride);
1504 if (err != CHIP_NO_ERROR) {
1507 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1510 - (void)moveToHueAndSaturation:(uint8_t)hue
1511 saturation:(uint8_t)saturation
1512 transitionTime:(uint16_t)transitionTime
1513 optionsMask:(uint8_t)optionsMask
1514 optionsOverride:(uint8_t)optionsOverride
1515 completionHandler:(ResponseHandler)completionHandler
1517 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1519 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1523 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1526 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1530 CHIP_ERROR err = self.cppCluster.MoveToHueAndSaturation(
1531 onSuccess->Cancel(), onFailure->Cancel(), hue, saturation, transitionTime, optionsMask, optionsOverride);
1532 if (err != CHIP_NO_ERROR) {
1535 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1538 - (void)moveToSaturation:(uint8_t)saturation
1539 transitionTime:(uint16_t)transitionTime
1540 optionsMask:(uint8_t)optionsMask
1541 optionsOverride:(uint8_t)optionsOverride
1542 completionHandler:(ResponseHandler)completionHandler
1544 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1546 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1550 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1553 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1557 CHIP_ERROR err = self.cppCluster.MoveToSaturation(
1558 onSuccess->Cancel(), onFailure->Cancel(), saturation, transitionTime, optionsMask, optionsOverride);
1559 if (err != CHIP_NO_ERROR) {
1562 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1565 - (void)stepColor:(int16_t)stepX
1566 stepY:(int16_t)stepY
1567 transitionTime:(uint16_t)transitionTime
1568 optionsMask:(uint8_t)optionsMask
1569 optionsOverride:(uint8_t)optionsOverride
1570 completionHandler:(ResponseHandler)completionHandler
1572 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1574 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1578 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1581 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1585 CHIP_ERROR err = self.cppCluster.StepColor(
1586 onSuccess->Cancel(), onFailure->Cancel(), stepX, stepY, transitionTime, optionsMask, optionsOverride);
1587 if (err != CHIP_NO_ERROR) {
1590 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1593 - (void)stepColorTemperature:(uint8_t)stepMode
1594 stepSize:(uint16_t)stepSize
1595 transitionTime:(uint16_t)transitionTime
1596 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
1597 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
1598 optionsMask:(uint8_t)optionsMask
1599 optionsOverride:(uint8_t)optionsOverride
1600 completionHandler:(ResponseHandler)completionHandler
1602 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1604 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1608 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1611 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1615 CHIP_ERROR err = self.cppCluster.StepColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize,
1616 transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
1617 if (err != CHIP_NO_ERROR) {
1620 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1623 - (void)stepHue:(uint8_t)stepMode
1624 stepSize:(uint8_t)stepSize
1625 transitionTime:(uint8_t)transitionTime
1626 optionsMask:(uint8_t)optionsMask
1627 optionsOverride:(uint8_t)optionsOverride
1628 completionHandler:(ResponseHandler)completionHandler
1630 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1632 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1636 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1639 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1643 CHIP_ERROR err = self.cppCluster.StepHue(
1644 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
1645 if (err != CHIP_NO_ERROR) {
1648 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1651 - (void)stepSaturation:(uint8_t)stepMode
1652 stepSize:(uint8_t)stepSize
1653 transitionTime:(uint8_t)transitionTime
1654 optionsMask:(uint8_t)optionsMask
1655 optionsOverride:(uint8_t)optionsOverride
1656 completionHandler:(ResponseHandler)completionHandler
1658 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1660 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1664 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1667 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1671 CHIP_ERROR err = self.cppCluster.StepSaturation(
1672 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
1673 if (err != CHIP_NO_ERROR) {
1676 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1679 - (void)stopMoveStep:(uint8_t)optionsMask
1680 optionsOverride:(uint8_t)optionsOverride
1681 completionHandler:(ResponseHandler)completionHandler
1683 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1685 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1689 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1692 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1696 CHIP_ERROR err = self.cppCluster.StopMoveStep(onSuccess->Cancel(), onFailure->Cancel(), optionsMask, optionsOverride);
1697 if (err != CHIP_NO_ERROR) {
1700 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1704 - (void)readAttributeCurrentHue:(ResponseHandler)completionHandler
1706 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1708 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1712 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1715 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1719 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
1720 if (err != CHIP_NO_ERROR) {
1723 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1727 - (void)configureAttributeCurrentHue:(uint16_t)minInterval
1728 maxInterval:(uint16_t)maxInterval
1729 change:(uint8_t)change
1730 completionHandler:(ResponseHandler)completionHandler
1732 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1734 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1738 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1741 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1746 = self.cppCluster.ConfigureAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1747 if (err != CHIP_NO_ERROR) {
1750 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1754 - (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler
1756 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1758 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1762 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentHue(onReport->Cancel());
1763 if (err != CHIP_NO_ERROR) {
1765 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1769 - (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler
1771 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1773 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1777 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1780 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1784 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentSaturation(onSuccess->Cancel(), onFailure->Cancel());
1785 if (err != CHIP_NO_ERROR) {
1788 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1792 - (void)configureAttributeCurrentSaturation:(uint16_t)minInterval
1793 maxInterval:(uint16_t)maxInterval
1794 change:(uint8_t)change
1795 completionHandler:(ResponseHandler)completionHandler
1797 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1799 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1803 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1806 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1810 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentSaturation(
1811 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1812 if (err != CHIP_NO_ERROR) {
1815 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1819 - (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler
1821 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1823 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1827 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentSaturation(onReport->Cancel());
1828 if (err != CHIP_NO_ERROR) {
1830 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1834 - (void)readAttributeRemainingTime:(ResponseHandler)completionHandler
1836 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1838 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1842 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1845 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1849 CHIP_ERROR err = self.cppCluster.ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel());
1850 if (err != CHIP_NO_ERROR) {
1853 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1857 - (void)readAttributeCurrentX:(ResponseHandler)completionHandler
1859 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1861 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1865 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1868 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1872 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel());
1873 if (err != CHIP_NO_ERROR) {
1876 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1880 - (void)configureAttributeCurrentX:(uint16_t)minInterval
1881 maxInterval:(uint16_t)maxInterval
1882 change:(uint16_t)change
1883 completionHandler:(ResponseHandler)completionHandler
1885 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1887 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1891 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1894 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1899 = self.cppCluster.ConfigureAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1900 if (err != CHIP_NO_ERROR) {
1903 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1907 - (void)reportAttributeCurrentX:(ResponseHandler)reportHandler
1909 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1911 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1915 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentX(onReport->Cancel());
1916 if (err != CHIP_NO_ERROR) {
1918 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1922 - (void)readAttributeCurrentY:(ResponseHandler)completionHandler
1924 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1926 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1930 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1933 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1937 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel());
1938 if (err != CHIP_NO_ERROR) {
1941 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1945 - (void)configureAttributeCurrentY:(uint16_t)minInterval
1946 maxInterval:(uint16_t)maxInterval
1947 change:(uint16_t)change
1948 completionHandler:(ResponseHandler)completionHandler
1950 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1952 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1956 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1959 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1964 = self.cppCluster.ConfigureAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
1965 if (err != CHIP_NO_ERROR) {
1968 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1972 - (void)reportAttributeCurrentY:(ResponseHandler)reportHandler
1974 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
1976 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1980 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentY(onReport->Cancel());
1981 if (err != CHIP_NO_ERROR) {
1983 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
1987 - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler
1989 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1991 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1995 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1998 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2002 CHIP_ERROR err = self.cppCluster.ReadAttributeDriftCompensation(onSuccess->Cancel(), onFailure->Cancel());
2003 if (err != CHIP_NO_ERROR) {
2006 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2010 - (void)readAttributeCompensationText:(ResponseHandler)completionHandler
2012 CHIPStringAttributeCallbackBridge * onSuccess
2013 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
2015 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2019 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2022 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2026 CHIP_ERROR err = self.cppCluster.ReadAttributeCompensationText(onSuccess->Cancel(), onFailure->Cancel());
2027 if (err != CHIP_NO_ERROR) {
2030 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2034 - (void)readAttributeColorTemperature:(ResponseHandler)completionHandler
2036 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2038 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2042 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2045 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2049 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTemperature(onSuccess->Cancel(), onFailure->Cancel());
2050 if (err != CHIP_NO_ERROR) {
2053 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2057 - (void)configureAttributeColorTemperature:(uint16_t)minInterval
2058 maxInterval:(uint16_t)maxInterval
2059 change:(uint16_t)change
2060 completionHandler:(ResponseHandler)completionHandler
2062 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2064 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2068 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2071 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2075 CHIP_ERROR err = self.cppCluster.ConfigureAttributeColorTemperature(
2076 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
2077 if (err != CHIP_NO_ERROR) {
2080 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2084 - (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler
2086 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
2088 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2092 CHIP_ERROR err = self.cppCluster.ReportAttributeColorTemperature(onReport->Cancel());
2093 if (err != CHIP_NO_ERROR) {
2095 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
2099 - (void)readAttributeColorMode:(ResponseHandler)completionHandler
2101 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2103 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2107 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2110 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2114 CHIP_ERROR err = self.cppCluster.ReadAttributeColorMode(onSuccess->Cancel(), onFailure->Cancel());
2115 if (err != CHIP_NO_ERROR) {
2118 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2122 - (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler
2124 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2126 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2130 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2133 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2137 CHIP_ERROR err = self.cppCluster.ReadAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel());
2138 if (err != CHIP_NO_ERROR) {
2141 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2145 - (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2147 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2149 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2153 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2156 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2160 CHIP_ERROR err = self.cppCluster.WriteAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel(), value);
2161 if (err != CHIP_NO_ERROR) {
2164 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2168 - (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler
2170 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2172 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2176 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2179 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2183 CHIP_ERROR err = self.cppCluster.ReadAttributeNumberOfPrimaries(onSuccess->Cancel(), onFailure->Cancel());
2184 if (err != CHIP_NO_ERROR) {
2187 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2191 - (void)readAttributePrimary1X:(ResponseHandler)completionHandler
2193 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2195 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2199 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2202 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2206 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1X(onSuccess->Cancel(), onFailure->Cancel());
2207 if (err != CHIP_NO_ERROR) {
2210 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2214 - (void)readAttributePrimary1Y:(ResponseHandler)completionHandler
2216 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2218 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2222 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2225 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2229 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Y(onSuccess->Cancel(), onFailure->Cancel());
2230 if (err != CHIP_NO_ERROR) {
2233 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2237 - (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler
2239 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2241 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2245 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2248 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2252 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Intensity(onSuccess->Cancel(), onFailure->Cancel());
2253 if (err != CHIP_NO_ERROR) {
2256 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2260 - (void)readAttributePrimary2X:(ResponseHandler)completionHandler
2262 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2264 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2268 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2271 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2275 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2X(onSuccess->Cancel(), onFailure->Cancel());
2276 if (err != CHIP_NO_ERROR) {
2279 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2283 - (void)readAttributePrimary2Y:(ResponseHandler)completionHandler
2285 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2287 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2291 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2294 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2298 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Y(onSuccess->Cancel(), onFailure->Cancel());
2299 if (err != CHIP_NO_ERROR) {
2302 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2306 - (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler
2308 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2310 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2314 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2317 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2321 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Intensity(onSuccess->Cancel(), onFailure->Cancel());
2322 if (err != CHIP_NO_ERROR) {
2325 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2329 - (void)readAttributePrimary3X:(ResponseHandler)completionHandler
2331 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2333 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2337 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2340 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2344 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3X(onSuccess->Cancel(), onFailure->Cancel());
2345 if (err != CHIP_NO_ERROR) {
2348 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2352 - (void)readAttributePrimary3Y:(ResponseHandler)completionHandler
2354 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2356 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2360 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2363 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2367 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Y(onSuccess->Cancel(), onFailure->Cancel());
2368 if (err != CHIP_NO_ERROR) {
2371 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2375 - (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler
2377 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2379 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2383 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2386 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2390 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Intensity(onSuccess->Cancel(), onFailure->Cancel());
2391 if (err != CHIP_NO_ERROR) {
2394 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2398 - (void)readAttributePrimary4X:(ResponseHandler)completionHandler
2400 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2402 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2406 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2409 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2413 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4X(onSuccess->Cancel(), onFailure->Cancel());
2414 if (err != CHIP_NO_ERROR) {
2417 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2421 - (void)readAttributePrimary4Y:(ResponseHandler)completionHandler
2423 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2425 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2429 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2432 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2436 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Y(onSuccess->Cancel(), onFailure->Cancel());
2437 if (err != CHIP_NO_ERROR) {
2440 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2444 - (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler
2446 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2448 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2452 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2455 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2459 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Intensity(onSuccess->Cancel(), onFailure->Cancel());
2460 if (err != CHIP_NO_ERROR) {
2463 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2467 - (void)readAttributePrimary5X:(ResponseHandler)completionHandler
2469 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2471 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2475 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2478 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2482 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5X(onSuccess->Cancel(), onFailure->Cancel());
2483 if (err != CHIP_NO_ERROR) {
2486 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2490 - (void)readAttributePrimary5Y:(ResponseHandler)completionHandler
2492 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2494 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2498 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2501 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2505 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Y(onSuccess->Cancel(), onFailure->Cancel());
2506 if (err != CHIP_NO_ERROR) {
2509 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2513 - (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler
2515 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2517 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2521 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2524 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2528 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Intensity(onSuccess->Cancel(), onFailure->Cancel());
2529 if (err != CHIP_NO_ERROR) {
2532 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2536 - (void)readAttributePrimary6X:(ResponseHandler)completionHandler
2538 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2540 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2544 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2547 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2551 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6X(onSuccess->Cancel(), onFailure->Cancel());
2552 if (err != CHIP_NO_ERROR) {
2555 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2559 - (void)readAttributePrimary6Y:(ResponseHandler)completionHandler
2561 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2563 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2567 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2570 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2574 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Y(onSuccess->Cancel(), onFailure->Cancel());
2575 if (err != CHIP_NO_ERROR) {
2578 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2582 - (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler
2584 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2586 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2590 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2593 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2597 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Intensity(onSuccess->Cancel(), onFailure->Cancel());
2598 if (err != CHIP_NO_ERROR) {
2601 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2605 - (void)readAttributeWhitePointX:(ResponseHandler)completionHandler
2607 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2609 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2613 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2616 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2620 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel());
2621 if (err != CHIP_NO_ERROR) {
2624 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2628 - (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2630 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2632 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2636 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2639 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2643 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel(), value);
2644 if (err != CHIP_NO_ERROR) {
2647 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2651 - (void)readAttributeWhitePointY:(ResponseHandler)completionHandler
2653 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2655 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2659 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2662 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2666 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel());
2667 if (err != CHIP_NO_ERROR) {
2670 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2674 - (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2676 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2678 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2682 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2685 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2689 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel(), value);
2690 if (err != CHIP_NO_ERROR) {
2693 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2697 - (void)readAttributeColorPointRX:(ResponseHandler)completionHandler
2699 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2701 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2705 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2708 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2712 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel());
2713 if (err != CHIP_NO_ERROR) {
2716 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2720 - (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2722 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2724 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2728 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2731 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2735 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel(), value);
2736 if (err != CHIP_NO_ERROR) {
2739 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2743 - (void)readAttributeColorPointRY:(ResponseHandler)completionHandler
2745 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2747 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2751 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2754 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2758 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel());
2759 if (err != CHIP_NO_ERROR) {
2762 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2766 - (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2768 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2770 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2774 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2777 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2781 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel(), value);
2782 if (err != CHIP_NO_ERROR) {
2785 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2789 - (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler
2791 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2793 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2797 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2800 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2804 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel());
2805 if (err != CHIP_NO_ERROR) {
2808 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2812 - (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2814 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2816 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2820 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2823 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2827 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2828 if (err != CHIP_NO_ERROR) {
2831 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2835 - (void)readAttributeColorPointGX:(ResponseHandler)completionHandler
2837 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2839 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2843 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2846 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2850 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel());
2851 if (err != CHIP_NO_ERROR) {
2854 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2858 - (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2860 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2862 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2866 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2869 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2873 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel(), value);
2874 if (err != CHIP_NO_ERROR) {
2877 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2881 - (void)readAttributeColorPointGY:(ResponseHandler)completionHandler
2883 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2885 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2889 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2892 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2896 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel());
2897 if (err != CHIP_NO_ERROR) {
2900 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2904 - (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2906 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2908 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2912 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2915 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2919 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel(), value);
2920 if (err != CHIP_NO_ERROR) {
2923 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2927 - (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler
2929 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2931 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2935 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2938 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2942 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel());
2943 if (err != CHIP_NO_ERROR) {
2946 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2950 - (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
2952 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2954 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2958 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2961 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2965 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
2966 if (err != CHIP_NO_ERROR) {
2969 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2973 - (void)readAttributeColorPointBX:(ResponseHandler)completionHandler
2975 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2977 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2981 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2984 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2988 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel());
2989 if (err != CHIP_NO_ERROR) {
2992 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2996 - (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
2998 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3000 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3004 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3007 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3011 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel(), value);
3012 if (err != CHIP_NO_ERROR) {
3015 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3019 - (void)readAttributeColorPointBY:(ResponseHandler)completionHandler
3021 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3023 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3027 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3030 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3034 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel());
3035 if (err != CHIP_NO_ERROR) {
3038 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3042 - (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3044 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3046 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3050 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3053 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3057 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel(), value);
3058 if (err != CHIP_NO_ERROR) {
3061 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3065 - (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler
3067 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3069 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3073 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3076 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3080 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel());
3081 if (err != CHIP_NO_ERROR) {
3084 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3088 - (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
3090 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3092 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3096 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3099 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3103 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
3104 if (err != CHIP_NO_ERROR) {
3107 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3111 - (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler
3113 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3115 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3119 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3122 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3126 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
3127 if (err != CHIP_NO_ERROR) {
3130 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3134 - (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler
3136 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3138 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3142 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3145 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3149 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedColorMode(onSuccess->Cancel(), onFailure->Cancel());
3150 if (err != CHIP_NO_ERROR) {
3153 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3157 - (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler
3159 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(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.ReadAttributeColorLoopActive(onSuccess->Cancel(), onFailure->Cancel());
3173 if (err != CHIP_NO_ERROR) {
3176 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3180 - (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler
3182 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3184 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3188 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3191 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3195 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopDirection(onSuccess->Cancel(), onFailure->Cancel());
3196 if (err != CHIP_NO_ERROR) {
3199 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3203 - (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler
3205 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3207 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3211 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3214 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3218 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopTime(onSuccess->Cancel(), onFailure->Cancel());
3219 if (err != CHIP_NO_ERROR) {
3222 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3226 - (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler
3228 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3230 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3234 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3237 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3241 CHIP_ERROR err = self.cppCluster.ReadAttributeColorCapabilities(onSuccess->Cancel(), onFailure->Cancel());
3242 if (err != CHIP_NO_ERROR) {
3245 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3249 - (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler
3251 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3253 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3257 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3260 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3264 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMin(onSuccess->Cancel(), onFailure->Cancel());
3265 if (err != CHIP_NO_ERROR) {
3268 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3272 - (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler
3274 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3276 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3280 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3283 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3287 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMax(onSuccess->Cancel(), onFailure->Cancel());
3288 if (err != CHIP_NO_ERROR) {
3291 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3295 - (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler
3297 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3299 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3303 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3306 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3310 CHIP_ERROR err = self.cppCluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccess->Cancel(), onFailure->Cancel());
3311 if (err != CHIP_NO_ERROR) {
3314 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3318 - (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler
3320 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3322 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3326 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3329 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3333 CHIP_ERROR err = self.cppCluster.ReadAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel());
3334 if (err != CHIP_NO_ERROR) {
3337 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3341 - (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3343 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3345 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3349 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3352 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3356 CHIP_ERROR err = self.cppCluster.WriteAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel(), value);
3357 if (err != CHIP_NO_ERROR) {
3360 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3364 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
3366 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3368 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3372 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3375 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3379 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
3380 if (err != CHIP_NO_ERROR) {
3383 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3389 @interface CHIPColorControl ()
3390 @property (readonly) Controller::ColorControlCluster cppCluster;
3393 @implementation CHIPColorControl
3395 - (Controller::ClusterBase *)getCluster
3397 return &_cppCluster;
3400 - (void)moveColor:(int16_t)rateX
3401 rateY:(int16_t)rateY
3402 optionsMask:(uint8_t)optionsMask
3403 optionsOverride:(uint8_t)optionsOverride
3404 completionHandler:(ResponseHandler)completionHandler
3406 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3408 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3412 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3415 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3420 = self.cppCluster.MoveColor(onSuccess->Cancel(), onFailure->Cancel(), rateX, rateY, optionsMask, optionsOverride);
3421 if (err != CHIP_NO_ERROR) {
3424 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3427 - (void)moveColorTemperature:(uint8_t)moveMode
3429 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
3430 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
3431 optionsMask:(uint8_t)optionsMask
3432 optionsOverride:(uint8_t)optionsOverride
3433 completionHandler:(ResponseHandler)completionHandler
3435 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3437 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3441 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3444 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3448 CHIP_ERROR err = self.cppCluster.MoveColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate,
3449 colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
3450 if (err != CHIP_NO_ERROR) {
3453 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3456 - (void)moveHue:(uint8_t)moveMode
3458 optionsMask:(uint8_t)optionsMask
3459 optionsOverride:(uint8_t)optionsOverride
3460 completionHandler:(ResponseHandler)completionHandler
3462 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3464 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3468 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3471 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3476 = self.cppCluster.MoveHue(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
3477 if (err != CHIP_NO_ERROR) {
3480 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3483 - (void)moveSaturation:(uint8_t)moveMode
3485 optionsMask:(uint8_t)optionsMask
3486 optionsOverride:(uint8_t)optionsOverride
3487 completionHandler:(ResponseHandler)completionHandler
3489 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3491 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3495 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3498 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3503 = self.cppCluster.MoveSaturation(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
3504 if (err != CHIP_NO_ERROR) {
3507 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3510 - (void)moveToColor:(uint16_t)colorX
3511 colorY:(uint16_t)colorY
3512 transitionTime:(uint16_t)transitionTime
3513 optionsMask:(uint8_t)optionsMask
3514 optionsOverride:(uint8_t)optionsOverride
3515 completionHandler:(ResponseHandler)completionHandler
3517 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3519 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3523 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3526 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3530 CHIP_ERROR err = self.cppCluster.MoveToColor(
3531 onSuccess->Cancel(), onFailure->Cancel(), colorX, colorY, transitionTime, optionsMask, optionsOverride);
3532 if (err != CHIP_NO_ERROR) {
3535 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3538 - (void)moveToColorTemperature:(uint16_t)colorTemperature
3539 transitionTime:(uint16_t)transitionTime
3540 optionsMask:(uint8_t)optionsMask
3541 optionsOverride:(uint8_t)optionsOverride
3542 completionHandler:(ResponseHandler)completionHandler
3544 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3546 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3550 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3553 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3557 CHIP_ERROR err = self.cppCluster.MoveToColorTemperature(
3558 onSuccess->Cancel(), onFailure->Cancel(), colorTemperature, transitionTime, optionsMask, optionsOverride);
3559 if (err != CHIP_NO_ERROR) {
3562 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3565 - (void)moveToHue:(uint8_t)hue
3566 direction:(uint8_t)direction
3567 transitionTime:(uint16_t)transitionTime
3568 optionsMask:(uint8_t)optionsMask
3569 optionsOverride:(uint8_t)optionsOverride
3570 completionHandler:(ResponseHandler)completionHandler
3572 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3574 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3578 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3581 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3585 CHIP_ERROR err = self.cppCluster.MoveToHue(
3586 onSuccess->Cancel(), onFailure->Cancel(), hue, direction, transitionTime, optionsMask, optionsOverride);
3587 if (err != CHIP_NO_ERROR) {
3590 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3593 - (void)moveToHueAndSaturation:(uint8_t)hue
3594 saturation:(uint8_t)saturation
3595 transitionTime:(uint16_t)transitionTime
3596 optionsMask:(uint8_t)optionsMask
3597 optionsOverride:(uint8_t)optionsOverride
3598 completionHandler:(ResponseHandler)completionHandler
3600 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3602 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3606 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3609 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3613 CHIP_ERROR err = self.cppCluster.MoveToHueAndSaturation(
3614 onSuccess->Cancel(), onFailure->Cancel(), hue, saturation, transitionTime, optionsMask, optionsOverride);
3615 if (err != CHIP_NO_ERROR) {
3618 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3621 - (void)moveToSaturation:(uint8_t)saturation
3622 transitionTime:(uint16_t)transitionTime
3623 optionsMask:(uint8_t)optionsMask
3624 optionsOverride:(uint8_t)optionsOverride
3625 completionHandler:(ResponseHandler)completionHandler
3627 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3629 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3633 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3636 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3640 CHIP_ERROR err = self.cppCluster.MoveToSaturation(
3641 onSuccess->Cancel(), onFailure->Cancel(), saturation, transitionTime, optionsMask, optionsOverride);
3642 if (err != CHIP_NO_ERROR) {
3645 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3648 - (void)stepColor:(int16_t)stepX
3649 stepY:(int16_t)stepY
3650 transitionTime:(uint16_t)transitionTime
3651 optionsMask:(uint8_t)optionsMask
3652 optionsOverride:(uint8_t)optionsOverride
3653 completionHandler:(ResponseHandler)completionHandler
3655 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3657 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3661 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3664 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3668 CHIP_ERROR err = self.cppCluster.StepColor(
3669 onSuccess->Cancel(), onFailure->Cancel(), stepX, stepY, transitionTime, optionsMask, optionsOverride);
3670 if (err != CHIP_NO_ERROR) {
3673 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3676 - (void)stepColorTemperature:(uint8_t)stepMode
3677 stepSize:(uint16_t)stepSize
3678 transitionTime:(uint16_t)transitionTime
3679 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
3680 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
3681 optionsMask:(uint8_t)optionsMask
3682 optionsOverride:(uint8_t)optionsOverride
3683 completionHandler:(ResponseHandler)completionHandler
3685 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3687 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3691 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3694 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3698 CHIP_ERROR err = self.cppCluster.StepColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize,
3699 transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
3700 if (err != CHIP_NO_ERROR) {
3703 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3706 - (void)stepHue:(uint8_t)stepMode
3707 stepSize:(uint8_t)stepSize
3708 transitionTime:(uint8_t)transitionTime
3709 optionsMask:(uint8_t)optionsMask
3710 optionsOverride:(uint8_t)optionsOverride
3711 completionHandler:(ResponseHandler)completionHandler
3713 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3715 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3719 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3722 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3726 CHIP_ERROR err = self.cppCluster.StepHue(
3727 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
3728 if (err != CHIP_NO_ERROR) {
3731 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3734 - (void)stepSaturation:(uint8_t)stepMode
3735 stepSize:(uint8_t)stepSize
3736 transitionTime:(uint8_t)transitionTime
3737 optionsMask:(uint8_t)optionsMask
3738 optionsOverride:(uint8_t)optionsOverride
3739 completionHandler:(ResponseHandler)completionHandler
3741 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3743 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3747 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3750 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3754 CHIP_ERROR err = self.cppCluster.StepSaturation(
3755 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
3756 if (err != CHIP_NO_ERROR) {
3759 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3762 - (void)stopMoveStep:(uint8_t)optionsMask
3763 optionsOverride:(uint8_t)optionsOverride
3764 completionHandler:(ResponseHandler)completionHandler
3766 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3768 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3772 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3775 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3779 CHIP_ERROR err = self.cppCluster.StopMoveStep(onSuccess->Cancel(), onFailure->Cancel(), optionsMask, optionsOverride);
3780 if (err != CHIP_NO_ERROR) {
3783 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3787 - (void)readAttributeCurrentHue:(ResponseHandler)completionHandler
3789 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3791 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3795 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3798 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3802 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
3803 if (err != CHIP_NO_ERROR) {
3806 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3810 - (void)configureAttributeCurrentHue:(uint16_t)minInterval
3811 maxInterval:(uint16_t)maxInterval
3812 change:(uint8_t)change
3813 completionHandler:(ResponseHandler)completionHandler
3815 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3817 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3821 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3824 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3829 = self.cppCluster.ConfigureAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
3830 if (err != CHIP_NO_ERROR) {
3833 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3837 - (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler
3839 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
3841 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3845 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentHue(onReport->Cancel());
3846 if (err != CHIP_NO_ERROR) {
3848 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
3852 - (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler
3854 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3856 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3860 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3863 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3867 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentSaturation(onSuccess->Cancel(), onFailure->Cancel());
3868 if (err != CHIP_NO_ERROR) {
3871 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3875 - (void)configureAttributeCurrentSaturation:(uint16_t)minInterval
3876 maxInterval:(uint16_t)maxInterval
3877 change:(uint8_t)change
3878 completionHandler:(ResponseHandler)completionHandler
3880 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3882 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3886 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3889 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3893 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentSaturation(
3894 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
3895 if (err != CHIP_NO_ERROR) {
3898 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3902 - (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler
3904 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
3906 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3910 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentSaturation(onReport->Cancel());
3911 if (err != CHIP_NO_ERROR) {
3913 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
3917 - (void)readAttributeRemainingTime:(ResponseHandler)completionHandler
3919 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3921 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3925 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3928 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3932 CHIP_ERROR err = self.cppCluster.ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel());
3933 if (err != CHIP_NO_ERROR) {
3936 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3940 - (void)readAttributeCurrentX:(ResponseHandler)completionHandler
3942 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3944 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3948 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3951 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3955 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel());
3956 if (err != CHIP_NO_ERROR) {
3959 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3963 - (void)configureAttributeCurrentX:(uint16_t)minInterval
3964 maxInterval:(uint16_t)maxInterval
3965 change:(uint16_t)change
3966 completionHandler:(ResponseHandler)completionHandler
3968 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3970 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3974 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3977 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3982 = self.cppCluster.ConfigureAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
3983 if (err != CHIP_NO_ERROR) {
3986 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3990 - (void)reportAttributeCurrentX:(ResponseHandler)reportHandler
3992 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
3994 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3998 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentX(onReport->Cancel());
3999 if (err != CHIP_NO_ERROR) {
4001 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
4005 - (void)readAttributeCurrentY:(ResponseHandler)completionHandler
4007 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4009 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4013 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4016 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4020 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel());
4021 if (err != CHIP_NO_ERROR) {
4024 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4028 - (void)configureAttributeCurrentY:(uint16_t)minInterval
4029 maxInterval:(uint16_t)maxInterval
4030 change:(uint16_t)change
4031 completionHandler:(ResponseHandler)completionHandler
4033 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4035 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4039 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4042 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4047 = self.cppCluster.ConfigureAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
4048 if (err != CHIP_NO_ERROR) {
4051 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4055 - (void)reportAttributeCurrentY:(ResponseHandler)reportHandler
4057 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
4059 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4063 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentY(onReport->Cancel());
4064 if (err != CHIP_NO_ERROR) {
4066 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
4070 - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler
4072 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4074 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4078 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4081 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4085 CHIP_ERROR err = self.cppCluster.ReadAttributeDriftCompensation(onSuccess->Cancel(), onFailure->Cancel());
4086 if (err != CHIP_NO_ERROR) {
4089 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4093 - (void)readAttributeCompensationText:(ResponseHandler)completionHandler
4095 CHIPStringAttributeCallbackBridge * onSuccess
4096 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
4098 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4102 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4105 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4109 CHIP_ERROR err = self.cppCluster.ReadAttributeCompensationText(onSuccess->Cancel(), onFailure->Cancel());
4110 if (err != CHIP_NO_ERROR) {
4113 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4117 - (void)readAttributeColorTemperature:(ResponseHandler)completionHandler
4119 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4121 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4125 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4128 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4132 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTemperature(onSuccess->Cancel(), onFailure->Cancel());
4133 if (err != CHIP_NO_ERROR) {
4136 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4140 - (void)configureAttributeColorTemperature:(uint16_t)minInterval
4141 maxInterval:(uint16_t)maxInterval
4142 change:(uint16_t)change
4143 completionHandler:(ResponseHandler)completionHandler
4145 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4147 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4151 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4154 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4158 CHIP_ERROR err = self.cppCluster.ConfigureAttributeColorTemperature(
4159 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
4160 if (err != CHIP_NO_ERROR) {
4163 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4167 - (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler
4169 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
4171 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4175 CHIP_ERROR err = self.cppCluster.ReportAttributeColorTemperature(onReport->Cancel());
4176 if (err != CHIP_NO_ERROR) {
4178 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
4182 - (void)readAttributeColorMode:(ResponseHandler)completionHandler
4184 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4186 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4190 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4193 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4197 CHIP_ERROR err = self.cppCluster.ReadAttributeColorMode(onSuccess->Cancel(), onFailure->Cancel());
4198 if (err != CHIP_NO_ERROR) {
4201 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4205 - (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler
4207 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4209 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4213 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4216 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4220 CHIP_ERROR err = self.cppCluster.ReadAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel());
4221 if (err != CHIP_NO_ERROR) {
4224 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4228 - (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
4230 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4232 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4236 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4239 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4243 CHIP_ERROR err = self.cppCluster.WriteAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel(), value);
4244 if (err != CHIP_NO_ERROR) {
4247 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4251 - (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler
4253 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4255 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4259 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4262 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4266 CHIP_ERROR err = self.cppCluster.ReadAttributeNumberOfPrimaries(onSuccess->Cancel(), onFailure->Cancel());
4267 if (err != CHIP_NO_ERROR) {
4270 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4274 - (void)readAttributePrimary1X:(ResponseHandler)completionHandler
4276 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4278 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4282 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4285 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4289 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1X(onSuccess->Cancel(), onFailure->Cancel());
4290 if (err != CHIP_NO_ERROR) {
4293 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4297 - (void)readAttributePrimary1Y:(ResponseHandler)completionHandler
4299 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4301 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4305 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4308 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4312 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Y(onSuccess->Cancel(), onFailure->Cancel());
4313 if (err != CHIP_NO_ERROR) {
4316 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4320 - (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler
4322 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4324 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4328 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4331 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4335 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Intensity(onSuccess->Cancel(), onFailure->Cancel());
4336 if (err != CHIP_NO_ERROR) {
4339 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4343 - (void)readAttributePrimary2X:(ResponseHandler)completionHandler
4345 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4347 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4351 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4354 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4358 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2X(onSuccess->Cancel(), onFailure->Cancel());
4359 if (err != CHIP_NO_ERROR) {
4362 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4366 - (void)readAttributePrimary2Y:(ResponseHandler)completionHandler
4368 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4370 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4374 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4377 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4381 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Y(onSuccess->Cancel(), onFailure->Cancel());
4382 if (err != CHIP_NO_ERROR) {
4385 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4389 - (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler
4391 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4393 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4397 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4400 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4404 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Intensity(onSuccess->Cancel(), onFailure->Cancel());
4405 if (err != CHIP_NO_ERROR) {
4408 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4412 - (void)readAttributePrimary3X:(ResponseHandler)completionHandler
4414 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4416 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4420 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4423 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4427 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3X(onSuccess->Cancel(), onFailure->Cancel());
4428 if (err != CHIP_NO_ERROR) {
4431 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4435 - (void)readAttributePrimary3Y:(ResponseHandler)completionHandler
4437 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4439 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4443 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4446 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4450 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Y(onSuccess->Cancel(), onFailure->Cancel());
4451 if (err != CHIP_NO_ERROR) {
4454 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4458 - (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler
4460 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4462 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4466 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4469 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4473 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Intensity(onSuccess->Cancel(), onFailure->Cancel());
4474 if (err != CHIP_NO_ERROR) {
4477 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4481 - (void)readAttributePrimary4X:(ResponseHandler)completionHandler
4483 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4485 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4489 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4492 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4496 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4X(onSuccess->Cancel(), onFailure->Cancel());
4497 if (err != CHIP_NO_ERROR) {
4500 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4504 - (void)readAttributePrimary4Y:(ResponseHandler)completionHandler
4506 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4508 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4512 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4515 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4519 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Y(onSuccess->Cancel(), onFailure->Cancel());
4520 if (err != CHIP_NO_ERROR) {
4523 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4527 - (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler
4529 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4531 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4535 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4538 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4542 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Intensity(onSuccess->Cancel(), onFailure->Cancel());
4543 if (err != CHIP_NO_ERROR) {
4546 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4550 - (void)readAttributePrimary5X:(ResponseHandler)completionHandler
4552 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4554 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4558 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4561 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4565 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5X(onSuccess->Cancel(), onFailure->Cancel());
4566 if (err != CHIP_NO_ERROR) {
4569 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4573 - (void)readAttributePrimary5Y:(ResponseHandler)completionHandler
4575 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4577 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4581 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4584 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4588 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Y(onSuccess->Cancel(), onFailure->Cancel());
4589 if (err != CHIP_NO_ERROR) {
4592 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4596 - (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler
4598 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4600 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4604 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4607 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4611 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Intensity(onSuccess->Cancel(), onFailure->Cancel());
4612 if (err != CHIP_NO_ERROR) {
4615 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4619 - (void)readAttributePrimary6X:(ResponseHandler)completionHandler
4621 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4623 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4627 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4630 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4634 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6X(onSuccess->Cancel(), onFailure->Cancel());
4635 if (err != CHIP_NO_ERROR) {
4638 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4642 - (void)readAttributePrimary6Y:(ResponseHandler)completionHandler
4644 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4646 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4650 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4653 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4657 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Y(onSuccess->Cancel(), onFailure->Cancel());
4658 if (err != CHIP_NO_ERROR) {
4661 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4665 - (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler
4667 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4669 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4673 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4676 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4680 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Intensity(onSuccess->Cancel(), onFailure->Cancel());
4681 if (err != CHIP_NO_ERROR) {
4684 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4688 - (void)readAttributeWhitePointX:(ResponseHandler)completionHandler
4690 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4692 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4696 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4699 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4703 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel());
4704 if (err != CHIP_NO_ERROR) {
4707 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4711 - (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4713 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4715 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4719 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4722 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4726 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel(), value);
4727 if (err != CHIP_NO_ERROR) {
4730 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4734 - (void)readAttributeWhitePointY:(ResponseHandler)completionHandler
4736 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4738 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4742 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4745 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4749 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel());
4750 if (err != CHIP_NO_ERROR) {
4753 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4757 - (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4759 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4761 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4765 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4768 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4772 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel(), value);
4773 if (err != CHIP_NO_ERROR) {
4776 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4780 - (void)readAttributeColorPointRX:(ResponseHandler)completionHandler
4782 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4784 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4788 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4791 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4795 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel());
4796 if (err != CHIP_NO_ERROR) {
4799 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4803 - (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4805 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4807 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4811 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4814 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4818 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel(), value);
4819 if (err != CHIP_NO_ERROR) {
4822 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4826 - (void)readAttributeColorPointRY:(ResponseHandler)completionHandler
4828 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4830 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4834 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4837 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4841 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel());
4842 if (err != CHIP_NO_ERROR) {
4845 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4849 - (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4851 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4853 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4857 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4860 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4864 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel(), value);
4865 if (err != CHIP_NO_ERROR) {
4868 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4872 - (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler
4874 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4876 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4880 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4883 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4887 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel());
4888 if (err != CHIP_NO_ERROR) {
4891 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4895 - (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
4897 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4899 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4903 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4906 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4910 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
4911 if (err != CHIP_NO_ERROR) {
4914 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4918 - (void)readAttributeColorPointGX:(ResponseHandler)completionHandler
4920 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4922 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4926 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4929 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4933 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel());
4934 if (err != CHIP_NO_ERROR) {
4937 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4941 - (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4943 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4945 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4949 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4952 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4956 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel(), value);
4957 if (err != CHIP_NO_ERROR) {
4960 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4964 - (void)readAttributeColorPointGY:(ResponseHandler)completionHandler
4966 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4968 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4972 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4975 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4979 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel());
4980 if (err != CHIP_NO_ERROR) {
4983 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4987 - (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4989 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4991 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4995 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4998 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5002 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel(), value);
5003 if (err != CHIP_NO_ERROR) {
5006 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5010 - (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler
5012 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5014 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5018 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5021 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5025 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel());
5026 if (err != CHIP_NO_ERROR) {
5029 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5033 - (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
5035 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5037 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5041 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5044 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5048 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
5049 if (err != CHIP_NO_ERROR) {
5052 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5056 - (void)readAttributeColorPointBX:(ResponseHandler)completionHandler
5058 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5060 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5064 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5067 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5071 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel());
5072 if (err != CHIP_NO_ERROR) {
5075 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5079 - (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
5081 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5083 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5087 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5090 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5094 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel(), value);
5095 if (err != CHIP_NO_ERROR) {
5098 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5102 - (void)readAttributeColorPointBY:(ResponseHandler)completionHandler
5104 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5106 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5110 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5113 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5117 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel());
5118 if (err != CHIP_NO_ERROR) {
5121 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5125 - (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
5127 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5129 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5133 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5136 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5140 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel(), value);
5141 if (err != CHIP_NO_ERROR) {
5144 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5148 - (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler
5150 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5152 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5156 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5159 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5163 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel());
5164 if (err != CHIP_NO_ERROR) {
5167 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5171 - (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
5173 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5175 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5179 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5182 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5186 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
5187 if (err != CHIP_NO_ERROR) {
5190 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5194 - (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler
5196 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5198 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5202 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5205 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5209 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
5210 if (err != CHIP_NO_ERROR) {
5213 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5217 - (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler
5219 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5221 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5225 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5228 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5232 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedColorMode(onSuccess->Cancel(), onFailure->Cancel());
5233 if (err != CHIP_NO_ERROR) {
5236 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5240 - (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler
5242 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5244 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5248 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5251 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5255 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopActive(onSuccess->Cancel(), onFailure->Cancel());
5256 if (err != CHIP_NO_ERROR) {
5259 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5263 - (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler
5265 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5267 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5271 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5274 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5278 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopDirection(onSuccess->Cancel(), onFailure->Cancel());
5279 if (err != CHIP_NO_ERROR) {
5282 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5286 - (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler
5288 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5290 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5294 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5297 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5301 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopTime(onSuccess->Cancel(), onFailure->Cancel());
5302 if (err != CHIP_NO_ERROR) {
5305 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5309 - (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler
5311 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5313 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5317 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5320 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5324 CHIP_ERROR err = self.cppCluster.ReadAttributeColorCapabilities(onSuccess->Cancel(), onFailure->Cancel());
5325 if (err != CHIP_NO_ERROR) {
5328 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5332 - (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler
5334 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5336 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5340 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5343 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5347 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMin(onSuccess->Cancel(), onFailure->Cancel());
5348 if (err != CHIP_NO_ERROR) {
5351 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5355 - (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler
5357 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5359 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5363 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5366 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5370 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMax(onSuccess->Cancel(), onFailure->Cancel());
5371 if (err != CHIP_NO_ERROR) {
5374 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5378 - (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler
5380 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5382 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5386 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5389 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5393 CHIP_ERROR err = self.cppCluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccess->Cancel(), onFailure->Cancel());
5394 if (err != CHIP_NO_ERROR) {
5397 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5401 - (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler
5403 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5405 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5409 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5412 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5416 CHIP_ERROR err = self.cppCluster.ReadAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel());
5417 if (err != CHIP_NO_ERROR) {
5420 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5424 - (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
5426 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5428 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5432 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5435 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5439 CHIP_ERROR err = self.cppCluster.WriteAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel(), value);
5440 if (err != CHIP_NO_ERROR) {
5443 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5447 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5449 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5451 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5455 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5458 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5462 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5463 if (err != CHIP_NO_ERROR) {
5466 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5472 @interface CHIPContentLaunch ()
5473 @property (readonly) Controller::ContentLaunchCluster cppCluster;
5476 @implementation CHIPContentLaunch
5478 - (Controller::ClusterBase *)getCluster
5480 return &_cppCluster;
5483 - (void)launchContent:(ResponseHandler)completionHandler
5485 CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * onSuccess
5486 = new CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(completionHandler, [self callbackQueue]);
5488 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5492 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5495 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5499 CHIP_ERROR err = self.cppCluster.LaunchContent(onSuccess->Cancel(), onFailure->Cancel());
5500 if (err != CHIP_NO_ERROR) {
5503 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5506 - (void)launchURL:(ResponseHandler)completionHandler
5508 CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * onSuccess
5509 = new CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(completionHandler, [self callbackQueue]);
5511 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5515 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5518 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5522 CHIP_ERROR err = self.cppCluster.LaunchURL(onSuccess->Cancel(), onFailure->Cancel());
5523 if (err != CHIP_NO_ERROR) {
5526 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5530 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5532 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5534 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5538 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5541 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5545 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5546 if (err != CHIP_NO_ERROR) {
5549 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5555 @interface CHIPDoorLock ()
5556 @property (readonly) Controller::DoorLockCluster cppCluster;
5559 @implementation CHIPDoorLock
5561 - (Controller::ClusterBase *)getCluster
5563 return &_cppCluster;
5566 - (void)clearAllPins:(ResponseHandler)completionHandler
5568 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5570 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5574 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5577 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5581 CHIP_ERROR err = self.cppCluster.ClearAllPins(onSuccess->Cancel(), onFailure->Cancel());
5582 if (err != CHIP_NO_ERROR) {
5585 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5588 - (void)clearAllRfids:(ResponseHandler)completionHandler
5590 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5592 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5596 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5599 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5603 CHIP_ERROR err = self.cppCluster.ClearAllRfids(onSuccess->Cancel(), onFailure->Cancel());
5604 if (err != CHIP_NO_ERROR) {
5607 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5610 - (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
5612 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5614 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5618 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5621 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5625 CHIP_ERROR err = self.cppCluster.ClearHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
5626 if (err != CHIP_NO_ERROR) {
5629 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5632 - (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
5634 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5636 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5640 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5643 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5647 CHIP_ERROR err = self.cppCluster.ClearPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
5648 if (err != CHIP_NO_ERROR) {
5651 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5654 - (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
5656 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5658 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5662 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5665 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5669 CHIP_ERROR err = self.cppCluster.ClearRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
5670 if (err != CHIP_NO_ERROR) {
5673 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5676 - (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
5678 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5680 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5684 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5687 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5691 CHIP_ERROR err = self.cppCluster.ClearWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
5692 if (err != CHIP_NO_ERROR) {
5695 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5698 - (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
5700 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5702 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5706 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5709 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5713 CHIP_ERROR err = self.cppCluster.ClearYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
5714 if (err != CHIP_NO_ERROR) {
5717 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5720 - (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
5722 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5724 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5728 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5731 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5735 CHIP_ERROR err = self.cppCluster.GetHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
5736 if (err != CHIP_NO_ERROR) {
5739 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5742 - (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler
5744 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5746 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5750 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5753 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5757 CHIP_ERROR err = self.cppCluster.GetLogRecord(onSuccess->Cancel(), onFailure->Cancel(), logIndex);
5758 if (err != CHIP_NO_ERROR) {
5761 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5764 - (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
5766 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5768 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5772 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5775 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5779 CHIP_ERROR err = self.cppCluster.GetPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
5780 if (err != CHIP_NO_ERROR) {
5783 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5786 - (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
5788 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5790 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5794 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5797 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5801 CHIP_ERROR err = self.cppCluster.GetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
5802 if (err != CHIP_NO_ERROR) {
5805 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5808 - (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
5810 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5812 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5816 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5819 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5823 CHIP_ERROR err = self.cppCluster.GetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId);
5824 if (err != CHIP_NO_ERROR) {
5827 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5830 - (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
5832 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5834 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5838 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5841 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5845 CHIP_ERROR err = self.cppCluster.GetWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
5846 if (err != CHIP_NO_ERROR) {
5849 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5852 - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
5854 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5856 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5860 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5863 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5867 CHIP_ERROR err = self.cppCluster.GetYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
5868 if (err != CHIP_NO_ERROR) {
5871 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5874 - (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
5876 CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess
5877 = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
5879 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5883 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5886 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5890 CHIP_ERROR err = self.cppCluster.LockDoor(onSuccess->Cancel(), onFailure->Cancel(),
5891 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
5892 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
5893 if (err != CHIP_NO_ERROR) {
5896 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5899 - (void)setHolidaySchedule:(uint8_t)scheduleId
5900 localStartTime:(uint32_t)localStartTime
5901 localEndTime:(uint32_t)localEndTime
5902 operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday
5903 completionHandler:(ResponseHandler)completionHandler
5905 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5907 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5911 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5914 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5918 CHIP_ERROR err = self.cppCluster.SetHolidaySchedule(
5919 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, localStartTime, localEndTime, operatingModeDuringHoliday);
5920 if (err != CHIP_NO_ERROR) {
5923 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5926 - (void)setPin:(uint16_t)userId
5927 userStatus:(uint8_t)userStatus
5928 userType:(uint8_t)userType
5930 completionHandler:(ResponseHandler)completionHandler
5932 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5934 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5938 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5941 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5945 CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
5946 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
5947 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
5948 if (err != CHIP_NO_ERROR) {
5951 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5954 - (void)setRfid:(uint16_t)userId
5955 userStatus:(uint8_t)userStatus
5956 userType:(uint8_t)userType
5958 completionHandler:(ResponseHandler)completionHandler
5960 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5962 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5966 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5969 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5973 CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
5974 chip::ByteSpan((const uint8_t *) [id dataUsingEncoding:NSUTF8StringEncoding].bytes,
5975 [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
5976 if (err != CHIP_NO_ERROR) {
5979 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5982 - (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler
5984 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5986 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5990 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5993 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5997 CHIP_ERROR err = self.cppCluster.SetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId, userType);
5998 if (err != CHIP_NO_ERROR) {
6001 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6004 - (void)setWeekdaySchedule:(uint8_t)scheduleId
6005 userId:(uint16_t)userId
6006 daysMask:(uint8_t)daysMask
6007 startHour:(uint8_t)startHour
6008 startMinute:(uint8_t)startMinute
6009 endHour:(uint8_t)endHour
6010 endMinute:(uint8_t)endMinute
6011 completionHandler:(ResponseHandler)completionHandler
6013 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6015 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6019 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6022 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6026 CHIP_ERROR err = self.cppCluster.SetWeekdaySchedule(
6027 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, daysMask, startHour, startMinute, endHour, endMinute);
6028 if (err != CHIP_NO_ERROR) {
6031 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6034 - (void)setYeardaySchedule:(uint8_t)scheduleId
6035 userId:(uint16_t)userId
6036 localStartTime:(uint32_t)localStartTime
6037 localEndTime:(uint32_t)localEndTime
6038 completionHandler:(ResponseHandler)completionHandler
6040 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6042 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6046 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6049 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6053 CHIP_ERROR err = self.cppCluster.SetYeardaySchedule(
6054 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, localStartTime, localEndTime);
6055 if (err != CHIP_NO_ERROR) {
6058 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6061 - (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
6063 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess
6064 = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
6066 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6070 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6073 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6077 CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(),
6078 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
6079 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
6080 if (err != CHIP_NO_ERROR) {
6083 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6086 - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
6088 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6090 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6094 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6097 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6101 CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds,
6102 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
6103 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
6104 if (err != CHIP_NO_ERROR) {
6107 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6111 - (void)readAttributeLockState:(ResponseHandler)completionHandler
6113 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6115 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6119 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6122 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6126 CHIP_ERROR err = self.cppCluster.ReadAttributeLockState(onSuccess->Cancel(), onFailure->Cancel());
6127 if (err != CHIP_NO_ERROR) {
6130 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6134 - (void)configureAttributeLockState:(uint16_t)minInterval
6135 maxInterval:(uint16_t)maxInterval
6136 completionHandler:(ResponseHandler)completionHandler
6138 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6140 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6144 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6147 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6152 = self.cppCluster.ConfigureAttributeLockState(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
6153 if (err != CHIP_NO_ERROR) {
6156 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6160 - (void)reportAttributeLockState:(ResponseHandler)reportHandler
6162 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
6164 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6168 CHIP_ERROR err = self.cppCluster.ReportAttributeLockState(onReport->Cancel());
6169 if (err != CHIP_NO_ERROR) {
6171 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
6175 - (void)readAttributeLockType:(ResponseHandler)completionHandler
6177 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6179 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6183 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6186 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6190 CHIP_ERROR err = self.cppCluster.ReadAttributeLockType(onSuccess->Cancel(), onFailure->Cancel());
6191 if (err != CHIP_NO_ERROR) {
6194 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6198 - (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler
6200 CHIPBooleanAttributeCallbackBridge * onSuccess
6201 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6203 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6207 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6210 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6214 CHIP_ERROR err = self.cppCluster.ReadAttributeActuatorEnabled(onSuccess->Cancel(), onFailure->Cancel());
6215 if (err != CHIP_NO_ERROR) {
6218 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6222 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6224 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6226 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6230 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6233 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6237 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6238 if (err != CHIP_NO_ERROR) {
6241 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6247 @interface CHIPDoorLock ()
6248 @property (readonly) Controller::DoorLockCluster cppCluster;
6251 @implementation CHIPDoorLock
6253 - (Controller::ClusterBase *)getCluster
6255 return &_cppCluster;
6258 - (void)clearAllPins:(ResponseHandler)completionHandler
6260 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6262 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6266 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6269 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6273 CHIP_ERROR err = self.cppCluster.ClearAllPins(onSuccess->Cancel(), onFailure->Cancel());
6274 if (err != CHIP_NO_ERROR) {
6277 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6280 - (void)clearAllRfids:(ResponseHandler)completionHandler
6282 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6284 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6288 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6291 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6295 CHIP_ERROR err = self.cppCluster.ClearAllRfids(onSuccess->Cancel(), onFailure->Cancel());
6296 if (err != CHIP_NO_ERROR) {
6299 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6302 - (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
6304 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6306 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6310 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6313 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6317 CHIP_ERROR err = self.cppCluster.ClearHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
6318 if (err != CHIP_NO_ERROR) {
6321 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6324 - (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
6326 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6328 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6332 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6335 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6339 CHIP_ERROR err = self.cppCluster.ClearPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
6340 if (err != CHIP_NO_ERROR) {
6343 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6346 - (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
6348 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6350 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6354 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6357 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6361 CHIP_ERROR err = self.cppCluster.ClearRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
6362 if (err != CHIP_NO_ERROR) {
6365 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6368 - (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
6370 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6372 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6376 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6379 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6383 CHIP_ERROR err = self.cppCluster.ClearWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
6384 if (err != CHIP_NO_ERROR) {
6387 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6390 - (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
6392 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6394 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6398 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6401 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6405 CHIP_ERROR err = self.cppCluster.ClearYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
6406 if (err != CHIP_NO_ERROR) {
6409 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6412 - (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
6414 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6416 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6420 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6423 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6427 CHIP_ERROR err = self.cppCluster.GetHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
6428 if (err != CHIP_NO_ERROR) {
6431 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6434 - (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler
6436 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6438 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6442 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6445 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6449 CHIP_ERROR err = self.cppCluster.GetLogRecord(onSuccess->Cancel(), onFailure->Cancel(), logIndex);
6450 if (err != CHIP_NO_ERROR) {
6453 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6456 - (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
6458 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6460 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6464 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6467 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6471 CHIP_ERROR err = self.cppCluster.GetPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
6472 if (err != CHIP_NO_ERROR) {
6475 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6478 - (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
6480 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6482 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6486 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6489 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6493 CHIP_ERROR err = self.cppCluster.GetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
6494 if (err != CHIP_NO_ERROR) {
6497 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6500 - (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
6502 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6504 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6508 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6511 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6515 CHIP_ERROR err = self.cppCluster.GetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId);
6516 if (err != CHIP_NO_ERROR) {
6519 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6522 - (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
6524 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6526 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6530 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6533 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6537 CHIP_ERROR err = self.cppCluster.GetWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
6538 if (err != CHIP_NO_ERROR) {
6541 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6544 - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
6546 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6548 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6552 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6555 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6559 CHIP_ERROR err = self.cppCluster.GetYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
6560 if (err != CHIP_NO_ERROR) {
6563 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6566 - (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
6568 CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess
6569 = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
6571 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6575 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6578 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6582 CHIP_ERROR err = self.cppCluster.LockDoor(onSuccess->Cancel(), onFailure->Cancel(),
6583 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
6584 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
6585 if (err != CHIP_NO_ERROR) {
6588 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6591 - (void)setHolidaySchedule:(uint8_t)scheduleId
6592 localStartTime:(uint32_t)localStartTime
6593 localEndTime:(uint32_t)localEndTime
6594 operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday
6595 completionHandler:(ResponseHandler)completionHandler
6597 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6599 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6603 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6606 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6610 CHIP_ERROR err = self.cppCluster.SetHolidaySchedule(
6611 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, localStartTime, localEndTime, operatingModeDuringHoliday);
6612 if (err != CHIP_NO_ERROR) {
6615 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6618 - (void)setPin:(uint16_t)userId
6619 userStatus:(uint8_t)userStatus
6620 userType:(uint8_t)userType
6622 completionHandler:(ResponseHandler)completionHandler
6624 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6626 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6630 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6633 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6637 CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
6638 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
6639 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
6640 if (err != CHIP_NO_ERROR) {
6643 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6646 - (void)setRfid:(uint16_t)userId
6647 userStatus:(uint8_t)userStatus
6648 userType:(uint8_t)userType
6650 completionHandler:(ResponseHandler)completionHandler
6652 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6654 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6658 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6661 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6665 CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
6666 chip::ByteSpan((const uint8_t *) [id dataUsingEncoding:NSUTF8StringEncoding].bytes,
6667 [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
6668 if (err != CHIP_NO_ERROR) {
6671 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6674 - (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler
6676 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6678 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6682 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6685 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6689 CHIP_ERROR err = self.cppCluster.SetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId, userType);
6690 if (err != CHIP_NO_ERROR) {
6693 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6696 - (void)setWeekdaySchedule:(uint8_t)scheduleId
6697 userId:(uint16_t)userId
6698 daysMask:(uint8_t)daysMask
6699 startHour:(uint8_t)startHour
6700 startMinute:(uint8_t)startMinute
6701 endHour:(uint8_t)endHour
6702 endMinute:(uint8_t)endMinute
6703 completionHandler:(ResponseHandler)completionHandler
6705 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6707 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6711 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6714 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6718 CHIP_ERROR err = self.cppCluster.SetWeekdaySchedule(
6719 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, daysMask, startHour, startMinute, endHour, endMinute);
6720 if (err != CHIP_NO_ERROR) {
6723 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6726 - (void)setYeardaySchedule:(uint8_t)scheduleId
6727 userId:(uint16_t)userId
6728 localStartTime:(uint32_t)localStartTime
6729 localEndTime:(uint32_t)localEndTime
6730 completionHandler:(ResponseHandler)completionHandler
6732 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6734 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6738 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6741 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6745 CHIP_ERROR err = self.cppCluster.SetYeardaySchedule(
6746 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, localStartTime, localEndTime);
6747 if (err != CHIP_NO_ERROR) {
6750 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6753 - (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
6755 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess
6756 = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
6758 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6762 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6765 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6769 CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(),
6770 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
6771 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
6772 if (err != CHIP_NO_ERROR) {
6775 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6778 - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
6780 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6782 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6786 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6789 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6793 CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds,
6794 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
6795 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
6796 if (err != CHIP_NO_ERROR) {
6799 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6803 - (void)readAttributeLockState:(ResponseHandler)completionHandler
6805 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6807 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6811 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6814 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6818 CHIP_ERROR err = self.cppCluster.ReadAttributeLockState(onSuccess->Cancel(), onFailure->Cancel());
6819 if (err != CHIP_NO_ERROR) {
6822 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6826 - (void)configureAttributeLockState:(uint16_t)minInterval
6827 maxInterval:(uint16_t)maxInterval
6828 completionHandler:(ResponseHandler)completionHandler
6830 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6832 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6836 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6839 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6844 = self.cppCluster.ConfigureAttributeLockState(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
6845 if (err != CHIP_NO_ERROR) {
6848 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6852 - (void)reportAttributeLockState:(ResponseHandler)reportHandler
6854 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
6856 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6860 CHIP_ERROR err = self.cppCluster.ReportAttributeLockState(onReport->Cancel());
6861 if (err != CHIP_NO_ERROR) {
6863 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
6867 - (void)readAttributeLockType:(ResponseHandler)completionHandler
6869 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6871 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6875 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6878 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6882 CHIP_ERROR err = self.cppCluster.ReadAttributeLockType(onSuccess->Cancel(), onFailure->Cancel());
6883 if (err != CHIP_NO_ERROR) {
6886 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6890 - (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler
6892 CHIPBooleanAttributeCallbackBridge * onSuccess
6893 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6895 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6899 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6902 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6906 CHIP_ERROR err = self.cppCluster.ReadAttributeActuatorEnabled(onSuccess->Cancel(), onFailure->Cancel());
6907 if (err != CHIP_NO_ERROR) {
6910 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6914 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6916 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6918 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6922 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6925 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6929 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6930 if (err != CHIP_NO_ERROR) {
6933 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6939 @interface CHIPGroups ()
6940 @property (readonly) Controller::GroupsCluster cppCluster;
6943 @implementation CHIPGroups
6945 - (Controller::ClusterBase *)getCluster
6947 return &_cppCluster;
6950 - (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler
6952 CHIPGroupsClusterAddGroupResponseCallbackBridge * onSuccess
6953 = new CHIPGroupsClusterAddGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
6955 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6959 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6962 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6966 CHIP_ERROR err = self.cppCluster.AddGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId,
6967 chip::ByteSpan((const uint8_t *) [groupName dataUsingEncoding:NSUTF8StringEncoding].bytes,
6968 [groupName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
6969 if (err != CHIP_NO_ERROR) {
6972 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6975 - (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler
6977 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6979 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6983 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6986 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6990 CHIP_ERROR err = self.cppCluster.AddGroupIfIdentifying(onSuccess->Cancel(), onFailure->Cancel(), groupId,
6991 chip::ByteSpan((const uint8_t *) [groupName dataUsingEncoding:NSUTF8StringEncoding].bytes,
6992 [groupName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
6993 if (err != CHIP_NO_ERROR) {
6996 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6999 - (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler
7001 CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge * onSuccess
7002 = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]);
7004 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7008 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7011 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7015 CHIP_ERROR err = self.cppCluster.GetGroupMembership(onSuccess->Cancel(), onFailure->Cancel(), groupCount, groupList);
7016 if (err != CHIP_NO_ERROR) {
7019 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7022 - (void)removeAllGroups:(ResponseHandler)completionHandler
7024 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7026 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7030 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7033 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7037 CHIP_ERROR err = self.cppCluster.RemoveAllGroups(onSuccess->Cancel(), onFailure->Cancel());
7038 if (err != CHIP_NO_ERROR) {
7041 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7044 - (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
7046 CHIPGroupsClusterRemoveGroupResponseCallbackBridge * onSuccess
7047 = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
7049 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7053 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7056 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7060 CHIP_ERROR err = self.cppCluster.RemoveGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId);
7061 if (err != CHIP_NO_ERROR) {
7064 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7067 - (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
7069 CHIPGroupsClusterViewGroupResponseCallbackBridge * onSuccess
7070 = new CHIPGroupsClusterViewGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
7072 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7076 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7079 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7083 CHIP_ERROR err = self.cppCluster.ViewGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId);
7084 if (err != CHIP_NO_ERROR) {
7087 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7091 - (void)readAttributeNameSupport:(ResponseHandler)completionHandler
7093 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7095 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7099 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7102 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7106 CHIP_ERROR err = self.cppCluster.ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
7107 if (err != CHIP_NO_ERROR) {
7110 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7114 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
7116 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7118 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7122 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7125 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7129 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
7130 if (err != CHIP_NO_ERROR) {
7133 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7139 @interface CHIPIasZone ()
7140 @property (readonly) Controller::IasZoneCluster cppCluster;
7143 @implementation CHIPIasZone
7145 - (Controller::ClusterBase *)getCluster
7147 return &_cppCluster;
7150 - (void)readAttributeZoneState:(ResponseHandler)completionHandler
7152 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7154 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7158 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7161 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7165 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneState(onSuccess->Cancel(), onFailure->Cancel());
7166 if (err != CHIP_NO_ERROR) {
7169 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7173 - (void)readAttributeZoneType:(ResponseHandler)completionHandler
7175 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7177 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7181 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7184 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7188 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneType(onSuccess->Cancel(), onFailure->Cancel());
7189 if (err != CHIP_NO_ERROR) {
7192 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7196 - (void)readAttributeZoneStatus:(ResponseHandler)completionHandler
7198 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7200 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7204 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7207 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7211 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneStatus(onSuccess->Cancel(), onFailure->Cancel());
7212 if (err != CHIP_NO_ERROR) {
7215 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7219 - (void)readAttributeIasCieAddress:(ResponseHandler)completionHandler
7221 CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7223 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7227 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7230 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7234 CHIP_ERROR err = self.cppCluster.ReadAttributeIasCieAddress(onSuccess->Cancel(), onFailure->Cancel());
7235 if (err != CHIP_NO_ERROR) {
7238 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7242 - (void)writeAttributeIasCieAddress:(uint64_t)value completionHandler:(ResponseHandler)completionHandler
7244 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7246 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7250 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7253 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7257 CHIP_ERROR err = self.cppCluster.WriteAttributeIasCieAddress(onSuccess->Cancel(), onFailure->Cancel(), value);
7258 if (err != CHIP_NO_ERROR) {
7261 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7265 - (void)readAttributeZoneId:(ResponseHandler)completionHandler
7267 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7269 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7273 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7276 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7280 CHIP_ERROR err = self.cppCluster.ReadAttributeZoneId(onSuccess->Cancel(), onFailure->Cancel());
7281 if (err != CHIP_NO_ERROR) {
7284 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7288 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
7290 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7292 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7296 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7299 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7303 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
7304 if (err != CHIP_NO_ERROR) {
7307 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7313 @interface CHIPIdentify ()
7314 @property (readonly) Controller::IdentifyCluster cppCluster;
7317 @implementation CHIPIdentify
7319 - (Controller::ClusterBase *)getCluster
7321 return &_cppCluster;
7324 - (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler
7326 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7328 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7332 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7335 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7339 CHIP_ERROR err = self.cppCluster.Identify(onSuccess->Cancel(), onFailure->Cancel(), identifyTime);
7340 if (err != CHIP_NO_ERROR) {
7343 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7346 - (void)identifyQuery:(ResponseHandler)completionHandler
7348 CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge * onSuccess
7349 = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(completionHandler, [self callbackQueue]);
7351 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7355 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7358 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7362 CHIP_ERROR err = self.cppCluster.IdentifyQuery(onSuccess->Cancel(), onFailure->Cancel());
7363 if (err != CHIP_NO_ERROR) {
7366 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7370 - (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler
7372 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7374 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7378 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7381 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7385 CHIP_ERROR err = self.cppCluster.ReadAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel());
7386 if (err != CHIP_NO_ERROR) {
7389 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7393 - (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
7395 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7397 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7401 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7404 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7408 CHIP_ERROR err = self.cppCluster.WriteAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel(), value);
7409 if (err != CHIP_NO_ERROR) {
7412 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7416 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
7418 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7420 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7424 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7427 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7431 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
7432 if (err != CHIP_NO_ERROR) {
7435 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7441 @interface CHIPLevelControl ()
7442 @property (readonly) Controller::LevelControlCluster cppCluster;
7445 @implementation CHIPLevelControl
7447 - (Controller::ClusterBase *)getCluster
7449 return &_cppCluster;
7452 - (void)move:(uint8_t)moveMode
7454 optionMask:(uint8_t)optionMask
7455 optionOverride:(uint8_t)optionOverride
7456 completionHandler:(ResponseHandler)completionHandler
7458 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7460 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7464 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7467 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7471 CHIP_ERROR err = self.cppCluster.Move(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionMask, optionOverride);
7472 if (err != CHIP_NO_ERROR) {
7475 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7478 - (void)moveToLevel:(uint8_t)level
7479 transitionTime:(uint16_t)transitionTime
7480 optionMask:(uint8_t)optionMask
7481 optionOverride:(uint8_t)optionOverride
7482 completionHandler:(ResponseHandler)completionHandler
7484 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7486 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7490 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7493 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7498 = self.cppCluster.MoveToLevel(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime, optionMask, optionOverride);
7499 if (err != CHIP_NO_ERROR) {
7502 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7505 - (void)moveToLevelWithOnOff:(uint8_t)level
7506 transitionTime:(uint16_t)transitionTime
7507 completionHandler:(ResponseHandler)completionHandler
7509 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7511 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7515 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7518 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7522 CHIP_ERROR err = self.cppCluster.MoveToLevelWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime);
7523 if (err != CHIP_NO_ERROR) {
7526 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7529 - (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler
7531 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7533 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7537 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7540 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7544 CHIP_ERROR err = self.cppCluster.MoveWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate);
7545 if (err != CHIP_NO_ERROR) {
7548 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7551 - (void)step:(uint8_t)stepMode
7552 stepSize:(uint8_t)stepSize
7553 transitionTime:(uint16_t)transitionTime
7554 optionMask:(uint8_t)optionMask
7555 optionOverride:(uint8_t)optionOverride
7556 completionHandler:(ResponseHandler)completionHandler
7558 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7560 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7564 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7567 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7571 CHIP_ERROR err = self.cppCluster.Step(
7572 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionMask, optionOverride);
7573 if (err != CHIP_NO_ERROR) {
7576 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7579 - (void)stepWithOnOff:(uint8_t)stepMode
7580 stepSize:(uint8_t)stepSize
7581 transitionTime:(uint16_t)transitionTime
7582 completionHandler:(ResponseHandler)completionHandler
7584 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7586 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7590 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7593 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7597 CHIP_ERROR err = self.cppCluster.StepWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime);
7598 if (err != CHIP_NO_ERROR) {
7601 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7604 - (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler
7606 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7608 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7612 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7615 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7619 CHIP_ERROR err = self.cppCluster.Stop(onSuccess->Cancel(), onFailure->Cancel(), optionMask, optionOverride);
7620 if (err != CHIP_NO_ERROR) {
7623 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7626 - (void)stopWithOnOff:(ResponseHandler)completionHandler
7628 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7630 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7634 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7637 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7641 CHIP_ERROR err = self.cppCluster.StopWithOnOff(onSuccess->Cancel(), onFailure->Cancel());
7642 if (err != CHIP_NO_ERROR) {
7645 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7649 - (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler
7651 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7653 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7657 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7660 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7664 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentLevel(onSuccess->Cancel(), onFailure->Cancel());
7665 if (err != CHIP_NO_ERROR) {
7668 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7672 - (void)configureAttributeCurrentLevel:(uint16_t)minInterval
7673 maxInterval:(uint16_t)maxInterval
7674 change:(uint8_t)change
7675 completionHandler:(ResponseHandler)completionHandler
7677 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7679 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7683 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7686 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7690 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentLevel(
7691 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
7692 if (err != CHIP_NO_ERROR) {
7695 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7699 - (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler
7701 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
7703 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7707 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentLevel(onReport->Cancel());
7708 if (err != CHIP_NO_ERROR) {
7710 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
7714 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
7716 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7718 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7722 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7725 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7729 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
7730 if (err != CHIP_NO_ERROR) {
7733 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7739 @interface CHIPLowPower ()
7740 @property (readonly) Controller::LowPowerCluster cppCluster;
7743 @implementation CHIPLowPower
7745 - (Controller::ClusterBase *)getCluster
7747 return &_cppCluster;
7750 - (void)sleep:(ResponseHandler)completionHandler
7752 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7754 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7758 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7761 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7765 CHIP_ERROR err = self.cppCluster.Sleep(onSuccess->Cancel(), onFailure->Cancel());
7766 if (err != CHIP_NO_ERROR) {
7769 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7773 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
7775 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7777 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7781 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7784 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7788 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
7789 if (err != CHIP_NO_ERROR) {
7792 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7798 @interface CHIPMediaPlayback ()
7799 @property (readonly) Controller::MediaPlaybackCluster cppCluster;
7802 @implementation CHIPMediaPlayback
7804 - (Controller::ClusterBase *)getCluster
7806 return &_cppCluster;
7809 - (void)fastForwardRequest:(ResponseHandler)completionHandler
7811 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7813 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7817 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7820 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7824 CHIP_ERROR err = self.cppCluster.FastForwardRequest(onSuccess->Cancel(), onFailure->Cancel());
7825 if (err != CHIP_NO_ERROR) {
7828 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7831 - (void)nextRequest:(ResponseHandler)completionHandler
7833 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7835 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7839 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7842 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7846 CHIP_ERROR err = self.cppCluster.NextRequest(onSuccess->Cancel(), onFailure->Cancel());
7847 if (err != CHIP_NO_ERROR) {
7850 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7853 - (void)pauseRequest:(ResponseHandler)completionHandler
7855 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7857 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7861 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7864 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7868 CHIP_ERROR err = self.cppCluster.PauseRequest(onSuccess->Cancel(), onFailure->Cancel());
7869 if (err != CHIP_NO_ERROR) {
7872 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7875 - (void)playRequest:(ResponseHandler)completionHandler
7877 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7879 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7883 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7886 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7890 CHIP_ERROR err = self.cppCluster.PlayRequest(onSuccess->Cancel(), onFailure->Cancel());
7891 if (err != CHIP_NO_ERROR) {
7894 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7897 - (void)previousRequest:(ResponseHandler)completionHandler
7899 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7901 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7905 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7908 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7912 CHIP_ERROR err = self.cppCluster.PreviousRequest(onSuccess->Cancel(), onFailure->Cancel());
7913 if (err != CHIP_NO_ERROR) {
7916 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7919 - (void)rewindRequest:(ResponseHandler)completionHandler
7921 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7923 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7927 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7930 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7934 CHIP_ERROR err = self.cppCluster.RewindRequest(onSuccess->Cancel(), onFailure->Cancel());
7935 if (err != CHIP_NO_ERROR) {
7938 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7941 - (void)skipBackwardRequest:(ResponseHandler)completionHandler
7943 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7945 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7949 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7952 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7956 CHIP_ERROR err = self.cppCluster.SkipBackwardRequest(onSuccess->Cancel(), onFailure->Cancel());
7957 if (err != CHIP_NO_ERROR) {
7960 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7963 - (void)skipForwardRequest:(ResponseHandler)completionHandler
7965 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7967 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7971 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7974 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7978 CHIP_ERROR err = self.cppCluster.SkipForwardRequest(onSuccess->Cancel(), onFailure->Cancel());
7979 if (err != CHIP_NO_ERROR) {
7982 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7985 - (void)startOverRequest:(ResponseHandler)completionHandler
7987 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7989 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7993 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7996 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8000 CHIP_ERROR err = self.cppCluster.StartOverRequest(onSuccess->Cancel(), onFailure->Cancel());
8001 if (err != CHIP_NO_ERROR) {
8004 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8007 - (void)stopRequest:(ResponseHandler)completionHandler
8009 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
8011 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8015 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8018 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8022 CHIP_ERROR err = self.cppCluster.StopRequest(onSuccess->Cancel(), onFailure->Cancel());
8023 if (err != CHIP_NO_ERROR) {
8026 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8030 - (void)readAttributeCurrentState:(ResponseHandler)completionHandler
8032 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8034 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8038 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8041 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8045 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentState(onSuccess->Cancel(), onFailure->Cancel());
8046 if (err != CHIP_NO_ERROR) {
8049 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8053 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
8055 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8057 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8061 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8064 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8068 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
8069 if (err != CHIP_NO_ERROR) {
8072 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8078 @interface CHIPOnOff ()
8079 @property (readonly) Controller::OnOffCluster cppCluster;
8082 @implementation CHIPOnOff
8084 - (Controller::ClusterBase *)getCluster
8086 return &_cppCluster;
8089 - (void)off:(ResponseHandler)completionHandler
8091 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
8093 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8097 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8100 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8104 CHIP_ERROR err = self.cppCluster.Off(onSuccess->Cancel(), onFailure->Cancel());
8105 if (err != CHIP_NO_ERROR) {
8108 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8111 - (void)on:(ResponseHandler)completionHandler
8113 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
8115 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8119 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8122 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8126 CHIP_ERROR err = self.cppCluster.On(onSuccess->Cancel(), onFailure->Cancel());
8127 if (err != CHIP_NO_ERROR) {
8130 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8133 - (void)toggle:(ResponseHandler)completionHandler
8135 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
8137 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8141 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8144 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8148 CHIP_ERROR err = self.cppCluster.Toggle(onSuccess->Cancel(), onFailure->Cancel());
8149 if (err != CHIP_NO_ERROR) {
8152 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8156 - (void)readAttributeOnOff:(ResponseHandler)completionHandler
8158 CHIPBooleanAttributeCallbackBridge * onSuccess
8159 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8161 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8165 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8168 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8172 CHIP_ERROR err = self.cppCluster.ReadAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel());
8173 if (err != CHIP_NO_ERROR) {
8176 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8180 - (void)configureAttributeOnOff:(uint16_t)minInterval
8181 maxInterval:(uint16_t)maxInterval
8182 completionHandler:(ResponseHandler)completionHandler
8184 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
8186 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8190 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8193 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8197 CHIP_ERROR err = self.cppCluster.ConfigureAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
8198 if (err != CHIP_NO_ERROR) {
8201 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8205 - (void)reportAttributeOnOff:(ResponseHandler)reportHandler
8207 CHIPBooleanAttributeCallbackBridge * onReport
8208 = new CHIPBooleanAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
8210 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8214 CHIP_ERROR err = self.cppCluster.ReportAttributeOnOff(onReport->Cancel());
8215 if (err != CHIP_NO_ERROR) {
8217 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
8221 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
8223 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8225 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8229 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8232 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8236 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
8237 if (err != CHIP_NO_ERROR) {
8240 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8246 @interface CHIPScenes ()
8247 @property (readonly) Controller::ScenesCluster cppCluster;
8250 @implementation CHIPScenes
8252 - (Controller::ClusterBase *)getCluster
8254 return &_cppCluster;
8257 - (void)addScene:(uint16_t)groupId
8258 sceneId:(uint8_t)sceneId
8259 transitionTime:(uint16_t)transitionTime
8260 sceneName:(NSString *)sceneName
8261 clusterId:(uint16_t)clusterId
8262 length:(uint8_t)length
8263 value:(uint8_t)value
8264 completionHandler:(ResponseHandler)completionHandler
8266 CHIPScenesClusterAddSceneResponseCallbackBridge * onSuccess
8267 = new CHIPScenesClusterAddSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
8269 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8273 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8276 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8280 CHIP_ERROR err = self.cppCluster.AddScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime,
8281 chip::ByteSpan((const uint8_t *) [sceneName dataUsingEncoding:NSUTF8StringEncoding].bytes,
8282 [sceneName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]),
8283 clusterId, length, value);
8284 if (err != CHIP_NO_ERROR) {
8287 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8290 - (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
8292 CHIPScenesClusterGetSceneMembershipResponseCallbackBridge * onSuccess
8293 = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]);
8295 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8299 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8302 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8306 CHIP_ERROR err = self.cppCluster.GetSceneMembership(onSuccess->Cancel(), onFailure->Cancel(), groupId);
8307 if (err != CHIP_NO_ERROR) {
8310 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8313 - (void)recallScene:(uint16_t)groupId
8314 sceneId:(uint8_t)sceneId
8315 transitionTime:(uint16_t)transitionTime
8316 completionHandler:(ResponseHandler)completionHandler
8318 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
8320 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8324 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8327 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8331 CHIP_ERROR err = self.cppCluster.RecallScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime);
8332 if (err != CHIP_NO_ERROR) {
8335 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8338 - (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
8340 CHIPScenesClusterRemoveAllScenesResponseCallbackBridge * onSuccess
8341 = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(completionHandler, [self callbackQueue]);
8343 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8347 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8350 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8354 CHIP_ERROR err = self.cppCluster.RemoveAllScenes(onSuccess->Cancel(), onFailure->Cancel(), groupId);
8355 if (err != CHIP_NO_ERROR) {
8358 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8361 - (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
8363 CHIPScenesClusterRemoveSceneResponseCallbackBridge * onSuccess
8364 = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
8366 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8370 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8373 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8377 CHIP_ERROR err = self.cppCluster.RemoveScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
8378 if (err != CHIP_NO_ERROR) {
8381 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8384 - (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
8386 CHIPScenesClusterStoreSceneResponseCallbackBridge * onSuccess
8387 = new CHIPScenesClusterStoreSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
8389 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8393 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8396 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8400 CHIP_ERROR err = self.cppCluster.StoreScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
8401 if (err != CHIP_NO_ERROR) {
8404 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8407 - (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
8409 CHIPScenesClusterViewSceneResponseCallbackBridge * onSuccess
8410 = new CHIPScenesClusterViewSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
8412 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8416 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8419 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8423 CHIP_ERROR err = self.cppCluster.ViewScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
8424 if (err != CHIP_NO_ERROR) {
8427 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8431 - (void)readAttributeSceneCount:(ResponseHandler)completionHandler
8433 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8435 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8439 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8442 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8446 CHIP_ERROR err = self.cppCluster.ReadAttributeSceneCount(onSuccess->Cancel(), onFailure->Cancel());
8447 if (err != CHIP_NO_ERROR) {
8450 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8454 - (void)readAttributeCurrentScene:(ResponseHandler)completionHandler
8456 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8458 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8462 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8465 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8469 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentScene(onSuccess->Cancel(), onFailure->Cancel());
8470 if (err != CHIP_NO_ERROR) {
8473 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8477 - (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler
8479 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8481 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8485 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8488 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8492 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentGroup(onSuccess->Cancel(), onFailure->Cancel());
8493 if (err != CHIP_NO_ERROR) {
8496 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8500 - (void)readAttributeSceneValid:(ResponseHandler)completionHandler
8502 CHIPBooleanAttributeCallbackBridge * onSuccess
8503 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8505 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8509 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8512 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8516 CHIP_ERROR err = self.cppCluster.ReadAttributeSceneValid(onSuccess->Cancel(), onFailure->Cancel());
8517 if (err != CHIP_NO_ERROR) {
8520 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8524 - (void)readAttributeNameSupport:(ResponseHandler)completionHandler
8526 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8528 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8532 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8535 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8539 CHIP_ERROR err = self.cppCluster.ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
8540 if (err != CHIP_NO_ERROR) {
8543 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8547 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
8549 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8551 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8555 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8558 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8562 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
8563 if (err != CHIP_NO_ERROR) {
8566 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8572 @interface CHIPTemperatureMeasurement ()
8573 @property (readonly) Controller::TemperatureMeasurementCluster cppCluster;
8576 @implementation CHIPTemperatureMeasurement
8578 - (Controller::ClusterBase *)getCluster
8580 return &_cppCluster;
8583 - (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler
8585 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8587 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8591 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8594 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8598 CHIP_ERROR err = self.cppCluster.ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
8599 if (err != CHIP_NO_ERROR) {
8602 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8606 - (void)configureAttributeMeasuredValue:(uint16_t)minInterval
8607 maxInterval:(uint16_t)maxInterval
8608 change:(int16_t)change
8609 completionHandler:(ResponseHandler)completionHandler
8611 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
8613 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8617 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8620 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8624 CHIP_ERROR err = self.cppCluster.ConfigureAttributeMeasuredValue(
8625 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
8626 if (err != CHIP_NO_ERROR) {
8629 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8633 - (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler
8635 CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
8637 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8641 CHIP_ERROR err = self.cppCluster.ReportAttributeMeasuredValue(onReport->Cancel());
8642 if (err != CHIP_NO_ERROR) {
8644 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
8648 - (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler
8650 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8652 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8656 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8659 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8663 CHIP_ERROR err = self.cppCluster.ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
8664 if (err != CHIP_NO_ERROR) {
8667 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8671 - (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler
8673 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8675 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8679 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8682 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8686 CHIP_ERROR err = self.cppCluster.ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
8687 if (err != CHIP_NO_ERROR) {
8690 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
8694 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
8696 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
8698 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8702 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
8705 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
8709 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
8710 if (err != CHIP_NO_ERROR) {
8713 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);