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 CHIPContentLaunchClusterLaunchContentResponseCallbackBridge
328 : public Callback::Callback<ContentLaunchClusterLaunchContentResponseCallback> {
330 CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
331 : Callback::Callback<ContentLaunchClusterLaunchContentResponseCallback>(CallbackFn, this)
337 ~CHIPContentLaunchClusterLaunchContentResponseCallbackBridge() {};
339 static void CallbackFn(void * context, uint8_t contentLaunchStatus)
341 CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * callback
342 = reinterpret_cast<CHIPContentLaunchClusterLaunchContentResponseCallbackBridge *>(context);
343 if (callback && callback->mQueue) {
344 dispatch_async(callback->mQueue, ^{
345 callback->mHandler(nil, @ {
346 @"contentLaunchStatus" : [NSNumber numberWithUnsignedChar:contentLaunchStatus],
355 ResponseHandler mHandler;
356 dispatch_queue_t mQueue;
359 class CHIPContentLaunchClusterLaunchURLResponseCallbackBridge
360 : public Callback::Callback<ContentLaunchClusterLaunchURLResponseCallback> {
362 CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
363 : Callback::Callback<ContentLaunchClusterLaunchURLResponseCallback>(CallbackFn, this)
369 ~CHIPContentLaunchClusterLaunchURLResponseCallbackBridge() {};
371 static void CallbackFn(void * context, uint8_t contentLaunchStatus)
373 CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * callback
374 = reinterpret_cast<CHIPContentLaunchClusterLaunchURLResponseCallbackBridge *>(context);
375 if (callback && callback->mQueue) {
376 dispatch_async(callback->mQueue, ^{
377 callback->mHandler(nil, @ {
378 @"contentLaunchStatus" : [NSNumber numberWithUnsignedChar:contentLaunchStatus],
387 ResponseHandler mHandler;
388 dispatch_queue_t mQueue;
391 class CHIPDoorLockClusterClearAllPinsResponseCallbackBridge
392 : public Callback::Callback<DoorLockClusterClearAllPinsResponseCallback> {
394 CHIPDoorLockClusterClearAllPinsResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
395 : Callback::Callback<DoorLockClusterClearAllPinsResponseCallback>(CallbackFn, this)
401 ~CHIPDoorLockClusterClearAllPinsResponseCallbackBridge() {};
403 static void CallbackFn(void * context)
405 CHIPDoorLockClusterClearAllPinsResponseCallbackBridge * callback
406 = reinterpret_cast<CHIPDoorLockClusterClearAllPinsResponseCallbackBridge *>(context);
407 if (callback && callback->mQueue) {
408 dispatch_async(callback->mQueue, ^{
409 callback->mHandler(nil, @ {});
417 ResponseHandler mHandler;
418 dispatch_queue_t mQueue;
421 class CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge
422 : public Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback> {
424 CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
425 : Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback>(CallbackFn, this)
431 ~CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge() {};
433 static void CallbackFn(void * context)
435 CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge * callback
436 = reinterpret_cast<CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge *>(context);
437 if (callback && callback->mQueue) {
438 dispatch_async(callback->mQueue, ^{
439 callback->mHandler(nil, @ {});
447 ResponseHandler mHandler;
448 dispatch_queue_t mQueue;
451 class CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge
452 : public Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback> {
454 CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
455 : Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback>(CallbackFn, this)
461 ~CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge() {};
463 static void CallbackFn(void * context)
465 CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge * callback
466 = reinterpret_cast<CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge *>(context);
467 if (callback && callback->mQueue) {
468 dispatch_async(callback->mQueue, ^{
469 callback->mHandler(nil, @ {});
477 ResponseHandler mHandler;
478 dispatch_queue_t mQueue;
481 class CHIPDoorLockClusterClearPinResponseCallbackBridge : public Callback::Callback<DoorLockClusterClearPinResponseCallback> {
483 CHIPDoorLockClusterClearPinResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
484 : Callback::Callback<DoorLockClusterClearPinResponseCallback>(CallbackFn, this)
490 ~CHIPDoorLockClusterClearPinResponseCallbackBridge() {};
492 static void CallbackFn(void * context)
494 CHIPDoorLockClusterClearPinResponseCallbackBridge * callback
495 = reinterpret_cast<CHIPDoorLockClusterClearPinResponseCallbackBridge *>(context);
496 if (callback && callback->mQueue) {
497 dispatch_async(callback->mQueue, ^{
498 callback->mHandler(nil, @ {});
506 ResponseHandler mHandler;
507 dispatch_queue_t mQueue;
510 class CHIPDoorLockClusterClearRfidResponseCallbackBridge : public Callback::Callback<DoorLockClusterClearRfidResponseCallback> {
512 CHIPDoorLockClusterClearRfidResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
513 : Callback::Callback<DoorLockClusterClearRfidResponseCallback>(CallbackFn, this)
519 ~CHIPDoorLockClusterClearRfidResponseCallbackBridge() {};
521 static void CallbackFn(void * context)
523 CHIPDoorLockClusterClearRfidResponseCallbackBridge * callback
524 = reinterpret_cast<CHIPDoorLockClusterClearRfidResponseCallbackBridge *>(context);
525 if (callback && callback->mQueue) {
526 dispatch_async(callback->mQueue, ^{
527 callback->mHandler(nil, @ {});
535 ResponseHandler mHandler;
536 dispatch_queue_t mQueue;
539 class CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge
540 : public Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback> {
542 CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
543 : Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback>(CallbackFn, this)
549 ~CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge() {};
551 static void CallbackFn(void * context)
553 CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge * callback
554 = reinterpret_cast<CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge *>(context);
555 if (callback && callback->mQueue) {
556 dispatch_async(callback->mQueue, ^{
557 callback->mHandler(nil, @ {});
565 ResponseHandler mHandler;
566 dispatch_queue_t mQueue;
569 class CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge
570 : public Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback> {
572 CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
573 : Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback>(CallbackFn, this)
579 ~CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge() {};
581 static void CallbackFn(void * context)
583 CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge * callback
584 = reinterpret_cast<CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge *>(context);
585 if (callback && callback->mQueue) {
586 dispatch_async(callback->mQueue, ^{
587 callback->mHandler(nil, @ {});
595 ResponseHandler mHandler;
596 dispatch_queue_t mQueue;
599 class CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge
600 : public Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback> {
602 CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
603 : Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback>(CallbackFn, this)
609 ~CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge() {};
611 static void CallbackFn(
612 void * context, uint8_t scheduleId, uint32_t localStartTime, uint32_t localEndTime, uint8_t operatingModeDuringHoliday)
614 CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge * callback
615 = reinterpret_cast<CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge *>(context);
616 if (callback && callback->mQueue) {
617 dispatch_async(callback->mQueue, ^{
618 callback->mHandler(nil, @ {
619 @"scheduleId" : [NSNumber numberWithUnsignedChar:scheduleId],
620 @"localStartTime" : [NSNumber numberWithUnsignedLong:localStartTime],
621 @"localEndTime" : [NSNumber numberWithUnsignedLong:localEndTime],
622 @"operatingModeDuringHoliday" : [NSNumber numberWithUnsignedChar:operatingModeDuringHoliday],
631 ResponseHandler mHandler;
632 dispatch_queue_t mQueue;
635 class CHIPDoorLockClusterGetLogRecordResponseCallbackBridge
636 : public Callback::Callback<DoorLockClusterGetLogRecordResponseCallback> {
638 CHIPDoorLockClusterGetLogRecordResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
639 : Callback::Callback<DoorLockClusterGetLogRecordResponseCallback>(CallbackFn, this)
645 ~CHIPDoorLockClusterGetLogRecordResponseCallbackBridge() {};
647 static void CallbackFn(void * context, uint16_t logEntryId, uint32_t timestamp, uint8_t eventType, uint8_t source,
648 uint8_t eventIdOrAlarmCode, uint16_t userId, uint8_t * pin)
650 CHIPDoorLockClusterGetLogRecordResponseCallbackBridge * callback
651 = reinterpret_cast<CHIPDoorLockClusterGetLogRecordResponseCallbackBridge *>(context);
652 if (callback && callback->mQueue) {
653 dispatch_async(callback->mQueue, ^{
654 callback->mHandler(nil, @ {
655 @"logEntryId" : [NSNumber numberWithUnsignedShort:logEntryId],
656 @"timestamp" : [NSNumber numberWithUnsignedLong:timestamp],
657 @"eventType" : [NSNumber numberWithUnsignedChar:eventType],
658 @"source" : [NSNumber numberWithUnsignedChar:source],
659 @"eventIdOrAlarmCode" : [NSNumber numberWithUnsignedChar:eventIdOrAlarmCode],
660 @"userId" : [NSNumber numberWithUnsignedShort:userId],
661 @"pin" : [NSString stringWithFormat:@"%s", pin],
670 ResponseHandler mHandler;
671 dispatch_queue_t mQueue;
674 class CHIPDoorLockClusterGetPinResponseCallbackBridge : public Callback::Callback<DoorLockClusterGetPinResponseCallback> {
676 CHIPDoorLockClusterGetPinResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
677 : Callback::Callback<DoorLockClusterGetPinResponseCallback>(CallbackFn, this)
683 ~CHIPDoorLockClusterGetPinResponseCallbackBridge() {};
685 static void CallbackFn(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * pin)
687 CHIPDoorLockClusterGetPinResponseCallbackBridge * callback
688 = reinterpret_cast<CHIPDoorLockClusterGetPinResponseCallbackBridge *>(context);
689 if (callback && callback->mQueue) {
690 dispatch_async(callback->mQueue, ^{
691 callback->mHandler(nil, @ {
692 @"userId" : [NSNumber numberWithUnsignedShort:userId],
693 @"userStatus" : [NSNumber numberWithUnsignedChar:userStatus],
694 @"userType" : [NSNumber numberWithUnsignedChar:userType],
695 @"pin" : [NSString stringWithFormat:@"%s", pin],
704 ResponseHandler mHandler;
705 dispatch_queue_t mQueue;
708 class CHIPDoorLockClusterGetRfidResponseCallbackBridge : public Callback::Callback<DoorLockClusterGetRfidResponseCallback> {
710 CHIPDoorLockClusterGetRfidResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
711 : Callback::Callback<DoorLockClusterGetRfidResponseCallback>(CallbackFn, this)
717 ~CHIPDoorLockClusterGetRfidResponseCallbackBridge() {};
719 static void CallbackFn(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * rfid)
721 CHIPDoorLockClusterGetRfidResponseCallbackBridge * callback
722 = reinterpret_cast<CHIPDoorLockClusterGetRfidResponseCallbackBridge *>(context);
723 if (callback && callback->mQueue) {
724 dispatch_async(callback->mQueue, ^{
725 callback->mHandler(nil, @ {
726 @"userId" : [NSNumber numberWithUnsignedShort:userId],
727 @"userStatus" : [NSNumber numberWithUnsignedChar:userStatus],
728 @"userType" : [NSNumber numberWithUnsignedChar:userType],
729 @"rfid" : [NSString stringWithFormat:@"%s", rfid],
738 ResponseHandler mHandler;
739 dispatch_queue_t mQueue;
742 class CHIPDoorLockClusterGetUserTypeResponseCallbackBridge : public Callback::Callback<DoorLockClusterGetUserTypeResponseCallback> {
744 CHIPDoorLockClusterGetUserTypeResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
745 : Callback::Callback<DoorLockClusterGetUserTypeResponseCallback>(CallbackFn, this)
751 ~CHIPDoorLockClusterGetUserTypeResponseCallbackBridge() {};
753 static void CallbackFn(void * context, uint16_t userId, uint8_t userType)
755 CHIPDoorLockClusterGetUserTypeResponseCallbackBridge * callback
756 = reinterpret_cast<CHIPDoorLockClusterGetUserTypeResponseCallbackBridge *>(context);
757 if (callback && callback->mQueue) {
758 dispatch_async(callback->mQueue, ^{
759 callback->mHandler(nil, @ {
760 @"userId" : [NSNumber numberWithUnsignedShort:userId],
761 @"userType" : [NSNumber numberWithUnsignedChar:userType],
770 ResponseHandler mHandler;
771 dispatch_queue_t mQueue;
774 class CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge
775 : public Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback> {
777 CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
778 : Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback>(CallbackFn, this)
784 ~CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge() {};
786 static void CallbackFn(void * context, uint8_t scheduleId, uint16_t userId, uint8_t daysMask, uint8_t startHour,
787 uint8_t startMinute, uint8_t endHour, uint8_t endMinute)
789 CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge * callback
790 = reinterpret_cast<CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge *>(context);
791 if (callback && callback->mQueue) {
792 dispatch_async(callback->mQueue, ^{
793 callback->mHandler(nil, @ {
794 @"scheduleId" : [NSNumber numberWithUnsignedChar:scheduleId],
795 @"userId" : [NSNumber numberWithUnsignedShort:userId],
796 @"daysMask" : [NSNumber numberWithUnsignedChar:daysMask],
797 @"startHour" : [NSNumber numberWithUnsignedChar:startHour],
798 @"startMinute" : [NSNumber numberWithUnsignedChar:startMinute],
799 @"endHour" : [NSNumber numberWithUnsignedChar:endHour],
800 @"endMinute" : [NSNumber numberWithUnsignedChar:endMinute],
809 ResponseHandler mHandler;
810 dispatch_queue_t mQueue;
813 class CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge
814 : public Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback> {
816 CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
817 : Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback>(CallbackFn, this)
823 ~CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge() {};
825 static void CallbackFn(void * context, uint8_t scheduleId, uint16_t userId, uint32_t localStartTime, uint32_t localEndTime)
827 CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge * callback
828 = reinterpret_cast<CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge *>(context);
829 if (callback && callback->mQueue) {
830 dispatch_async(callback->mQueue, ^{
831 callback->mHandler(nil, @ {
832 @"scheduleId" : [NSNumber numberWithUnsignedChar:scheduleId],
833 @"userId" : [NSNumber numberWithUnsignedShort:userId],
834 @"localStartTime" : [NSNumber numberWithUnsignedLong:localStartTime],
835 @"localEndTime" : [NSNumber numberWithUnsignedLong:localEndTime],
844 ResponseHandler mHandler;
845 dispatch_queue_t mQueue;
848 class CHIPDoorLockClusterLockDoorResponseCallbackBridge : public Callback::Callback<DoorLockClusterLockDoorResponseCallback> {
850 CHIPDoorLockClusterLockDoorResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
851 : Callback::Callback<DoorLockClusterLockDoorResponseCallback>(CallbackFn, this)
857 ~CHIPDoorLockClusterLockDoorResponseCallbackBridge() {};
859 static void CallbackFn(void * context)
861 CHIPDoorLockClusterLockDoorResponseCallbackBridge * callback
862 = reinterpret_cast<CHIPDoorLockClusterLockDoorResponseCallbackBridge *>(context);
863 if (callback && callback->mQueue) {
864 dispatch_async(callback->mQueue, ^{
865 callback->mHandler(nil, @ {});
873 ResponseHandler mHandler;
874 dispatch_queue_t mQueue;
877 class CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge
878 : public Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback> {
880 CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
881 : Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback>(CallbackFn, this)
887 ~CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge() {};
889 static void CallbackFn(void * context)
891 CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge * callback
892 = reinterpret_cast<CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge *>(context);
893 if (callback && callback->mQueue) {
894 dispatch_async(callback->mQueue, ^{
895 callback->mHandler(nil, @ {});
903 ResponseHandler mHandler;
904 dispatch_queue_t mQueue;
907 class CHIPDoorLockClusterSetPinResponseCallbackBridge : public Callback::Callback<DoorLockClusterSetPinResponseCallback> {
909 CHIPDoorLockClusterSetPinResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
910 : Callback::Callback<DoorLockClusterSetPinResponseCallback>(CallbackFn, this)
916 ~CHIPDoorLockClusterSetPinResponseCallbackBridge() {};
918 static void CallbackFn(void * context)
920 CHIPDoorLockClusterSetPinResponseCallbackBridge * callback
921 = reinterpret_cast<CHIPDoorLockClusterSetPinResponseCallbackBridge *>(context);
922 if (callback && callback->mQueue) {
923 dispatch_async(callback->mQueue, ^{
924 callback->mHandler(nil, @ {});
932 ResponseHandler mHandler;
933 dispatch_queue_t mQueue;
936 class CHIPDoorLockClusterSetRfidResponseCallbackBridge : public Callback::Callback<DoorLockClusterSetRfidResponseCallback> {
938 CHIPDoorLockClusterSetRfidResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
939 : Callback::Callback<DoorLockClusterSetRfidResponseCallback>(CallbackFn, this)
945 ~CHIPDoorLockClusterSetRfidResponseCallbackBridge() {};
947 static void CallbackFn(void * context)
949 CHIPDoorLockClusterSetRfidResponseCallbackBridge * callback
950 = reinterpret_cast<CHIPDoorLockClusterSetRfidResponseCallbackBridge *>(context);
951 if (callback && callback->mQueue) {
952 dispatch_async(callback->mQueue, ^{
953 callback->mHandler(nil, @ {});
961 ResponseHandler mHandler;
962 dispatch_queue_t mQueue;
965 class CHIPDoorLockClusterSetUserTypeResponseCallbackBridge : public Callback::Callback<DoorLockClusterSetUserTypeResponseCallback> {
967 CHIPDoorLockClusterSetUserTypeResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
968 : Callback::Callback<DoorLockClusterSetUserTypeResponseCallback>(CallbackFn, this)
974 ~CHIPDoorLockClusterSetUserTypeResponseCallbackBridge() {};
976 static void CallbackFn(void * context)
978 CHIPDoorLockClusterSetUserTypeResponseCallbackBridge * callback
979 = reinterpret_cast<CHIPDoorLockClusterSetUserTypeResponseCallbackBridge *>(context);
980 if (callback && callback->mQueue) {
981 dispatch_async(callback->mQueue, ^{
982 callback->mHandler(nil, @ {});
990 ResponseHandler mHandler;
991 dispatch_queue_t mQueue;
994 class CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge
995 : public Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback> {
997 CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
998 : Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback>(CallbackFn, this)
1004 ~CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge() {};
1006 static void CallbackFn(void * context)
1008 CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge * callback
1009 = reinterpret_cast<CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge *>(context);
1010 if (callback && callback->mQueue) {
1011 dispatch_async(callback->mQueue, ^{
1012 callback->mHandler(nil, @ {});
1020 ResponseHandler mHandler;
1021 dispatch_queue_t mQueue;
1024 class CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge
1025 : public Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback> {
1027 CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1028 : Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback>(CallbackFn, this)
1034 ~CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge() {};
1036 static void CallbackFn(void * context)
1038 CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge * callback
1039 = reinterpret_cast<CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge *>(context);
1040 if (callback && callback->mQueue) {
1041 dispatch_async(callback->mQueue, ^{
1042 callback->mHandler(nil, @ {});
1050 ResponseHandler mHandler;
1051 dispatch_queue_t mQueue;
1054 class CHIPDoorLockClusterUnlockDoorResponseCallbackBridge : public Callback::Callback<DoorLockClusterUnlockDoorResponseCallback> {
1056 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1057 : Callback::Callback<DoorLockClusterUnlockDoorResponseCallback>(CallbackFn, this)
1063 ~CHIPDoorLockClusterUnlockDoorResponseCallbackBridge() {};
1065 static void CallbackFn(void * context)
1067 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * callback
1068 = reinterpret_cast<CHIPDoorLockClusterUnlockDoorResponseCallbackBridge *>(context);
1069 if (callback && callback->mQueue) {
1070 dispatch_async(callback->mQueue, ^{
1071 callback->mHandler(nil, @ {});
1079 ResponseHandler mHandler;
1080 dispatch_queue_t mQueue;
1083 class CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge
1084 : public Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback> {
1086 CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1087 : Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback>(CallbackFn, this)
1093 ~CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge() {};
1095 static void CallbackFn(void * context)
1097 CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge * callback
1098 = reinterpret_cast<CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge *>(context);
1099 if (callback && callback->mQueue) {
1100 dispatch_async(callback->mQueue, ^{
1101 callback->mHandler(nil, @ {});
1109 ResponseHandler mHandler;
1110 dispatch_queue_t mQueue;
1113 class CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge
1114 : public Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback> {
1116 CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1117 : Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback>(CallbackFn, this)
1123 ~CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge() {};
1125 static void CallbackFn(void * context, uint8_t errorCode, uint8_t * debugText)
1127 CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge * callback
1128 = reinterpret_cast<CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge *>(context);
1129 if (callback && callback->mQueue) {
1130 dispatch_async(callback->mQueue, ^{
1131 callback->mHandler(nil, @ {
1132 @"errorCode" : [NSNumber numberWithUnsignedChar:errorCode],
1133 @"debugText" : [NSString stringWithFormat:@"%s", debugText],
1142 ResponseHandler mHandler;
1143 dispatch_queue_t mQueue;
1146 class CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge
1147 : public Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback> {
1149 CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1150 : Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback>(CallbackFn, this)
1156 ~CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge() {};
1158 static void CallbackFn(void * context, uint8_t errorCode, uint8_t * debugText)
1160 CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge * callback
1161 = reinterpret_cast<CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge *>(context);
1162 if (callback && callback->mQueue) {
1163 dispatch_async(callback->mQueue, ^{
1164 callback->mHandler(nil, @ {
1165 @"errorCode" : [NSNumber numberWithUnsignedChar:errorCode],
1166 @"debugText" : [NSString stringWithFormat:@"%s", debugText],
1175 ResponseHandler mHandler;
1176 dispatch_queue_t mQueue;
1179 class CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge
1180 : public Callback::Callback<GeneralCommissioningClusterSetFabricResponseCallback> {
1182 CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1183 : Callback::Callback<GeneralCommissioningClusterSetFabricResponseCallback>(CallbackFn, this)
1189 ~CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge() {};
1191 static void CallbackFn(void * context, uint8_t errorCode, uint8_t * debugText)
1193 CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge * callback
1194 = reinterpret_cast<CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge *>(context);
1195 if (callback && callback->mQueue) {
1196 dispatch_async(callback->mQueue, ^{
1197 callback->mHandler(nil, @ {
1198 @"errorCode" : [NSNumber numberWithUnsignedChar:errorCode],
1199 @"debugText" : [NSString stringWithFormat:@"%s", debugText],
1208 ResponseHandler mHandler;
1209 dispatch_queue_t mQueue;
1212 class CHIPGroupsClusterAddGroupResponseCallbackBridge : public Callback::Callback<GroupsClusterAddGroupResponseCallback> {
1214 CHIPGroupsClusterAddGroupResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1215 : Callback::Callback<GroupsClusterAddGroupResponseCallback>(CallbackFn, this)
1221 ~CHIPGroupsClusterAddGroupResponseCallbackBridge() {};
1223 static void CallbackFn(void * context, uint16_t groupId)
1225 CHIPGroupsClusterAddGroupResponseCallbackBridge * callback
1226 = reinterpret_cast<CHIPGroupsClusterAddGroupResponseCallbackBridge *>(context);
1227 if (callback && callback->mQueue) {
1228 dispatch_async(callback->mQueue, ^{
1229 callback->mHandler(nil, @ {
1230 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1239 ResponseHandler mHandler;
1240 dispatch_queue_t mQueue;
1243 class CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge
1244 : public Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback> {
1246 CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1247 : Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback>(CallbackFn, this)
1253 ~CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge() {};
1255 static void CallbackFn(
1256 void * context, uint8_t capacity, uint8_t groupCount, /* TYPE WARNING: array array defaults to */ uint8_t * groupList)
1258 CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge * callback
1259 = reinterpret_cast<CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge *>(context);
1260 if (callback && callback->mQueue) {
1261 dispatch_async(callback->mQueue, ^{
1262 callback->mHandler(nil, @ {
1263 @"capacity" : [NSNumber numberWithUnsignedChar:capacity],
1264 @"groupCount" : [NSNumber numberWithUnsignedChar:groupCount],
1265 // groupList: /* TYPE WARNING: array array defaults to */ uint8_t *
1266 // Conversion from this type to Objc is not properly implemented yet
1275 ResponseHandler mHandler;
1276 dispatch_queue_t mQueue;
1279 class CHIPGroupsClusterRemoveGroupResponseCallbackBridge : public Callback::Callback<GroupsClusterRemoveGroupResponseCallback> {
1281 CHIPGroupsClusterRemoveGroupResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1282 : Callback::Callback<GroupsClusterRemoveGroupResponseCallback>(CallbackFn, this)
1288 ~CHIPGroupsClusterRemoveGroupResponseCallbackBridge() {};
1290 static void CallbackFn(void * context, uint16_t groupId)
1292 CHIPGroupsClusterRemoveGroupResponseCallbackBridge * callback
1293 = reinterpret_cast<CHIPGroupsClusterRemoveGroupResponseCallbackBridge *>(context);
1294 if (callback && callback->mQueue) {
1295 dispatch_async(callback->mQueue, ^{
1296 callback->mHandler(nil, @ {
1297 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1306 ResponseHandler mHandler;
1307 dispatch_queue_t mQueue;
1310 class CHIPGroupsClusterViewGroupResponseCallbackBridge : public Callback::Callback<GroupsClusterViewGroupResponseCallback> {
1312 CHIPGroupsClusterViewGroupResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1313 : Callback::Callback<GroupsClusterViewGroupResponseCallback>(CallbackFn, this)
1319 ~CHIPGroupsClusterViewGroupResponseCallbackBridge() {};
1321 static void CallbackFn(void * context, uint16_t groupId, uint8_t * groupName)
1323 CHIPGroupsClusterViewGroupResponseCallbackBridge * callback
1324 = reinterpret_cast<CHIPGroupsClusterViewGroupResponseCallbackBridge *>(context);
1325 if (callback && callback->mQueue) {
1326 dispatch_async(callback->mQueue, ^{
1327 callback->mHandler(nil, @ {
1328 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1329 @"groupName" : [NSString stringWithFormat:@"%s", groupName],
1338 ResponseHandler mHandler;
1339 dispatch_queue_t mQueue;
1342 class CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge
1343 : public Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback> {
1345 CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1346 : Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback>(CallbackFn, this)
1352 ~CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge() {};
1354 static void CallbackFn(void * context, uint16_t timeout)
1356 CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge * callback
1357 = reinterpret_cast<CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge *>(context);
1358 if (callback && callback->mQueue) {
1359 dispatch_async(callback->mQueue, ^{
1360 callback->mHandler(nil, @ {
1361 @"timeout" : [NSNumber numberWithUnsignedShort:timeout],
1370 ResponseHandler mHandler;
1371 dispatch_queue_t mQueue;
1374 class CHIPMediaPlaybackClusterPlaybackCallbackBridge : public Callback::Callback<MediaPlaybackClusterPlaybackCallback> {
1376 CHIPMediaPlaybackClusterPlaybackCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1377 : Callback::Callback<MediaPlaybackClusterPlaybackCallback>(CallbackFn, this)
1383 ~CHIPMediaPlaybackClusterPlaybackCallbackBridge() {};
1385 static void CallbackFn(void * context)
1387 CHIPMediaPlaybackClusterPlaybackCallbackBridge * callback
1388 = reinterpret_cast<CHIPMediaPlaybackClusterPlaybackCallbackBridge *>(context);
1389 if (callback && callback->mQueue) {
1390 dispatch_async(callback->mQueue, ^{
1391 callback->mHandler(nil, @ {});
1399 ResponseHandler mHandler;
1400 dispatch_queue_t mQueue;
1403 class CHIPScenesClusterAddSceneResponseCallbackBridge : public Callback::Callback<ScenesClusterAddSceneResponseCallback> {
1405 CHIPScenesClusterAddSceneResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1406 : Callback::Callback<ScenesClusterAddSceneResponseCallback>(CallbackFn, this)
1412 ~CHIPScenesClusterAddSceneResponseCallbackBridge() {};
1414 static void CallbackFn(void * context, uint16_t groupId, uint8_t sceneId)
1416 CHIPScenesClusterAddSceneResponseCallbackBridge * callback
1417 = reinterpret_cast<CHIPScenesClusterAddSceneResponseCallbackBridge *>(context);
1418 if (callback && callback->mQueue) {
1419 dispatch_async(callback->mQueue, ^{
1420 callback->mHandler(nil, @ {
1421 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1422 @"sceneId" : [NSNumber numberWithUnsignedChar:sceneId],
1431 ResponseHandler mHandler;
1432 dispatch_queue_t mQueue;
1435 class CHIPScenesClusterGetSceneMembershipResponseCallbackBridge
1436 : public Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback> {
1438 CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1439 : Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback>(CallbackFn, this)
1445 ~CHIPScenesClusterGetSceneMembershipResponseCallbackBridge() {};
1447 static void CallbackFn(void * context, uint8_t capacity, uint16_t groupId, uint8_t sceneCount,
1448 /* TYPE WARNING: array array defaults to */ uint8_t * sceneList)
1450 CHIPScenesClusterGetSceneMembershipResponseCallbackBridge * callback
1451 = reinterpret_cast<CHIPScenesClusterGetSceneMembershipResponseCallbackBridge *>(context);
1452 if (callback && callback->mQueue) {
1453 dispatch_async(callback->mQueue, ^{
1454 callback->mHandler(nil, @ {
1455 @"capacity" : [NSNumber numberWithUnsignedChar:capacity],
1456 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1457 @"sceneCount" : [NSNumber numberWithUnsignedChar:sceneCount],
1458 // sceneList: /* TYPE WARNING: array array defaults to */ uint8_t *
1459 // Conversion from this type to Objc is not properly implemented yet
1468 ResponseHandler mHandler;
1469 dispatch_queue_t mQueue;
1472 class CHIPScenesClusterRemoveAllScenesResponseCallbackBridge
1473 : public Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback> {
1475 CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1476 : Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback>(CallbackFn, this)
1482 ~CHIPScenesClusterRemoveAllScenesResponseCallbackBridge() {};
1484 static void CallbackFn(void * context, uint16_t groupId)
1486 CHIPScenesClusterRemoveAllScenesResponseCallbackBridge * callback
1487 = reinterpret_cast<CHIPScenesClusterRemoveAllScenesResponseCallbackBridge *>(context);
1488 if (callback && callback->mQueue) {
1489 dispatch_async(callback->mQueue, ^{
1490 callback->mHandler(nil, @ {
1491 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1500 ResponseHandler mHandler;
1501 dispatch_queue_t mQueue;
1504 class CHIPScenesClusterRemoveSceneResponseCallbackBridge : public Callback::Callback<ScenesClusterRemoveSceneResponseCallback> {
1506 CHIPScenesClusterRemoveSceneResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1507 : Callback::Callback<ScenesClusterRemoveSceneResponseCallback>(CallbackFn, this)
1513 ~CHIPScenesClusterRemoveSceneResponseCallbackBridge() {};
1515 static void CallbackFn(void * context, uint16_t groupId, uint8_t sceneId)
1517 CHIPScenesClusterRemoveSceneResponseCallbackBridge * callback
1518 = reinterpret_cast<CHIPScenesClusterRemoveSceneResponseCallbackBridge *>(context);
1519 if (callback && callback->mQueue) {
1520 dispatch_async(callback->mQueue, ^{
1521 callback->mHandler(nil, @ {
1522 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1523 @"sceneId" : [NSNumber numberWithUnsignedChar:sceneId],
1532 ResponseHandler mHandler;
1533 dispatch_queue_t mQueue;
1536 class CHIPScenesClusterStoreSceneResponseCallbackBridge : public Callback::Callback<ScenesClusterStoreSceneResponseCallback> {
1538 CHIPScenesClusterStoreSceneResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1539 : Callback::Callback<ScenesClusterStoreSceneResponseCallback>(CallbackFn, this)
1545 ~CHIPScenesClusterStoreSceneResponseCallbackBridge() {};
1547 static void CallbackFn(void * context, uint16_t groupId, uint8_t sceneId)
1549 CHIPScenesClusterStoreSceneResponseCallbackBridge * callback
1550 = reinterpret_cast<CHIPScenesClusterStoreSceneResponseCallbackBridge *>(context);
1551 if (callback && callback->mQueue) {
1552 dispatch_async(callback->mQueue, ^{
1553 callback->mHandler(nil, @ {
1554 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1555 @"sceneId" : [NSNumber numberWithUnsignedChar:sceneId],
1564 ResponseHandler mHandler;
1565 dispatch_queue_t mQueue;
1568 class CHIPScenesClusterViewSceneResponseCallbackBridge : public Callback::Callback<ScenesClusterViewSceneResponseCallback> {
1570 CHIPScenesClusterViewSceneResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1571 : Callback::Callback<ScenesClusterViewSceneResponseCallback>(CallbackFn, this)
1577 ~CHIPScenesClusterViewSceneResponseCallbackBridge() {};
1579 static void CallbackFn(void * context, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, uint8_t * sceneName,
1580 /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets)
1582 CHIPScenesClusterViewSceneResponseCallbackBridge * callback
1583 = reinterpret_cast<CHIPScenesClusterViewSceneResponseCallbackBridge *>(context);
1584 if (callback && callback->mQueue) {
1585 dispatch_async(callback->mQueue, ^{
1586 callback->mHandler(nil, @ {
1587 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1588 @"sceneId" : [NSNumber numberWithUnsignedChar:sceneId],
1589 @"transitionTime" : [NSNumber numberWithUnsignedShort:transitionTime],
1590 @"sceneName" : [NSString stringWithFormat:@"%s", sceneName],
1591 // extensionFieldSets: /* TYPE WARNING: array array defaults to */ uint8_t *
1592 // Conversion from this type to Objc is not properly implemented yet
1601 ResponseHandler mHandler;
1602 dispatch_queue_t mQueue;
1605 @interface CHIPCluster ()
1606 @property (readonly, nonatomic) dispatch_queue_t callbackQueue;
1607 - (Controller::ClusterBase *)getCluster;
1610 @implementation CHIPCluster
1611 - (instancetype)initWithDevice:(CHIPDevice *)device endpoint:(EndpointId)endpoint queue:(dispatch_queue_t)queue
1613 if (self = [super init]) {
1614 Controller::ClusterBase * cppCluster = [self getCluster];
1615 if (cppCluster == nullptr) {
1619 CHIP_ERROR err = cppCluster->Associate([device internalDevice], endpoint);
1620 if (err != CHIP_NO_ERROR) {
1624 _callbackQueue = queue;
1629 - (Controller::ClusterBase *)getCluster
1635 @interface CHIPApplicationBasic ()
1636 @property (readonly) Controller::ApplicationBasicCluster cppCluster;
1639 @implementation CHIPApplicationBasic
1641 - (Controller::ClusterBase *)getCluster
1643 return &_cppCluster;
1646 - (void)readAttributeVendorName:(ResponseHandler)completionHandler
1648 CHIPStringAttributeCallbackBridge * onSuccess
1649 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
1651 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1655 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1658 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1662 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
1663 if (err != CHIP_NO_ERROR) {
1666 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1670 - (void)readAttributeVendorId:(ResponseHandler)completionHandler
1672 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1674 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1678 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1681 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1685 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel());
1686 if (err != CHIP_NO_ERROR) {
1689 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1693 - (void)readAttributeApplicationName:(ResponseHandler)completionHandler
1695 CHIPStringAttributeCallbackBridge * onSuccess
1696 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
1698 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1702 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1705 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1709 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationName(onSuccess->Cancel(), onFailure->Cancel());
1710 if (err != CHIP_NO_ERROR) {
1713 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1717 - (void)readAttributeProductId:(ResponseHandler)completionHandler
1719 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1721 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1725 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1728 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1732 CHIP_ERROR err = self.cppCluster.ReadAttributeProductId(onSuccess->Cancel(), onFailure->Cancel());
1733 if (err != CHIP_NO_ERROR) {
1736 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1740 - (void)readAttributeApplicationId:(ResponseHandler)completionHandler
1742 CHIPStringAttributeCallbackBridge * onSuccess
1743 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
1745 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1749 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1752 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1756 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationId(onSuccess->Cancel(), onFailure->Cancel());
1757 if (err != CHIP_NO_ERROR) {
1760 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1764 - (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler
1766 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1768 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1772 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1775 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1779 CHIP_ERROR err = self.cppCluster.ReadAttributeCatalogVendorId(onSuccess->Cancel(), onFailure->Cancel());
1780 if (err != CHIP_NO_ERROR) {
1783 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1787 - (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler
1789 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1791 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1795 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1798 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1802 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationSatus(onSuccess->Cancel(), onFailure->Cancel());
1803 if (err != CHIP_NO_ERROR) {
1806 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1810 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
1812 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1814 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1818 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1821 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1825 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
1826 if (err != CHIP_NO_ERROR) {
1829 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1835 @interface CHIPBarrierControl ()
1836 @property (readonly) Controller::BarrierControlCluster cppCluster;
1839 @implementation CHIPBarrierControl
1841 - (Controller::ClusterBase *)getCluster
1843 return &_cppCluster;
1846 - (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler
1848 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1850 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1854 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1857 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1861 CHIP_ERROR err = self.cppCluster.BarrierControlGoToPercent(onSuccess->Cancel(), onFailure->Cancel(), percentOpen);
1862 if (err != CHIP_NO_ERROR) {
1865 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1868 - (void)barrierControlStop:(ResponseHandler)completionHandler
1870 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1872 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1876 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1879 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1883 CHIP_ERROR err = self.cppCluster.BarrierControlStop(onSuccess->Cancel(), onFailure->Cancel());
1884 if (err != CHIP_NO_ERROR) {
1887 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1891 - (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler
1893 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1895 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1899 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1902 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1906 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierMovingState(onSuccess->Cancel(), onFailure->Cancel());
1907 if (err != CHIP_NO_ERROR) {
1910 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1914 - (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler
1916 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1918 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1922 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1925 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1929 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierSafetyStatus(onSuccess->Cancel(), onFailure->Cancel());
1930 if (err != CHIP_NO_ERROR) {
1933 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1937 - (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler
1939 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1941 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1945 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1948 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1952 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierCapabilities(onSuccess->Cancel(), onFailure->Cancel());
1953 if (err != CHIP_NO_ERROR) {
1956 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1960 - (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler
1962 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1964 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1968 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1971 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1975 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierPosition(onSuccess->Cancel(), onFailure->Cancel());
1976 if (err != CHIP_NO_ERROR) {
1979 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1983 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
1985 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1987 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1991 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1994 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1998 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
1999 if (err != CHIP_NO_ERROR) {
2002 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2008 @interface CHIPBasic ()
2009 @property (readonly) Controller::BasicCluster cppCluster;
2012 @implementation CHIPBasic
2014 - (Controller::ClusterBase *)getCluster
2016 return &_cppCluster;
2019 - (void)mfgSpecificPing:(ResponseHandler)completionHandler
2021 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2023 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2027 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2030 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2034 CHIP_ERROR err = self.cppCluster.MfgSpecificPing(onSuccess->Cancel(), onFailure->Cancel());
2035 if (err != CHIP_NO_ERROR) {
2038 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2042 - (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler
2044 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2046 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2050 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2053 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2057 CHIP_ERROR err = self.cppCluster.ReadAttributeInteractionModelVersion(onSuccess->Cancel(), onFailure->Cancel());
2058 if (err != CHIP_NO_ERROR) {
2061 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2065 - (void)readAttributeVendorName:(ResponseHandler)completionHandler
2067 CHIPStringAttributeCallbackBridge * onSuccess
2068 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
2070 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2074 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2077 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2081 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
2082 if (err != CHIP_NO_ERROR) {
2085 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2089 - (void)readAttributeVendorID:(ResponseHandler)completionHandler
2091 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2093 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2097 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2100 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2104 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel());
2105 if (err != CHIP_NO_ERROR) {
2108 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2112 - (void)readAttributeProductName:(ResponseHandler)completionHandler
2114 CHIPStringAttributeCallbackBridge * onSuccess
2115 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
2117 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2121 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2124 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2128 CHIP_ERROR err = self.cppCluster.ReadAttributeProductName(onSuccess->Cancel(), onFailure->Cancel());
2129 if (err != CHIP_NO_ERROR) {
2132 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2136 - (void)readAttributeProductID:(ResponseHandler)completionHandler
2138 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2140 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2144 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2147 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2151 CHIP_ERROR err = self.cppCluster.ReadAttributeProductID(onSuccess->Cancel(), onFailure->Cancel());
2152 if (err != CHIP_NO_ERROR) {
2155 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2159 - (void)readAttributeUserLabel:(ResponseHandler)completionHandler
2161 CHIPStringAttributeCallbackBridge * onSuccess
2162 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
2164 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2168 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2171 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2175 CHIP_ERROR err = self.cppCluster.ReadAttributeUserLabel(onSuccess->Cancel(), onFailure->Cancel());
2176 if (err != CHIP_NO_ERROR) {
2179 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2183 - (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler
2185 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2187 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2191 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2194 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2198 NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
2199 CHIP_ERROR err = self.cppCluster.WriteAttributeUserLabel(
2200 onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
2201 if (err != CHIP_NO_ERROR) {
2204 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2208 - (void)readAttributeLocation:(ResponseHandler)completionHandler
2210 CHIPStringAttributeCallbackBridge * onSuccess
2211 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
2213 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2217 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2220 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2224 CHIP_ERROR err = self.cppCluster.ReadAttributeLocation(onSuccess->Cancel(), onFailure->Cancel());
2225 if (err != CHIP_NO_ERROR) {
2228 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2232 - (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler
2234 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2236 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2240 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2243 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2247 NSData * data = [value dataUsingEncoding:NSUTF8StringEncoding];
2248 CHIP_ERROR err = self.cppCluster.WriteAttributeLocation(
2249 onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) data.bytes, data.length));
2250 if (err != CHIP_NO_ERROR) {
2253 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2257 - (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler
2259 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2261 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2265 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2268 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2272 CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel());
2273 if (err != CHIP_NO_ERROR) {
2276 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2280 - (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler
2282 CHIPStringAttributeCallbackBridge * onSuccess
2283 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
2285 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2289 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2292 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2296 CHIP_ERROR err = self.cppCluster.ReadAttributeHardwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
2297 if (err != CHIP_NO_ERROR) {
2300 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2304 - (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler
2306 CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2308 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2312 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2315 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2319 CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel());
2320 if (err != CHIP_NO_ERROR) {
2323 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2327 - (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler
2329 CHIPStringAttributeCallbackBridge * onSuccess
2330 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
2332 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2336 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2339 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2343 CHIP_ERROR err = self.cppCluster.ReadAttributeSoftwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
2344 if (err != CHIP_NO_ERROR) {
2347 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2351 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
2353 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2355 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2359 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2362 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2366 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
2367 if (err != CHIP_NO_ERROR) {
2370 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2376 @interface CHIPBinding ()
2377 @property (readonly) Controller::BindingCluster cppCluster;
2380 @implementation CHIPBinding
2382 - (Controller::ClusterBase *)getCluster
2384 return &_cppCluster;
2387 - (void)bind:(uint64_t)nodeId
2388 groupId:(uint16_t)groupId
2389 endpointId:(uint8_t)endpointId
2390 clusterId:(uint16_t)clusterId
2391 completionHandler:(ResponseHandler)completionHandler
2393 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2395 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2399 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2402 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2406 CHIP_ERROR err = self.cppCluster.Bind(onSuccess->Cancel(), onFailure->Cancel(), nodeId, groupId, endpointId, clusterId);
2407 if (err != CHIP_NO_ERROR) {
2410 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2413 - (void)unbind:(uint64_t)nodeId
2414 groupId:(uint16_t)groupId
2415 endpointId:(uint8_t)endpointId
2416 clusterId:(uint16_t)clusterId
2417 completionHandler:(ResponseHandler)completionHandler
2419 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2421 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2425 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2428 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2432 CHIP_ERROR err = self.cppCluster.Unbind(onSuccess->Cancel(), onFailure->Cancel(), nodeId, groupId, endpointId, clusterId);
2433 if (err != CHIP_NO_ERROR) {
2436 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2440 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
2442 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2444 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2448 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2451 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2455 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
2456 if (err != CHIP_NO_ERROR) {
2459 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2465 @interface CHIPColorControl ()
2466 @property (readonly) Controller::ColorControlCluster cppCluster;
2469 @implementation CHIPColorControl
2471 - (Controller::ClusterBase *)getCluster
2473 return &_cppCluster;
2476 - (void)moveColor:(int16_t)rateX
2477 rateY:(int16_t)rateY
2478 optionsMask:(uint8_t)optionsMask
2479 optionsOverride:(uint8_t)optionsOverride
2480 completionHandler:(ResponseHandler)completionHandler
2482 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2484 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2488 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2491 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2496 = self.cppCluster.MoveColor(onSuccess->Cancel(), onFailure->Cancel(), rateX, rateY, optionsMask, optionsOverride);
2497 if (err != CHIP_NO_ERROR) {
2500 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2503 - (void)moveColorTemperature:(uint8_t)moveMode
2505 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
2506 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
2507 optionsMask:(uint8_t)optionsMask
2508 optionsOverride:(uint8_t)optionsOverride
2509 completionHandler:(ResponseHandler)completionHandler
2511 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2513 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2517 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2520 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2524 CHIP_ERROR err = self.cppCluster.MoveColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate,
2525 colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
2526 if (err != CHIP_NO_ERROR) {
2529 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2532 - (void)moveHue:(uint8_t)moveMode
2534 optionsMask:(uint8_t)optionsMask
2535 optionsOverride:(uint8_t)optionsOverride
2536 completionHandler:(ResponseHandler)completionHandler
2538 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(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);
2552 = self.cppCluster.MoveHue(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
2553 if (err != CHIP_NO_ERROR) {
2556 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2559 - (void)moveSaturation:(uint8_t)moveMode
2561 optionsMask:(uint8_t)optionsMask
2562 optionsOverride:(uint8_t)optionsOverride
2563 completionHandler:(ResponseHandler)completionHandler
2565 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2567 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2571 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2574 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2579 = self.cppCluster.MoveSaturation(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
2580 if (err != CHIP_NO_ERROR) {
2583 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2586 - (void)moveToColor:(uint16_t)colorX
2587 colorY:(uint16_t)colorY
2588 transitionTime:(uint16_t)transitionTime
2589 optionsMask:(uint8_t)optionsMask
2590 optionsOverride:(uint8_t)optionsOverride
2591 completionHandler:(ResponseHandler)completionHandler
2593 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2595 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2599 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2602 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2606 CHIP_ERROR err = self.cppCluster.MoveToColor(
2607 onSuccess->Cancel(), onFailure->Cancel(), colorX, colorY, transitionTime, optionsMask, optionsOverride);
2608 if (err != CHIP_NO_ERROR) {
2611 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2614 - (void)moveToColorTemperature:(uint16_t)colorTemperature
2615 transitionTime:(uint16_t)transitionTime
2616 optionsMask:(uint8_t)optionsMask
2617 optionsOverride:(uint8_t)optionsOverride
2618 completionHandler:(ResponseHandler)completionHandler
2620 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2622 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2626 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2629 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2633 CHIP_ERROR err = self.cppCluster.MoveToColorTemperature(
2634 onSuccess->Cancel(), onFailure->Cancel(), colorTemperature, transitionTime, optionsMask, optionsOverride);
2635 if (err != CHIP_NO_ERROR) {
2638 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2641 - (void)moveToHue:(uint8_t)hue
2642 direction:(uint8_t)direction
2643 transitionTime:(uint16_t)transitionTime
2644 optionsMask:(uint8_t)optionsMask
2645 optionsOverride:(uint8_t)optionsOverride
2646 completionHandler:(ResponseHandler)completionHandler
2648 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2650 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2654 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2657 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2661 CHIP_ERROR err = self.cppCluster.MoveToHue(
2662 onSuccess->Cancel(), onFailure->Cancel(), hue, direction, transitionTime, optionsMask, optionsOverride);
2663 if (err != CHIP_NO_ERROR) {
2666 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2669 - (void)moveToHueAndSaturation:(uint8_t)hue
2670 saturation:(uint8_t)saturation
2671 transitionTime:(uint16_t)transitionTime
2672 optionsMask:(uint8_t)optionsMask
2673 optionsOverride:(uint8_t)optionsOverride
2674 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.MoveToHueAndSaturation(
2690 onSuccess->Cancel(), onFailure->Cancel(), hue, saturation, transitionTime, optionsMask, optionsOverride);
2691 if (err != CHIP_NO_ERROR) {
2694 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2697 - (void)moveToSaturation:(uint8_t)saturation
2698 transitionTime:(uint16_t)transitionTime
2699 optionsMask:(uint8_t)optionsMask
2700 optionsOverride:(uint8_t)optionsOverride
2701 completionHandler:(ResponseHandler)completionHandler
2703 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2705 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2709 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2712 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2716 CHIP_ERROR err = self.cppCluster.MoveToSaturation(
2717 onSuccess->Cancel(), onFailure->Cancel(), saturation, transitionTime, optionsMask, optionsOverride);
2718 if (err != CHIP_NO_ERROR) {
2721 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2724 - (void)stepColor:(int16_t)stepX
2725 stepY:(int16_t)stepY
2726 transitionTime:(uint16_t)transitionTime
2727 optionsMask:(uint8_t)optionsMask
2728 optionsOverride:(uint8_t)optionsOverride
2729 completionHandler:(ResponseHandler)completionHandler
2731 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2733 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2737 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2740 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2744 CHIP_ERROR err = self.cppCluster.StepColor(
2745 onSuccess->Cancel(), onFailure->Cancel(), stepX, stepY, transitionTime, optionsMask, optionsOverride);
2746 if (err != CHIP_NO_ERROR) {
2749 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2752 - (void)stepColorTemperature:(uint8_t)stepMode
2753 stepSize:(uint16_t)stepSize
2754 transitionTime:(uint16_t)transitionTime
2755 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
2756 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
2757 optionsMask:(uint8_t)optionsMask
2758 optionsOverride:(uint8_t)optionsOverride
2759 completionHandler:(ResponseHandler)completionHandler
2761 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2763 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2767 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2770 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2774 CHIP_ERROR err = self.cppCluster.StepColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize,
2775 transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
2776 if (err != CHIP_NO_ERROR) {
2779 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2782 - (void)stepHue:(uint8_t)stepMode
2783 stepSize:(uint8_t)stepSize
2784 transitionTime:(uint8_t)transitionTime
2785 optionsMask:(uint8_t)optionsMask
2786 optionsOverride:(uint8_t)optionsOverride
2787 completionHandler:(ResponseHandler)completionHandler
2789 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2791 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2795 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2798 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2802 CHIP_ERROR err = self.cppCluster.StepHue(
2803 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
2804 if (err != CHIP_NO_ERROR) {
2807 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2810 - (void)stepSaturation:(uint8_t)stepMode
2811 stepSize:(uint8_t)stepSize
2812 transitionTime:(uint8_t)transitionTime
2813 optionsMask:(uint8_t)optionsMask
2814 optionsOverride:(uint8_t)optionsOverride
2815 completionHandler:(ResponseHandler)completionHandler
2817 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2819 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2823 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2826 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2830 CHIP_ERROR err = self.cppCluster.StepSaturation(
2831 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
2832 if (err != CHIP_NO_ERROR) {
2835 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2838 - (void)stopMoveStep:(uint8_t)optionsMask
2839 optionsOverride:(uint8_t)optionsOverride
2840 completionHandler:(ResponseHandler)completionHandler
2842 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2844 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2848 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2851 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2855 CHIP_ERROR err = self.cppCluster.StopMoveStep(onSuccess->Cancel(), onFailure->Cancel(), optionsMask, optionsOverride);
2856 if (err != CHIP_NO_ERROR) {
2859 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2863 - (void)readAttributeCurrentHue:(ResponseHandler)completionHandler
2865 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2867 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2871 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2874 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2878 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
2879 if (err != CHIP_NO_ERROR) {
2882 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2886 - (void)configureAttributeCurrentHue:(uint16_t)minInterval
2887 maxInterval:(uint16_t)maxInterval
2888 change:(uint8_t)change
2889 completionHandler:(ResponseHandler)completionHandler
2891 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2893 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2897 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2900 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2905 = self.cppCluster.ConfigureAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
2906 if (err != CHIP_NO_ERROR) {
2909 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2913 - (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler
2915 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
2917 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2921 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentHue(onReport->Cancel());
2922 if (err != CHIP_NO_ERROR) {
2924 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
2928 - (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler
2930 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2932 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2936 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2939 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2943 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentSaturation(onSuccess->Cancel(), onFailure->Cancel());
2944 if (err != CHIP_NO_ERROR) {
2947 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2951 - (void)configureAttributeCurrentSaturation:(uint16_t)minInterval
2952 maxInterval:(uint16_t)maxInterval
2953 change:(uint8_t)change
2954 completionHandler:(ResponseHandler)completionHandler
2956 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2958 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2962 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2965 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2969 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentSaturation(
2970 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
2971 if (err != CHIP_NO_ERROR) {
2974 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2978 - (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler
2980 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
2982 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2986 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentSaturation(onReport->Cancel());
2987 if (err != CHIP_NO_ERROR) {
2989 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
2993 - (void)readAttributeRemainingTime:(ResponseHandler)completionHandler
2995 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2997 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3001 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3004 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3008 CHIP_ERROR err = self.cppCluster.ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel());
3009 if (err != CHIP_NO_ERROR) {
3012 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3016 - (void)readAttributeCurrentX:(ResponseHandler)completionHandler
3018 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3020 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3024 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3027 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3031 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel());
3032 if (err != CHIP_NO_ERROR) {
3035 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3039 - (void)configureAttributeCurrentX:(uint16_t)minInterval
3040 maxInterval:(uint16_t)maxInterval
3041 change:(uint16_t)change
3042 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);
3058 = self.cppCluster.ConfigureAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
3059 if (err != CHIP_NO_ERROR) {
3062 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3066 - (void)reportAttributeCurrentX:(ResponseHandler)reportHandler
3068 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
3070 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3074 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentX(onReport->Cancel());
3075 if (err != CHIP_NO_ERROR) {
3077 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
3081 - (void)readAttributeCurrentY:(ResponseHandler)completionHandler
3083 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3085 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3089 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3092 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3096 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel());
3097 if (err != CHIP_NO_ERROR) {
3100 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3104 - (void)configureAttributeCurrentY:(uint16_t)minInterval
3105 maxInterval:(uint16_t)maxInterval
3106 change:(uint16_t)change
3107 completionHandler:(ResponseHandler)completionHandler
3109 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3111 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3115 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3118 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3123 = self.cppCluster.ConfigureAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
3124 if (err != CHIP_NO_ERROR) {
3127 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3131 - (void)reportAttributeCurrentY:(ResponseHandler)reportHandler
3133 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
3135 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3139 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentY(onReport->Cancel());
3140 if (err != CHIP_NO_ERROR) {
3142 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
3146 - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler
3148 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3150 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3154 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3157 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3161 CHIP_ERROR err = self.cppCluster.ReadAttributeDriftCompensation(onSuccess->Cancel(), onFailure->Cancel());
3162 if (err != CHIP_NO_ERROR) {
3165 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3169 - (void)readAttributeCompensationText:(ResponseHandler)completionHandler
3171 CHIPStringAttributeCallbackBridge * onSuccess
3172 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false);
3174 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3178 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3181 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3185 CHIP_ERROR err = self.cppCluster.ReadAttributeCompensationText(onSuccess->Cancel(), onFailure->Cancel());
3186 if (err != CHIP_NO_ERROR) {
3189 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3193 - (void)readAttributeColorTemperature:(ResponseHandler)completionHandler
3195 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3197 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3201 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3204 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3208 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTemperature(onSuccess->Cancel(), onFailure->Cancel());
3209 if (err != CHIP_NO_ERROR) {
3212 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3216 - (void)configureAttributeColorTemperature:(uint16_t)minInterval
3217 maxInterval:(uint16_t)maxInterval
3218 change:(uint16_t)change
3219 completionHandler:(ResponseHandler)completionHandler
3221 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3223 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3227 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3230 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3234 CHIP_ERROR err = self.cppCluster.ConfigureAttributeColorTemperature(
3235 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
3236 if (err != CHIP_NO_ERROR) {
3239 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3243 - (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler
3245 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
3247 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3251 CHIP_ERROR err = self.cppCluster.ReportAttributeColorTemperature(onReport->Cancel());
3252 if (err != CHIP_NO_ERROR) {
3254 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
3258 - (void)readAttributeColorMode:(ResponseHandler)completionHandler
3260 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3262 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3266 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3269 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3273 CHIP_ERROR err = self.cppCluster.ReadAttributeColorMode(onSuccess->Cancel(), onFailure->Cancel());
3274 if (err != CHIP_NO_ERROR) {
3277 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3281 - (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler
3283 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3285 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3289 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3292 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3296 CHIP_ERROR err = self.cppCluster.ReadAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel());
3297 if (err != CHIP_NO_ERROR) {
3300 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3304 - (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
3306 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3308 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3312 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3315 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3319 CHIP_ERROR err = self.cppCluster.WriteAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel(), value);
3320 if (err != CHIP_NO_ERROR) {
3323 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3327 - (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler
3329 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3331 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3335 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3338 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3342 CHIP_ERROR err = self.cppCluster.ReadAttributeNumberOfPrimaries(onSuccess->Cancel(), onFailure->Cancel());
3343 if (err != CHIP_NO_ERROR) {
3346 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3350 - (void)readAttributePrimary1X:(ResponseHandler)completionHandler
3352 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3354 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3358 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3361 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3365 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1X(onSuccess->Cancel(), onFailure->Cancel());
3366 if (err != CHIP_NO_ERROR) {
3369 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3373 - (void)readAttributePrimary1Y:(ResponseHandler)completionHandler
3375 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3377 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3381 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3384 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3388 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Y(onSuccess->Cancel(), onFailure->Cancel());
3389 if (err != CHIP_NO_ERROR) {
3392 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3396 - (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler
3398 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3400 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3404 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3407 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3411 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Intensity(onSuccess->Cancel(), onFailure->Cancel());
3412 if (err != CHIP_NO_ERROR) {
3415 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3419 - (void)readAttributePrimary2X:(ResponseHandler)completionHandler
3421 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3423 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3427 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3430 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3434 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2X(onSuccess->Cancel(), onFailure->Cancel());
3435 if (err != CHIP_NO_ERROR) {
3438 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3442 - (void)readAttributePrimary2Y:(ResponseHandler)completionHandler
3444 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3446 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3450 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3453 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3457 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Y(onSuccess->Cancel(), onFailure->Cancel());
3458 if (err != CHIP_NO_ERROR) {
3461 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3465 - (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler
3467 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3469 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3473 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3476 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3480 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Intensity(onSuccess->Cancel(), onFailure->Cancel());
3481 if (err != CHIP_NO_ERROR) {
3484 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3488 - (void)readAttributePrimary3X:(ResponseHandler)completionHandler
3490 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3492 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3496 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3499 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3503 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3X(onSuccess->Cancel(), onFailure->Cancel());
3504 if (err != CHIP_NO_ERROR) {
3507 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3511 - (void)readAttributePrimary3Y:(ResponseHandler)completionHandler
3513 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3515 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3519 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3522 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3526 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Y(onSuccess->Cancel(), onFailure->Cancel());
3527 if (err != CHIP_NO_ERROR) {
3530 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3534 - (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler
3536 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3538 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3542 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3545 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3549 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Intensity(onSuccess->Cancel(), onFailure->Cancel());
3550 if (err != CHIP_NO_ERROR) {
3553 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3557 - (void)readAttributePrimary4X:(ResponseHandler)completionHandler
3559 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3561 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3565 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3568 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3572 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4X(onSuccess->Cancel(), onFailure->Cancel());
3573 if (err != CHIP_NO_ERROR) {
3576 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3580 - (void)readAttributePrimary4Y:(ResponseHandler)completionHandler
3582 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3584 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3588 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3591 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3595 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Y(onSuccess->Cancel(), onFailure->Cancel());
3596 if (err != CHIP_NO_ERROR) {
3599 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3603 - (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler
3605 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3607 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3611 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3614 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3618 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Intensity(onSuccess->Cancel(), onFailure->Cancel());
3619 if (err != CHIP_NO_ERROR) {
3622 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3626 - (void)readAttributePrimary5X:(ResponseHandler)completionHandler
3628 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3630 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3634 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3637 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3641 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5X(onSuccess->Cancel(), onFailure->Cancel());
3642 if (err != CHIP_NO_ERROR) {
3645 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3649 - (void)readAttributePrimary5Y:(ResponseHandler)completionHandler
3651 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3653 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3657 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3660 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3664 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Y(onSuccess->Cancel(), onFailure->Cancel());
3665 if (err != CHIP_NO_ERROR) {
3668 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3672 - (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler
3674 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3676 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3680 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3683 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3687 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Intensity(onSuccess->Cancel(), onFailure->Cancel());
3688 if (err != CHIP_NO_ERROR) {
3691 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3695 - (void)readAttributePrimary6X:(ResponseHandler)completionHandler
3697 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3699 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3703 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3706 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3710 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6X(onSuccess->Cancel(), onFailure->Cancel());
3711 if (err != CHIP_NO_ERROR) {
3714 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3718 - (void)readAttributePrimary6Y:(ResponseHandler)completionHandler
3720 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3722 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3726 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3729 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3733 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Y(onSuccess->Cancel(), onFailure->Cancel());
3734 if (err != CHIP_NO_ERROR) {
3737 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3741 - (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler
3743 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3745 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3749 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3752 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3756 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Intensity(onSuccess->Cancel(), onFailure->Cancel());
3757 if (err != CHIP_NO_ERROR) {
3760 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3764 - (void)readAttributeWhitePointX:(ResponseHandler)completionHandler
3766 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(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.ReadAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel());
3780 if (err != CHIP_NO_ERROR) {
3783 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3787 - (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3789 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(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.WriteAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel(), value);
3803 if (err != CHIP_NO_ERROR) {
3806 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3810 - (void)readAttributeWhitePointY:(ResponseHandler)completionHandler
3812 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3814 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3818 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3821 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3825 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel());
3826 if (err != CHIP_NO_ERROR) {
3829 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3833 - (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3835 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3837 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3841 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3844 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3848 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel(), value);
3849 if (err != CHIP_NO_ERROR) {
3852 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3856 - (void)readAttributeColorPointRX:(ResponseHandler)completionHandler
3858 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3860 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3864 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3867 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3871 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel());
3872 if (err != CHIP_NO_ERROR) {
3875 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3879 - (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3881 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3883 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3887 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3890 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3894 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel(), value);
3895 if (err != CHIP_NO_ERROR) {
3898 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3902 - (void)readAttributeColorPointRY:(ResponseHandler)completionHandler
3904 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3906 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3910 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3913 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3917 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel());
3918 if (err != CHIP_NO_ERROR) {
3921 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3925 - (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3927 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3929 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3933 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3936 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3940 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel(), value);
3941 if (err != CHIP_NO_ERROR) {
3944 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3948 - (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler
3950 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3952 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3956 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3959 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3963 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel());
3964 if (err != CHIP_NO_ERROR) {
3967 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3971 - (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
3973 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3975 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3979 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3982 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3986 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
3987 if (err != CHIP_NO_ERROR) {
3990 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3994 - (void)readAttributeColorPointGX:(ResponseHandler)completionHandler
3996 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3998 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4002 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4005 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4009 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel());
4010 if (err != CHIP_NO_ERROR) {
4013 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4017 - (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4019 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4021 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4025 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4028 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4032 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel(), value);
4033 if (err != CHIP_NO_ERROR) {
4036 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4040 - (void)readAttributeColorPointGY:(ResponseHandler)completionHandler
4042 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4044 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4048 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4051 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4055 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel());
4056 if (err != CHIP_NO_ERROR) {
4059 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4063 - (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4065 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4067 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4071 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4074 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4078 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel(), value);
4079 if (err != CHIP_NO_ERROR) {
4082 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4086 - (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler
4088 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4090 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4094 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4097 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4101 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel());
4102 if (err != CHIP_NO_ERROR) {
4105 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4109 - (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
4111 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4113 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4117 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4120 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4124 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
4125 if (err != CHIP_NO_ERROR) {
4128 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4132 - (void)readAttributeColorPointBX:(ResponseHandler)completionHandler
4134 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4136 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4140 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4143 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4147 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel());
4148 if (err != CHIP_NO_ERROR) {
4151 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4155 - (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4157 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4159 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4163 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4166 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4170 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel(), value);
4171 if (err != CHIP_NO_ERROR) {
4174 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4178 - (void)readAttributeColorPointBY:(ResponseHandler)completionHandler
4180 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4182 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4186 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4189 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4193 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel());
4194 if (err != CHIP_NO_ERROR) {
4197 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4201 - (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4203 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4205 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4209 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4212 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4216 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel(), value);
4217 if (err != CHIP_NO_ERROR) {
4220 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4224 - (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler
4226 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4228 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4232 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4235 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4239 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel());
4240 if (err != CHIP_NO_ERROR) {
4243 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4247 - (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
4249 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4251 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4255 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4258 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4262 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
4263 if (err != CHIP_NO_ERROR) {
4266 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4270 - (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler
4272 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4274 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4278 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4281 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4285 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
4286 if (err != CHIP_NO_ERROR) {
4289 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4293 - (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler
4295 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4297 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4301 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4304 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4308 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedColorMode(onSuccess->Cancel(), onFailure->Cancel());
4309 if (err != CHIP_NO_ERROR) {
4312 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4316 - (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler
4318 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4320 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4324 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4327 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4331 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopActive(onSuccess->Cancel(), onFailure->Cancel());
4332 if (err != CHIP_NO_ERROR) {
4335 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4339 - (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler
4341 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4343 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4347 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4350 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4354 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopDirection(onSuccess->Cancel(), onFailure->Cancel());
4355 if (err != CHIP_NO_ERROR) {
4358 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4362 - (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler
4364 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4366 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4370 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4373 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4377 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopTime(onSuccess->Cancel(), onFailure->Cancel());
4378 if (err != CHIP_NO_ERROR) {
4381 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4385 - (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler
4387 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4389 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4393 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4396 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4400 CHIP_ERROR err = self.cppCluster.ReadAttributeColorCapabilities(onSuccess->Cancel(), onFailure->Cancel());
4401 if (err != CHIP_NO_ERROR) {
4404 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4408 - (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler
4410 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4412 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4416 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4419 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4423 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMin(onSuccess->Cancel(), onFailure->Cancel());
4424 if (err != CHIP_NO_ERROR) {
4427 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4431 - (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler
4433 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4435 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4439 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4442 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4446 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMax(onSuccess->Cancel(), onFailure->Cancel());
4447 if (err != CHIP_NO_ERROR) {
4450 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4454 - (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler
4456 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4458 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4462 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4465 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4469 CHIP_ERROR err = self.cppCluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccess->Cancel(), onFailure->Cancel());
4470 if (err != CHIP_NO_ERROR) {
4473 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4477 - (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler
4479 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4481 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4485 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4488 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4492 CHIP_ERROR err = self.cppCluster.ReadAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel());
4493 if (err != CHIP_NO_ERROR) {
4496 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4500 - (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4502 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4504 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4508 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4511 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4515 CHIP_ERROR err = self.cppCluster.WriteAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel(), value);
4516 if (err != CHIP_NO_ERROR) {
4519 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4523 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4525 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4527 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4531 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4534 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4538 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4539 if (err != CHIP_NO_ERROR) {
4542 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4548 @interface CHIPContentLaunch ()
4549 @property (readonly) Controller::ContentLaunchCluster cppCluster;
4552 @implementation CHIPContentLaunch
4554 - (Controller::ClusterBase *)getCluster
4556 return &_cppCluster;
4559 - (void)launchContent:(ResponseHandler)completionHandler
4561 CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * onSuccess
4562 = new CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(completionHandler, [self callbackQueue]);
4564 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4568 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4571 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4575 CHIP_ERROR err = self.cppCluster.LaunchContent(onSuccess->Cancel(), onFailure->Cancel());
4576 if (err != CHIP_NO_ERROR) {
4579 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4582 - (void)launchURL:(ResponseHandler)completionHandler
4584 CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * onSuccess
4585 = new CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(completionHandler, [self callbackQueue]);
4587 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4591 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4594 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4598 CHIP_ERROR err = self.cppCluster.LaunchURL(onSuccess->Cancel(), onFailure->Cancel());
4599 if (err != CHIP_NO_ERROR) {
4602 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4606 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4608 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4610 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4614 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4617 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4621 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4622 if (err != CHIP_NO_ERROR) {
4625 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4631 @interface CHIPDoorLock ()
4632 @property (readonly) Controller::DoorLockCluster cppCluster;
4635 @implementation CHIPDoorLock
4637 - (Controller::ClusterBase *)getCluster
4639 return &_cppCluster;
4642 - (void)clearAllPins:(ResponseHandler)completionHandler
4644 CHIPDoorLockClusterClearAllPinsResponseCallbackBridge * onSuccess
4645 = new CHIPDoorLockClusterClearAllPinsResponseCallbackBridge(completionHandler, [self callbackQueue]);
4647 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4651 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4654 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4658 CHIP_ERROR err = self.cppCluster.ClearAllPins(onSuccess->Cancel(), onFailure->Cancel());
4659 if (err != CHIP_NO_ERROR) {
4662 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4665 - (void)clearAllRfids:(ResponseHandler)completionHandler
4667 CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge * onSuccess
4668 = new CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge(completionHandler, [self callbackQueue]);
4670 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4674 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4677 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4681 CHIP_ERROR err = self.cppCluster.ClearAllRfids(onSuccess->Cancel(), onFailure->Cancel());
4682 if (err != CHIP_NO_ERROR) {
4685 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4688 - (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
4690 CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge * onSuccess
4691 = new CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4693 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4697 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4700 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4704 CHIP_ERROR err = self.cppCluster.ClearHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
4705 if (err != CHIP_NO_ERROR) {
4708 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4711 - (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4713 CHIPDoorLockClusterClearPinResponseCallbackBridge * onSuccess
4714 = new CHIPDoorLockClusterClearPinResponseCallbackBridge(completionHandler, [self callbackQueue]);
4716 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4720 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4723 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4727 CHIP_ERROR err = self.cppCluster.ClearPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
4728 if (err != CHIP_NO_ERROR) {
4731 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4734 - (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4736 CHIPDoorLockClusterClearRfidResponseCallbackBridge * onSuccess
4737 = new CHIPDoorLockClusterClearRfidResponseCallbackBridge(completionHandler, [self callbackQueue]);
4739 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4743 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4746 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4750 CHIP_ERROR err = self.cppCluster.ClearRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
4751 if (err != CHIP_NO_ERROR) {
4754 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4757 - (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4759 CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge * onSuccess
4760 = new CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4762 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4766 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4769 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4773 CHIP_ERROR err = self.cppCluster.ClearWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
4774 if (err != CHIP_NO_ERROR) {
4777 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4780 - (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4782 CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge * onSuccess
4783 = new CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4785 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4789 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4792 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4796 CHIP_ERROR err = self.cppCluster.ClearYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
4797 if (err != CHIP_NO_ERROR) {
4800 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4803 - (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
4805 CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge * onSuccess
4806 = new CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4808 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4812 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4815 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4819 CHIP_ERROR err = self.cppCluster.GetHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
4820 if (err != CHIP_NO_ERROR) {
4823 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4826 - (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler
4828 CHIPDoorLockClusterGetLogRecordResponseCallbackBridge * onSuccess
4829 = new CHIPDoorLockClusterGetLogRecordResponseCallbackBridge(completionHandler, [self callbackQueue]);
4831 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4835 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4838 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4842 CHIP_ERROR err = self.cppCluster.GetLogRecord(onSuccess->Cancel(), onFailure->Cancel(), logIndex);
4843 if (err != CHIP_NO_ERROR) {
4846 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4849 - (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4851 CHIPDoorLockClusterGetPinResponseCallbackBridge * onSuccess
4852 = new CHIPDoorLockClusterGetPinResponseCallbackBridge(completionHandler, [self callbackQueue]);
4854 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4858 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4861 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4865 CHIP_ERROR err = self.cppCluster.GetPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
4866 if (err != CHIP_NO_ERROR) {
4869 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4872 - (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4874 CHIPDoorLockClusterGetRfidResponseCallbackBridge * onSuccess
4875 = new CHIPDoorLockClusterGetRfidResponseCallbackBridge(completionHandler, [self callbackQueue]);
4877 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4881 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4884 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4888 CHIP_ERROR err = self.cppCluster.GetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
4889 if (err != CHIP_NO_ERROR) {
4892 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4895 - (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4897 CHIPDoorLockClusterGetUserTypeResponseCallbackBridge * onSuccess
4898 = new CHIPDoorLockClusterGetUserTypeResponseCallbackBridge(completionHandler, [self callbackQueue]);
4900 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4904 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4907 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4911 CHIP_ERROR err = self.cppCluster.GetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId);
4912 if (err != CHIP_NO_ERROR) {
4915 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4918 - (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4920 CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge * onSuccess
4921 = new CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4923 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4927 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4930 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4934 CHIP_ERROR err = self.cppCluster.GetWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
4935 if (err != CHIP_NO_ERROR) {
4938 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4941 - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4943 CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge * onSuccess
4944 = new CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4946 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4950 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4953 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4957 CHIP_ERROR err = self.cppCluster.GetYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
4958 if (err != CHIP_NO_ERROR) {
4961 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4964 - (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
4966 CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess
4967 = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
4969 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4973 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4976 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4980 CHIP_ERROR err = self.cppCluster.LockDoor(onSuccess->Cancel(), onFailure->Cancel(),
4981 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
4982 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
4983 if (err != CHIP_NO_ERROR) {
4986 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4989 - (void)setHolidaySchedule:(uint8_t)scheduleId
4990 localStartTime:(uint32_t)localStartTime
4991 localEndTime:(uint32_t)localEndTime
4992 operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday
4993 completionHandler:(ResponseHandler)completionHandler
4995 CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge * onSuccess
4996 = new CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4998 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5002 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5005 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5009 CHIP_ERROR err = self.cppCluster.SetHolidaySchedule(
5010 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, localStartTime, localEndTime, operatingModeDuringHoliday);
5011 if (err != CHIP_NO_ERROR) {
5014 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5017 - (void)setPin:(uint16_t)userId
5018 userStatus:(uint8_t)userStatus
5019 userType:(uint8_t)userType
5021 completionHandler:(ResponseHandler)completionHandler
5023 CHIPDoorLockClusterSetPinResponseCallbackBridge * onSuccess
5024 = new CHIPDoorLockClusterSetPinResponseCallbackBridge(completionHandler, [self callbackQueue]);
5026 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5030 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5033 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5037 CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
5038 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
5039 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
5040 if (err != CHIP_NO_ERROR) {
5043 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5046 - (void)setRfid:(uint16_t)userId
5047 userStatus:(uint8_t)userStatus
5048 userType:(uint8_t)userType
5050 completionHandler:(ResponseHandler)completionHandler
5052 CHIPDoorLockClusterSetRfidResponseCallbackBridge * onSuccess
5053 = new CHIPDoorLockClusterSetRfidResponseCallbackBridge(completionHandler, [self callbackQueue]);
5055 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5059 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5062 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5066 CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType,
5067 chip::ByteSpan((const uint8_t *) [id dataUsingEncoding:NSUTF8StringEncoding].bytes,
5068 [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
5069 if (err != CHIP_NO_ERROR) {
5072 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5075 - (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler
5077 CHIPDoorLockClusterSetUserTypeResponseCallbackBridge * onSuccess
5078 = new CHIPDoorLockClusterSetUserTypeResponseCallbackBridge(completionHandler, [self callbackQueue]);
5080 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5084 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5087 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5091 CHIP_ERROR err = self.cppCluster.SetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId, userType);
5092 if (err != CHIP_NO_ERROR) {
5095 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5098 - (void)setWeekdaySchedule:(uint8_t)scheduleId
5099 userId:(uint16_t)userId
5100 daysMask:(uint8_t)daysMask
5101 startHour:(uint8_t)startHour
5102 startMinute:(uint8_t)startMinute
5103 endHour:(uint8_t)endHour
5104 endMinute:(uint8_t)endMinute
5105 completionHandler:(ResponseHandler)completionHandler
5107 CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge * onSuccess
5108 = new CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
5110 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5114 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5117 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5121 CHIP_ERROR err = self.cppCluster.SetWeekdaySchedule(
5122 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, daysMask, startHour, startMinute, endHour, endMinute);
5123 if (err != CHIP_NO_ERROR) {
5126 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5129 - (void)setYeardaySchedule:(uint8_t)scheduleId
5130 userId:(uint16_t)userId
5131 localStartTime:(uint32_t)localStartTime
5132 localEndTime:(uint32_t)localEndTime
5133 completionHandler:(ResponseHandler)completionHandler
5135 CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge * onSuccess
5136 = new CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
5138 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5142 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5145 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5149 CHIP_ERROR err = self.cppCluster.SetYeardaySchedule(
5150 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, localStartTime, localEndTime);
5151 if (err != CHIP_NO_ERROR) {
5154 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5157 - (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
5159 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess
5160 = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
5162 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5166 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5169 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5173 CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(),
5174 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
5175 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
5176 if (err != CHIP_NO_ERROR) {
5179 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5182 - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler
5184 CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge * onSuccess
5185 = new CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(completionHandler, [self callbackQueue]);
5187 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5191 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5194 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5198 CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds,
5199 chip::ByteSpan((const uint8_t *) [pin dataUsingEncoding:NSUTF8StringEncoding].bytes,
5200 [pin lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
5201 if (err != CHIP_NO_ERROR) {
5204 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5208 - (void)readAttributeLockState:(ResponseHandler)completionHandler
5210 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5212 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5216 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5219 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5223 CHIP_ERROR err = self.cppCluster.ReadAttributeLockState(onSuccess->Cancel(), onFailure->Cancel());
5224 if (err != CHIP_NO_ERROR) {
5227 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5231 - (void)configureAttributeLockState:(uint16_t)minInterval
5232 maxInterval:(uint16_t)maxInterval
5233 completionHandler:(ResponseHandler)completionHandler
5235 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5237 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5241 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5244 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5249 = self.cppCluster.ConfigureAttributeLockState(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
5250 if (err != CHIP_NO_ERROR) {
5253 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5257 - (void)reportAttributeLockState:(ResponseHandler)reportHandler
5259 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
5261 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5265 CHIP_ERROR err = self.cppCluster.ReportAttributeLockState(onReport->Cancel());
5266 if (err != CHIP_NO_ERROR) {
5268 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
5272 - (void)readAttributeLockType:(ResponseHandler)completionHandler
5274 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5276 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5280 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5283 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5287 CHIP_ERROR err = self.cppCluster.ReadAttributeLockType(onSuccess->Cancel(), onFailure->Cancel());
5288 if (err != CHIP_NO_ERROR) {
5291 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5295 - (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler
5297 CHIPBooleanAttributeCallbackBridge * onSuccess
5298 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5300 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5304 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5307 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5311 CHIP_ERROR err = self.cppCluster.ReadAttributeActuatorEnabled(onSuccess->Cancel(), onFailure->Cancel());
5312 if (err != CHIP_NO_ERROR) {
5315 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5319 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5321 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5323 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5327 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5330 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5334 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5335 if (err != CHIP_NO_ERROR) {
5338 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5344 @interface CHIPGeneralCommissioning ()
5345 @property (readonly) Controller::GeneralCommissioningCluster cppCluster;
5348 @implementation CHIPGeneralCommissioning
5350 - (Controller::ClusterBase *)getCluster
5352 return &_cppCluster;
5355 - (void)armFailSafe:(uint16_t)expiryLengthSeconds
5356 breadcrumb:(uint64_t)breadcrumb
5357 timeoutMs:(uint32_t)timeoutMs
5358 completionHandler:(ResponseHandler)completionHandler
5360 CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge * onSuccess
5361 = new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(completionHandler, [self callbackQueue]);
5363 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5367 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5370 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5375 = self.cppCluster.ArmFailSafe(onSuccess->Cancel(), onFailure->Cancel(), expiryLengthSeconds, breadcrumb, timeoutMs);
5376 if (err != CHIP_NO_ERROR) {
5379 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5382 - (void)commissioningComplete:(ResponseHandler)completionHandler
5384 CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge * onSuccess
5385 = new CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(completionHandler, [self callbackQueue]);
5387 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5391 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5394 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5398 CHIP_ERROR err = self.cppCluster.CommissioningComplete(onSuccess->Cancel(), onFailure->Cancel());
5399 if (err != CHIP_NO_ERROR) {
5402 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5405 - (void)setFabric:(NSData *)fabricId
5406 fabricSecret:(NSData *)fabricSecret
5407 breadcrumb:(uint64_t)breadcrumb
5408 timeoutMs:(uint32_t)timeoutMs
5409 completionHandler:(ResponseHandler)completionHandler
5411 CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge * onSuccess
5412 = new CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge(completionHandler, [self callbackQueue]);
5414 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5418 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5421 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5425 CHIP_ERROR err = self.cppCluster.SetFabric(onSuccess->Cancel(), onFailure->Cancel(),
5426 chip::ByteSpan((const uint8_t *) fabricId.bytes, fabricId.length),
5427 chip::ByteSpan((const uint8_t *) fabricSecret.bytes, fabricSecret.length), breadcrumb, timeoutMs);
5428 if (err != CHIP_NO_ERROR) {
5431 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5435 - (void)readAttributeFabricId:(ResponseHandler)completionHandler
5437 CHIPStringAttributeCallbackBridge * onSuccess
5438 = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true);
5440 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5444 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5447 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5451 CHIP_ERROR err = self.cppCluster.ReadAttributeFabricId(onSuccess->Cancel(), onFailure->Cancel());
5452 if (err != CHIP_NO_ERROR) {
5455 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5459 - (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler
5461 CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5463 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5467 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5470 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5474 CHIP_ERROR err = self.cppCluster.ReadAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel());
5475 if (err != CHIP_NO_ERROR) {
5478 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5482 - (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHandler)completionHandler
5484 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5486 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5490 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5493 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5497 CHIP_ERROR err = self.cppCluster.WriteAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel(), value);
5498 if (err != CHIP_NO_ERROR) {
5501 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5505 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5507 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5509 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5513 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5516 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5520 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5521 if (err != CHIP_NO_ERROR) {
5524 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5530 @interface CHIPGroups ()
5531 @property (readonly) Controller::GroupsCluster cppCluster;
5534 @implementation CHIPGroups
5536 - (Controller::ClusterBase *)getCluster
5538 return &_cppCluster;
5541 - (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler
5543 CHIPGroupsClusterAddGroupResponseCallbackBridge * onSuccess
5544 = new CHIPGroupsClusterAddGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
5546 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5550 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5553 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5557 CHIP_ERROR err = self.cppCluster.AddGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId,
5558 chip::ByteSpan((const uint8_t *) [groupName dataUsingEncoding:NSUTF8StringEncoding].bytes,
5559 [groupName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
5560 if (err != CHIP_NO_ERROR) {
5563 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5566 - (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(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.AddGroupIfIdentifying(onSuccess->Cancel(), onFailure->Cancel(), groupId,
5582 chip::ByteSpan((const uint8_t *) [groupName dataUsingEncoding:NSUTF8StringEncoding].bytes,
5583 [groupName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
5584 if (err != CHIP_NO_ERROR) {
5587 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5590 - (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler
5592 CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge * onSuccess
5593 = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]);
5595 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5599 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5602 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5606 CHIP_ERROR err = self.cppCluster.GetGroupMembership(onSuccess->Cancel(), onFailure->Cancel(), groupCount, groupList);
5607 if (err != CHIP_NO_ERROR) {
5610 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5613 - (void)removeAllGroups:(ResponseHandler)completionHandler
5615 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5617 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5621 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5624 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5628 CHIP_ERROR err = self.cppCluster.RemoveAllGroups(onSuccess->Cancel(), onFailure->Cancel());
5629 if (err != CHIP_NO_ERROR) {
5632 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5635 - (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
5637 CHIPGroupsClusterRemoveGroupResponseCallbackBridge * onSuccess
5638 = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
5640 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5644 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5647 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5651 CHIP_ERROR err = self.cppCluster.RemoveGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId);
5652 if (err != CHIP_NO_ERROR) {
5655 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5658 - (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
5660 CHIPGroupsClusterViewGroupResponseCallbackBridge * onSuccess
5661 = new CHIPGroupsClusterViewGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
5663 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5667 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5670 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5674 CHIP_ERROR err = self.cppCluster.ViewGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId);
5675 if (err != CHIP_NO_ERROR) {
5678 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5682 - (void)readAttributeNameSupport:(ResponseHandler)completionHandler
5684 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5686 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5690 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5693 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5697 CHIP_ERROR err = self.cppCluster.ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
5698 if (err != CHIP_NO_ERROR) {
5701 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5705 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5707 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5709 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5713 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5716 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5720 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5721 if (err != CHIP_NO_ERROR) {
5724 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5730 @interface CHIPIdentify ()
5731 @property (readonly) Controller::IdentifyCluster cppCluster;
5734 @implementation CHIPIdentify
5736 - (Controller::ClusterBase *)getCluster
5738 return &_cppCluster;
5741 - (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler
5743 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5745 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5749 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5752 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5756 CHIP_ERROR err = self.cppCluster.Identify(onSuccess->Cancel(), onFailure->Cancel(), identifyTime);
5757 if (err != CHIP_NO_ERROR) {
5760 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5763 - (void)identifyQuery:(ResponseHandler)completionHandler
5765 CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge * onSuccess
5766 = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(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.IdentifyQuery(onSuccess->Cancel(), onFailure->Cancel());
5780 if (err != CHIP_NO_ERROR) {
5783 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5787 - (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler
5789 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5791 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5795 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5798 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5802 CHIP_ERROR err = self.cppCluster.ReadAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel());
5803 if (err != CHIP_NO_ERROR) {
5806 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5810 - (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
5812 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5814 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5818 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5821 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5825 CHIP_ERROR err = self.cppCluster.WriteAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel(), value);
5826 if (err != CHIP_NO_ERROR) {
5829 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5833 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5835 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5837 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5841 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5844 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5848 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5849 if (err != CHIP_NO_ERROR) {
5852 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5858 @interface CHIPLevelControl ()
5859 @property (readonly) Controller::LevelControlCluster cppCluster;
5862 @implementation CHIPLevelControl
5864 - (Controller::ClusterBase *)getCluster
5866 return &_cppCluster;
5869 - (void)move:(uint8_t)moveMode
5871 optionMask:(uint8_t)optionMask
5872 optionOverride:(uint8_t)optionOverride
5873 completionHandler:(ResponseHandler)completionHandler
5875 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5877 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5881 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5884 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5888 CHIP_ERROR err = self.cppCluster.Move(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionMask, optionOverride);
5889 if (err != CHIP_NO_ERROR) {
5892 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5895 - (void)moveToLevel:(uint8_t)level
5896 transitionTime:(uint16_t)transitionTime
5897 optionMask:(uint8_t)optionMask
5898 optionOverride:(uint8_t)optionOverride
5899 completionHandler:(ResponseHandler)completionHandler
5901 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5903 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5907 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5910 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5915 = self.cppCluster.MoveToLevel(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime, optionMask, optionOverride);
5916 if (err != CHIP_NO_ERROR) {
5919 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5922 - (void)moveToLevelWithOnOff:(uint8_t)level
5923 transitionTime:(uint16_t)transitionTime
5924 completionHandler:(ResponseHandler)completionHandler
5926 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5928 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5932 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5935 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5939 CHIP_ERROR err = self.cppCluster.MoveToLevelWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime);
5940 if (err != CHIP_NO_ERROR) {
5943 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5946 - (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler
5948 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5950 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5954 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5957 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5961 CHIP_ERROR err = self.cppCluster.MoveWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate);
5962 if (err != CHIP_NO_ERROR) {
5965 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5968 - (void)step:(uint8_t)stepMode
5969 stepSize:(uint8_t)stepSize
5970 transitionTime:(uint16_t)transitionTime
5971 optionMask:(uint8_t)optionMask
5972 optionOverride:(uint8_t)optionOverride
5973 completionHandler:(ResponseHandler)completionHandler
5975 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5977 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5981 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5984 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5988 CHIP_ERROR err = self.cppCluster.Step(
5989 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionMask, optionOverride);
5990 if (err != CHIP_NO_ERROR) {
5993 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5996 - (void)stepWithOnOff:(uint8_t)stepMode
5997 stepSize:(uint8_t)stepSize
5998 transitionTime:(uint16_t)transitionTime
5999 completionHandler:(ResponseHandler)completionHandler
6001 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6003 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6007 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6010 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6014 CHIP_ERROR err = self.cppCluster.StepWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime);
6015 if (err != CHIP_NO_ERROR) {
6018 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6021 - (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler
6023 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6025 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6029 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6032 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6036 CHIP_ERROR err = self.cppCluster.Stop(onSuccess->Cancel(), onFailure->Cancel(), optionMask, optionOverride);
6037 if (err != CHIP_NO_ERROR) {
6040 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6043 - (void)stopWithOnOff:(ResponseHandler)completionHandler
6045 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6047 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6051 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6054 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6058 CHIP_ERROR err = self.cppCluster.StopWithOnOff(onSuccess->Cancel(), onFailure->Cancel());
6059 if (err != CHIP_NO_ERROR) {
6062 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6066 - (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler
6068 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6070 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6074 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6077 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6081 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentLevel(onSuccess->Cancel(), onFailure->Cancel());
6082 if (err != CHIP_NO_ERROR) {
6085 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6089 - (void)configureAttributeCurrentLevel:(uint16_t)minInterval
6090 maxInterval:(uint16_t)maxInterval
6091 change:(uint8_t)change
6092 completionHandler:(ResponseHandler)completionHandler
6094 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6096 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6100 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6103 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6107 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentLevel(
6108 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
6109 if (err != CHIP_NO_ERROR) {
6112 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6116 - (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler
6118 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
6120 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6124 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentLevel(onReport->Cancel());
6125 if (err != CHIP_NO_ERROR) {
6127 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
6131 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6133 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6135 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6139 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6142 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6146 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6147 if (err != CHIP_NO_ERROR) {
6150 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6156 @interface CHIPLowPower ()
6157 @property (readonly) Controller::LowPowerCluster cppCluster;
6160 @implementation CHIPLowPower
6162 - (Controller::ClusterBase *)getCluster
6164 return &_cppCluster;
6167 - (void)sleep:(ResponseHandler)completionHandler
6169 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6171 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6175 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6178 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6182 CHIP_ERROR err = self.cppCluster.Sleep(onSuccess->Cancel(), onFailure->Cancel());
6183 if (err != CHIP_NO_ERROR) {
6186 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6190 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6192 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6194 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6198 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6201 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6205 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6206 if (err != CHIP_NO_ERROR) {
6209 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6215 @interface CHIPMediaPlayback ()
6216 @property (readonly) Controller::MediaPlaybackCluster cppCluster;
6219 @implementation CHIPMediaPlayback
6221 - (Controller::ClusterBase *)getCluster
6223 return &_cppCluster;
6226 - (void)fastForwardRequest:(ResponseHandler)completionHandler
6228 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6230 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6234 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6237 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6241 CHIP_ERROR err = self.cppCluster.FastForwardRequest(onSuccess->Cancel(), onFailure->Cancel());
6242 if (err != CHIP_NO_ERROR) {
6245 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6248 - (void)nextRequest:(ResponseHandler)completionHandler
6250 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6252 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6256 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6259 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6263 CHIP_ERROR err = self.cppCluster.NextRequest(onSuccess->Cancel(), onFailure->Cancel());
6264 if (err != CHIP_NO_ERROR) {
6267 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6270 - (void)pauseRequest:(ResponseHandler)completionHandler
6272 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6274 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6278 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6281 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6285 CHIP_ERROR err = self.cppCluster.PauseRequest(onSuccess->Cancel(), onFailure->Cancel());
6286 if (err != CHIP_NO_ERROR) {
6289 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6292 - (void)playRequest:(ResponseHandler)completionHandler
6294 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6296 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6300 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6303 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6307 CHIP_ERROR err = self.cppCluster.PlayRequest(onSuccess->Cancel(), onFailure->Cancel());
6308 if (err != CHIP_NO_ERROR) {
6311 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6314 - (void)previousRequest:(ResponseHandler)completionHandler
6316 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6318 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6322 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6325 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6329 CHIP_ERROR err = self.cppCluster.PreviousRequest(onSuccess->Cancel(), onFailure->Cancel());
6330 if (err != CHIP_NO_ERROR) {
6333 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6336 - (void)rewindRequest:(ResponseHandler)completionHandler
6338 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6340 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6344 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6347 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6351 CHIP_ERROR err = self.cppCluster.RewindRequest(onSuccess->Cancel(), onFailure->Cancel());
6352 if (err != CHIP_NO_ERROR) {
6355 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6358 - (void)skipBackwardRequest:(ResponseHandler)completionHandler
6360 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6362 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6366 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6369 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6373 CHIP_ERROR err = self.cppCluster.SkipBackwardRequest(onSuccess->Cancel(), onFailure->Cancel());
6374 if (err != CHIP_NO_ERROR) {
6377 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6380 - (void)skipForwardRequest:(ResponseHandler)completionHandler
6382 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6384 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6388 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6391 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6395 CHIP_ERROR err = self.cppCluster.SkipForwardRequest(onSuccess->Cancel(), onFailure->Cancel());
6396 if (err != CHIP_NO_ERROR) {
6399 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6402 - (void)startOverRequest:(ResponseHandler)completionHandler
6404 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6406 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6410 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6413 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6417 CHIP_ERROR err = self.cppCluster.StartOverRequest(onSuccess->Cancel(), onFailure->Cancel());
6418 if (err != CHIP_NO_ERROR) {
6421 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6424 - (void)stopRequest:(ResponseHandler)completionHandler
6426 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6428 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6432 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6435 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6439 CHIP_ERROR err = self.cppCluster.StopRequest(onSuccess->Cancel(), onFailure->Cancel());
6440 if (err != CHIP_NO_ERROR) {
6443 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6447 - (void)readAttributeCurrentState:(ResponseHandler)completionHandler
6449 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6451 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6455 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6458 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6462 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentState(onSuccess->Cancel(), onFailure->Cancel());
6463 if (err != CHIP_NO_ERROR) {
6466 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6470 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6472 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6474 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6478 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6481 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6485 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6486 if (err != CHIP_NO_ERROR) {
6489 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6495 @interface CHIPOnOff ()
6496 @property (readonly) Controller::OnOffCluster cppCluster;
6499 @implementation CHIPOnOff
6501 - (Controller::ClusterBase *)getCluster
6503 return &_cppCluster;
6506 - (void)off:(ResponseHandler)completionHandler
6508 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6510 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6514 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6517 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6521 CHIP_ERROR err = self.cppCluster.Off(onSuccess->Cancel(), onFailure->Cancel());
6522 if (err != CHIP_NO_ERROR) {
6525 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6528 - (void)on:(ResponseHandler)completionHandler
6530 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6532 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6536 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6539 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6543 CHIP_ERROR err = self.cppCluster.On(onSuccess->Cancel(), onFailure->Cancel());
6544 if (err != CHIP_NO_ERROR) {
6547 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6550 - (void)toggle:(ResponseHandler)completionHandler
6552 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6554 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6558 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6561 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6565 CHIP_ERROR err = self.cppCluster.Toggle(onSuccess->Cancel(), onFailure->Cancel());
6566 if (err != CHIP_NO_ERROR) {
6569 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6573 - (void)readAttributeOnOff:(ResponseHandler)completionHandler
6575 CHIPBooleanAttributeCallbackBridge * onSuccess
6576 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6578 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6582 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6585 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6589 CHIP_ERROR err = self.cppCluster.ReadAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel());
6590 if (err != CHIP_NO_ERROR) {
6593 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6597 - (void)configureAttributeOnOff:(uint16_t)minInterval
6598 maxInterval:(uint16_t)maxInterval
6599 completionHandler:(ResponseHandler)completionHandler
6601 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6603 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6607 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6610 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6614 CHIP_ERROR err = self.cppCluster.ConfigureAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
6615 if (err != CHIP_NO_ERROR) {
6618 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6622 - (void)reportAttributeOnOff:(ResponseHandler)reportHandler
6624 CHIPBooleanAttributeCallbackBridge * onReport
6625 = new CHIPBooleanAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
6627 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6631 CHIP_ERROR err = self.cppCluster.ReportAttributeOnOff(onReport->Cancel());
6632 if (err != CHIP_NO_ERROR) {
6634 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
6638 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6640 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6642 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6646 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6649 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6653 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6654 if (err != CHIP_NO_ERROR) {
6657 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6663 @interface CHIPScenes ()
6664 @property (readonly) Controller::ScenesCluster cppCluster;
6667 @implementation CHIPScenes
6669 - (Controller::ClusterBase *)getCluster
6671 return &_cppCluster;
6674 - (void)addScene:(uint16_t)groupId
6675 sceneId:(uint8_t)sceneId
6676 transitionTime:(uint16_t)transitionTime
6677 sceneName:(NSString *)sceneName
6678 clusterId:(uint16_t)clusterId
6679 length:(uint8_t)length
6680 value:(uint8_t)value
6681 completionHandler:(ResponseHandler)completionHandler
6683 CHIPScenesClusterAddSceneResponseCallbackBridge * onSuccess
6684 = new CHIPScenesClusterAddSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
6686 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6690 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6693 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6697 CHIP_ERROR err = self.cppCluster.AddScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime,
6698 chip::ByteSpan((const uint8_t *) [sceneName dataUsingEncoding:NSUTF8StringEncoding].bytes,
6699 [sceneName lengthOfBytesUsingEncoding:NSUTF8StringEncoding]),
6700 clusterId, length, value);
6701 if (err != CHIP_NO_ERROR) {
6704 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6707 - (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
6709 CHIPScenesClusterGetSceneMembershipResponseCallbackBridge * onSuccess
6710 = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]);
6712 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6716 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6719 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6723 CHIP_ERROR err = self.cppCluster.GetSceneMembership(onSuccess->Cancel(), onFailure->Cancel(), groupId);
6724 if (err != CHIP_NO_ERROR) {
6727 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6730 - (void)recallScene:(uint16_t)groupId
6731 sceneId:(uint8_t)sceneId
6732 transitionTime:(uint16_t)transitionTime
6733 completionHandler:(ResponseHandler)completionHandler
6735 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6737 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6741 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6744 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6748 CHIP_ERROR err = self.cppCluster.RecallScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime);
6749 if (err != CHIP_NO_ERROR) {
6752 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6755 - (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
6757 CHIPScenesClusterRemoveAllScenesResponseCallbackBridge * onSuccess
6758 = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(completionHandler, [self callbackQueue]);
6760 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6764 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6767 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6771 CHIP_ERROR err = self.cppCluster.RemoveAllScenes(onSuccess->Cancel(), onFailure->Cancel(), groupId);
6772 if (err != CHIP_NO_ERROR) {
6775 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6778 - (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
6780 CHIPScenesClusterRemoveSceneResponseCallbackBridge * onSuccess
6781 = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
6783 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6787 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6790 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6794 CHIP_ERROR err = self.cppCluster.RemoveScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
6795 if (err != CHIP_NO_ERROR) {
6798 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6801 - (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
6803 CHIPScenesClusterStoreSceneResponseCallbackBridge * onSuccess
6804 = new CHIPScenesClusterStoreSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
6806 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6810 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6813 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6817 CHIP_ERROR err = self.cppCluster.StoreScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
6818 if (err != CHIP_NO_ERROR) {
6821 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6824 - (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
6826 CHIPScenesClusterViewSceneResponseCallbackBridge * onSuccess
6827 = new CHIPScenesClusterViewSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
6829 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6833 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6836 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6840 CHIP_ERROR err = self.cppCluster.ViewScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
6841 if (err != CHIP_NO_ERROR) {
6844 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6848 - (void)readAttributeSceneCount:(ResponseHandler)completionHandler
6850 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6852 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6856 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6859 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6863 CHIP_ERROR err = self.cppCluster.ReadAttributeSceneCount(onSuccess->Cancel(), onFailure->Cancel());
6864 if (err != CHIP_NO_ERROR) {
6867 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6871 - (void)readAttributeCurrentScene:(ResponseHandler)completionHandler
6873 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6875 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6879 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6882 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6886 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentScene(onSuccess->Cancel(), onFailure->Cancel());
6887 if (err != CHIP_NO_ERROR) {
6890 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6894 - (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler
6896 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6898 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6902 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6905 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6909 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentGroup(onSuccess->Cancel(), onFailure->Cancel());
6910 if (err != CHIP_NO_ERROR) {
6913 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6917 - (void)readAttributeSceneValid:(ResponseHandler)completionHandler
6919 CHIPBooleanAttributeCallbackBridge * onSuccess
6920 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6922 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6926 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6929 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6933 CHIP_ERROR err = self.cppCluster.ReadAttributeSceneValid(onSuccess->Cancel(), onFailure->Cancel());
6934 if (err != CHIP_NO_ERROR) {
6937 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6941 - (void)readAttributeNameSupport:(ResponseHandler)completionHandler
6943 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6945 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6949 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6952 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6956 CHIP_ERROR err = self.cppCluster.ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
6957 if (err != CHIP_NO_ERROR) {
6960 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6964 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6966 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6968 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6972 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6975 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6979 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6980 if (err != CHIP_NO_ERROR) {
6983 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6989 @interface CHIPTemperatureMeasurement ()
6990 @property (readonly) Controller::TemperatureMeasurementCluster cppCluster;
6993 @implementation CHIPTemperatureMeasurement
6995 - (Controller::ClusterBase *)getCluster
6997 return &_cppCluster;
7000 - (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler
7002 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(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.ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
7016 if (err != CHIP_NO_ERROR) {
7019 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7023 - (void)configureAttributeMeasuredValue:(uint16_t)minInterval
7024 maxInterval:(uint16_t)maxInterval
7025 change:(int16_t)change
7026 completionHandler:(ResponseHandler)completionHandler
7028 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
7030 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7034 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7037 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7041 CHIP_ERROR err = self.cppCluster.ConfigureAttributeMeasuredValue(
7042 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
7043 if (err != CHIP_NO_ERROR) {
7046 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7050 - (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler
7052 CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
7054 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7058 CHIP_ERROR err = self.cppCluster.ReportAttributeMeasuredValue(onReport->Cancel());
7059 if (err != CHIP_NO_ERROR) {
7061 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
7065 - (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler
7067 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7069 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7073 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7076 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7080 CHIP_ERROR err = self.cppCluster.ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
7081 if (err != CHIP_NO_ERROR) {
7084 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7088 - (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler
7090 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7092 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7096 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7099 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7103 CHIP_ERROR err = self.cppCluster.ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
7104 if (err != CHIP_NO_ERROR) {
7107 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
7111 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
7113 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
7115 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7119 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
7122 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
7126 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
7127 if (err != CHIP_NO_ERROR) {
7130 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);