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 CHIPUnsupportedAttributeCallbackBridge : public Callback::Callback<DefaultSuccessCallback> {
94 CHIPUnsupportedAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
95 : Callback::Callback<DefaultSuccessCallback>(CallbackFn, this)
99 ~CHIPUnsupportedAttributeCallbackBridge() {};
101 static void CallbackFn(void * context)
103 CHIPUnsupportedAttributeCallbackBridge * callback = reinterpret_cast<CHIPUnsupportedAttributeCallbackBridge *>(context);
104 if (callback && callback->mQueue) {
105 dispatch_async(callback->mQueue, ^{
106 NSError * error = [NSError errorWithDomain:CHIPErrorDomain
107 code:CHIPErrorCodeUndefinedError
108 userInfo:@ { NSLocalizedDescriptionKey : @"Unsupported attribute type" }];
109 callback->mHandler(error, nil);
117 ResponseHandler mHandler;
118 dispatch_queue_t mQueue;
121 class CHIPBooleanAttributeCallbackBridge : public Callback::Callback<BooleanAttributeCallback> {
123 CHIPBooleanAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
124 : Callback::Callback<BooleanAttributeCallback>(CallbackFn, this)
127 , mKeepAlive(keepAlive)
131 ~CHIPBooleanAttributeCallbackBridge() {};
133 static void CallbackFn(void * context, bool value)
135 CHIPBooleanAttributeCallbackBridge * callback = reinterpret_cast<CHIPBooleanAttributeCallbackBridge *>(context);
136 if (callback && callback->mQueue) {
137 dispatch_async(callback->mQueue, ^{
138 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithBool:value] });
139 if (!callback->mKeepAlive) {
148 ResponseHandler mHandler;
149 dispatch_queue_t mQueue;
153 class CHIPInt8uAttributeCallbackBridge : public Callback::Callback<Int8uAttributeCallback> {
155 CHIPInt8uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
156 : Callback::Callback<Int8uAttributeCallback>(CallbackFn, this)
159 , mKeepAlive(keepAlive)
163 ~CHIPInt8uAttributeCallbackBridge() {};
165 static void CallbackFn(void * context, uint8_t value)
167 CHIPInt8uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt8uAttributeCallbackBridge *>(context);
168 if (callback && callback->mQueue) {
169 dispatch_async(callback->mQueue, ^{
170 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedChar:value] });
171 if (!callback->mKeepAlive) {
180 ResponseHandler mHandler;
181 dispatch_queue_t mQueue;
185 class CHIPInt8sAttributeCallbackBridge : public Callback::Callback<Int8sAttributeCallback> {
187 CHIPInt8sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
188 : Callback::Callback<Int8sAttributeCallback>(CallbackFn, this)
191 , mKeepAlive(keepAlive)
195 ~CHIPInt8sAttributeCallbackBridge() {};
197 static void CallbackFn(void * context, int8_t value)
199 CHIPInt8sAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt8sAttributeCallbackBridge *>(context);
200 if (callback && callback->mQueue) {
201 dispatch_async(callback->mQueue, ^{
202 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithChar:value] });
203 if (!callback->mKeepAlive) {
212 ResponseHandler mHandler;
213 dispatch_queue_t mQueue;
217 class CHIPInt16uAttributeCallbackBridge : public Callback::Callback<Int16uAttributeCallback> {
219 CHIPInt16uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
220 : Callback::Callback<Int16uAttributeCallback>(CallbackFn, this)
223 , mKeepAlive(keepAlive)
227 ~CHIPInt16uAttributeCallbackBridge() {};
229 static void CallbackFn(void * context, uint16_t value)
231 CHIPInt16uAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt16uAttributeCallbackBridge *>(context);
232 if (callback && callback->mQueue) {
233 dispatch_async(callback->mQueue, ^{
234 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithUnsignedShort:value] });
235 if (!callback->mKeepAlive) {
244 ResponseHandler mHandler;
245 dispatch_queue_t mQueue;
249 class CHIPInt16sAttributeCallbackBridge : public Callback::Callback<Int16sAttributeCallback> {
251 CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false)
252 : Callback::Callback<Int16sAttributeCallback>(CallbackFn, this)
255 , mKeepAlive(keepAlive)
259 ~CHIPInt16sAttributeCallbackBridge() {};
261 static void CallbackFn(void * context, int16_t value)
263 CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast<CHIPInt16sAttributeCallbackBridge *>(context);
264 if (callback && callback->mQueue) {
265 dispatch_async(callback->mQueue, ^{
266 callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] });
267 if (!callback->mKeepAlive) {
276 ResponseHandler mHandler;
277 dispatch_queue_t mQueue;
281 class CHIPContentLaunchClusterLaunchContentResponseCallbackBridge
282 : public Callback::Callback<ContentLaunchClusterLaunchContentResponseCallback> {
284 CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
285 : Callback::Callback<ContentLaunchClusterLaunchContentResponseCallback>(CallbackFn, this)
291 ~CHIPContentLaunchClusterLaunchContentResponseCallbackBridge() {};
293 static void CallbackFn(void * context, uint8_t contentLaunchStatus)
295 CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * callback
296 = reinterpret_cast<CHIPContentLaunchClusterLaunchContentResponseCallbackBridge *>(context);
297 if (callback && callback->mQueue) {
298 dispatch_async(callback->mQueue, ^{
299 callback->mHandler(nil, @ {
300 @"contentLaunchStatus" : [NSNumber numberWithUnsignedChar:contentLaunchStatus],
309 ResponseHandler mHandler;
310 dispatch_queue_t mQueue;
313 class CHIPContentLaunchClusterLaunchURLResponseCallbackBridge
314 : public Callback::Callback<ContentLaunchClusterLaunchURLResponseCallback> {
316 CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
317 : Callback::Callback<ContentLaunchClusterLaunchURLResponseCallback>(CallbackFn, this)
323 ~CHIPContentLaunchClusterLaunchURLResponseCallbackBridge() {};
325 static void CallbackFn(void * context, uint8_t contentLaunchStatus)
327 CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * callback
328 = reinterpret_cast<CHIPContentLaunchClusterLaunchURLResponseCallbackBridge *>(context);
329 if (callback && callback->mQueue) {
330 dispatch_async(callback->mQueue, ^{
331 callback->mHandler(nil, @ {
332 @"contentLaunchStatus" : [NSNumber numberWithUnsignedChar:contentLaunchStatus],
341 ResponseHandler mHandler;
342 dispatch_queue_t mQueue;
345 class CHIPDoorLockClusterClearAllPinsResponseCallbackBridge
346 : public Callback::Callback<DoorLockClusterClearAllPinsResponseCallback> {
348 CHIPDoorLockClusterClearAllPinsResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
349 : Callback::Callback<DoorLockClusterClearAllPinsResponseCallback>(CallbackFn, this)
355 ~CHIPDoorLockClusterClearAllPinsResponseCallbackBridge() {};
357 static void CallbackFn(void * context)
359 CHIPDoorLockClusterClearAllPinsResponseCallbackBridge * callback
360 = reinterpret_cast<CHIPDoorLockClusterClearAllPinsResponseCallbackBridge *>(context);
361 if (callback && callback->mQueue) {
362 dispatch_async(callback->mQueue, ^{
363 callback->mHandler(nil, @ {});
371 ResponseHandler mHandler;
372 dispatch_queue_t mQueue;
375 class CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge
376 : public Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback> {
378 CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
379 : Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback>(CallbackFn, this)
385 ~CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge() {};
387 static void CallbackFn(void * context)
389 CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge * callback
390 = reinterpret_cast<CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge *>(context);
391 if (callback && callback->mQueue) {
392 dispatch_async(callback->mQueue, ^{
393 callback->mHandler(nil, @ {});
401 ResponseHandler mHandler;
402 dispatch_queue_t mQueue;
405 class CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge
406 : public Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback> {
408 CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
409 : Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback>(CallbackFn, this)
415 ~CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge() {};
417 static void CallbackFn(void * context)
419 CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge * callback
420 = reinterpret_cast<CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge *>(context);
421 if (callback && callback->mQueue) {
422 dispatch_async(callback->mQueue, ^{
423 callback->mHandler(nil, @ {});
431 ResponseHandler mHandler;
432 dispatch_queue_t mQueue;
435 class CHIPDoorLockClusterClearPinResponseCallbackBridge : public Callback::Callback<DoorLockClusterClearPinResponseCallback> {
437 CHIPDoorLockClusterClearPinResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
438 : Callback::Callback<DoorLockClusterClearPinResponseCallback>(CallbackFn, this)
444 ~CHIPDoorLockClusterClearPinResponseCallbackBridge() {};
446 static void CallbackFn(void * context)
448 CHIPDoorLockClusterClearPinResponseCallbackBridge * callback
449 = reinterpret_cast<CHIPDoorLockClusterClearPinResponseCallbackBridge *>(context);
450 if (callback && callback->mQueue) {
451 dispatch_async(callback->mQueue, ^{
452 callback->mHandler(nil, @ {});
460 ResponseHandler mHandler;
461 dispatch_queue_t mQueue;
464 class CHIPDoorLockClusterClearRfidResponseCallbackBridge : public Callback::Callback<DoorLockClusterClearRfidResponseCallback> {
466 CHIPDoorLockClusterClearRfidResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
467 : Callback::Callback<DoorLockClusterClearRfidResponseCallback>(CallbackFn, this)
473 ~CHIPDoorLockClusterClearRfidResponseCallbackBridge() {};
475 static void CallbackFn(void * context)
477 CHIPDoorLockClusterClearRfidResponseCallbackBridge * callback
478 = reinterpret_cast<CHIPDoorLockClusterClearRfidResponseCallbackBridge *>(context);
479 if (callback && callback->mQueue) {
480 dispatch_async(callback->mQueue, ^{
481 callback->mHandler(nil, @ {});
489 ResponseHandler mHandler;
490 dispatch_queue_t mQueue;
493 class CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge
494 : public Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback> {
496 CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
497 : Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback>(CallbackFn, this)
503 ~CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge() {};
505 static void CallbackFn(void * context)
507 CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge * callback
508 = reinterpret_cast<CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge *>(context);
509 if (callback && callback->mQueue) {
510 dispatch_async(callback->mQueue, ^{
511 callback->mHandler(nil, @ {});
519 ResponseHandler mHandler;
520 dispatch_queue_t mQueue;
523 class CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge
524 : public Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback> {
526 CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
527 : Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback>(CallbackFn, this)
533 ~CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge() {};
535 static void CallbackFn(void * context)
537 CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge * callback
538 = reinterpret_cast<CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge *>(context);
539 if (callback && callback->mQueue) {
540 dispatch_async(callback->mQueue, ^{
541 callback->mHandler(nil, @ {});
549 ResponseHandler mHandler;
550 dispatch_queue_t mQueue;
553 class CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge
554 : public Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback> {
556 CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
557 : Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback>(CallbackFn, this)
563 ~CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge() {};
565 static void CallbackFn(
566 void * context, uint8_t scheduleId, uint32_t localStartTime, uint32_t localEndTime, uint8_t operatingModeDuringHoliday)
568 CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge * callback
569 = reinterpret_cast<CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge *>(context);
570 if (callback && callback->mQueue) {
571 dispatch_async(callback->mQueue, ^{
572 callback->mHandler(nil, @ {
573 @"scheduleId" : [NSNumber numberWithUnsignedChar:scheduleId],
574 @"localStartTime" : [NSNumber numberWithUnsignedLong:localStartTime],
575 @"localEndTime" : [NSNumber numberWithUnsignedLong:localEndTime],
576 @"operatingModeDuringHoliday" : [NSNumber numberWithUnsignedChar:operatingModeDuringHoliday],
585 ResponseHandler mHandler;
586 dispatch_queue_t mQueue;
589 class CHIPDoorLockClusterGetLogRecordResponseCallbackBridge
590 : public Callback::Callback<DoorLockClusterGetLogRecordResponseCallback> {
592 CHIPDoorLockClusterGetLogRecordResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
593 : Callback::Callback<DoorLockClusterGetLogRecordResponseCallback>(CallbackFn, this)
599 ~CHIPDoorLockClusterGetLogRecordResponseCallbackBridge() {};
601 static void CallbackFn(void * context, uint16_t logEntryId, uint32_t timestamp, uint8_t eventType, uint8_t source,
602 uint8_t eventIdOrAlarmCode, uint16_t userId, uint8_t * pin)
604 CHIPDoorLockClusterGetLogRecordResponseCallbackBridge * callback
605 = reinterpret_cast<CHIPDoorLockClusterGetLogRecordResponseCallbackBridge *>(context);
606 if (callback && callback->mQueue) {
607 dispatch_async(callback->mQueue, ^{
608 callback->mHandler(nil, @ {
609 @"logEntryId" : [NSNumber numberWithUnsignedShort:logEntryId],
610 @"timestamp" : [NSNumber numberWithUnsignedLong:timestamp],
611 @"eventType" : [NSNumber numberWithUnsignedChar:eventType],
612 @"source" : [NSNumber numberWithUnsignedChar:source],
613 @"eventIdOrAlarmCode" : [NSNumber numberWithUnsignedChar:eventIdOrAlarmCode],
614 @"userId" : [NSNumber numberWithUnsignedShort:userId],
615 @"pin" : [NSString stringWithFormat:@"%s", pin],
624 ResponseHandler mHandler;
625 dispatch_queue_t mQueue;
628 class CHIPDoorLockClusterGetPinResponseCallbackBridge : public Callback::Callback<DoorLockClusterGetPinResponseCallback> {
630 CHIPDoorLockClusterGetPinResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
631 : Callback::Callback<DoorLockClusterGetPinResponseCallback>(CallbackFn, this)
637 ~CHIPDoorLockClusterGetPinResponseCallbackBridge() {};
639 static void CallbackFn(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * pin)
641 CHIPDoorLockClusterGetPinResponseCallbackBridge * callback
642 = reinterpret_cast<CHIPDoorLockClusterGetPinResponseCallbackBridge *>(context);
643 if (callback && callback->mQueue) {
644 dispatch_async(callback->mQueue, ^{
645 callback->mHandler(nil, @ {
646 @"userId" : [NSNumber numberWithUnsignedShort:userId],
647 @"userStatus" : [NSNumber numberWithUnsignedChar:userStatus],
648 @"userType" : [NSNumber numberWithUnsignedChar:userType],
649 @"pin" : [NSString stringWithFormat:@"%s", pin],
658 ResponseHandler mHandler;
659 dispatch_queue_t mQueue;
662 class CHIPDoorLockClusterGetRfidResponseCallbackBridge : public Callback::Callback<DoorLockClusterGetRfidResponseCallback> {
664 CHIPDoorLockClusterGetRfidResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
665 : Callback::Callback<DoorLockClusterGetRfidResponseCallback>(CallbackFn, this)
671 ~CHIPDoorLockClusterGetRfidResponseCallbackBridge() {};
673 static void CallbackFn(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * rfid)
675 CHIPDoorLockClusterGetRfidResponseCallbackBridge * callback
676 = reinterpret_cast<CHIPDoorLockClusterGetRfidResponseCallbackBridge *>(context);
677 if (callback && callback->mQueue) {
678 dispatch_async(callback->mQueue, ^{
679 callback->mHandler(nil, @ {
680 @"userId" : [NSNumber numberWithUnsignedShort:userId],
681 @"userStatus" : [NSNumber numberWithUnsignedChar:userStatus],
682 @"userType" : [NSNumber numberWithUnsignedChar:userType],
683 @"rfid" : [NSString stringWithFormat:@"%s", rfid],
692 ResponseHandler mHandler;
693 dispatch_queue_t mQueue;
696 class CHIPDoorLockClusterGetUserTypeResponseCallbackBridge : public Callback::Callback<DoorLockClusterGetUserTypeResponseCallback> {
698 CHIPDoorLockClusterGetUserTypeResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
699 : Callback::Callback<DoorLockClusterGetUserTypeResponseCallback>(CallbackFn, this)
705 ~CHIPDoorLockClusterGetUserTypeResponseCallbackBridge() {};
707 static void CallbackFn(void * context, uint16_t userId, uint8_t userType)
709 CHIPDoorLockClusterGetUserTypeResponseCallbackBridge * callback
710 = reinterpret_cast<CHIPDoorLockClusterGetUserTypeResponseCallbackBridge *>(context);
711 if (callback && callback->mQueue) {
712 dispatch_async(callback->mQueue, ^{
713 callback->mHandler(nil, @ {
714 @"userId" : [NSNumber numberWithUnsignedShort:userId],
715 @"userType" : [NSNumber numberWithUnsignedChar:userType],
724 ResponseHandler mHandler;
725 dispatch_queue_t mQueue;
728 class CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge
729 : public Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback> {
731 CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
732 : Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback>(CallbackFn, this)
738 ~CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge() {};
740 static void CallbackFn(void * context, uint8_t scheduleId, uint16_t userId, uint8_t daysMask, uint8_t startHour,
741 uint8_t startMinute, uint8_t endHour, uint8_t endMinute)
743 CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge * callback
744 = reinterpret_cast<CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge *>(context);
745 if (callback && callback->mQueue) {
746 dispatch_async(callback->mQueue, ^{
747 callback->mHandler(nil, @ {
748 @"scheduleId" : [NSNumber numberWithUnsignedChar:scheduleId],
749 @"userId" : [NSNumber numberWithUnsignedShort:userId],
750 @"daysMask" : [NSNumber numberWithUnsignedChar:daysMask],
751 @"startHour" : [NSNumber numberWithUnsignedChar:startHour],
752 @"startMinute" : [NSNumber numberWithUnsignedChar:startMinute],
753 @"endHour" : [NSNumber numberWithUnsignedChar:endHour],
754 @"endMinute" : [NSNumber numberWithUnsignedChar:endMinute],
763 ResponseHandler mHandler;
764 dispatch_queue_t mQueue;
767 class CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge
768 : public Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback> {
770 CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
771 : Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback>(CallbackFn, this)
777 ~CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge() {};
779 static void CallbackFn(void * context, uint8_t scheduleId, uint16_t userId, uint32_t localStartTime, uint32_t localEndTime)
781 CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge * callback
782 = reinterpret_cast<CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge *>(context);
783 if (callback && callback->mQueue) {
784 dispatch_async(callback->mQueue, ^{
785 callback->mHandler(nil, @ {
786 @"scheduleId" : [NSNumber numberWithUnsignedChar:scheduleId],
787 @"userId" : [NSNumber numberWithUnsignedShort:userId],
788 @"localStartTime" : [NSNumber numberWithUnsignedLong:localStartTime],
789 @"localEndTime" : [NSNumber numberWithUnsignedLong:localEndTime],
798 ResponseHandler mHandler;
799 dispatch_queue_t mQueue;
802 class CHIPDoorLockClusterLockDoorResponseCallbackBridge : public Callback::Callback<DoorLockClusterLockDoorResponseCallback> {
804 CHIPDoorLockClusterLockDoorResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
805 : Callback::Callback<DoorLockClusterLockDoorResponseCallback>(CallbackFn, this)
811 ~CHIPDoorLockClusterLockDoorResponseCallbackBridge() {};
813 static void CallbackFn(void * context)
815 CHIPDoorLockClusterLockDoorResponseCallbackBridge * callback
816 = reinterpret_cast<CHIPDoorLockClusterLockDoorResponseCallbackBridge *>(context);
817 if (callback && callback->mQueue) {
818 dispatch_async(callback->mQueue, ^{
819 callback->mHandler(nil, @ {});
827 ResponseHandler mHandler;
828 dispatch_queue_t mQueue;
831 class CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge
832 : public Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback> {
834 CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
835 : Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback>(CallbackFn, this)
841 ~CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge() {};
843 static void CallbackFn(void * context)
845 CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge * callback
846 = reinterpret_cast<CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge *>(context);
847 if (callback && callback->mQueue) {
848 dispatch_async(callback->mQueue, ^{
849 callback->mHandler(nil, @ {});
857 ResponseHandler mHandler;
858 dispatch_queue_t mQueue;
861 class CHIPDoorLockClusterSetPinResponseCallbackBridge : public Callback::Callback<DoorLockClusterSetPinResponseCallback> {
863 CHIPDoorLockClusterSetPinResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
864 : Callback::Callback<DoorLockClusterSetPinResponseCallback>(CallbackFn, this)
870 ~CHIPDoorLockClusterSetPinResponseCallbackBridge() {};
872 static void CallbackFn(void * context)
874 CHIPDoorLockClusterSetPinResponseCallbackBridge * callback
875 = reinterpret_cast<CHIPDoorLockClusterSetPinResponseCallbackBridge *>(context);
876 if (callback && callback->mQueue) {
877 dispatch_async(callback->mQueue, ^{
878 callback->mHandler(nil, @ {});
886 ResponseHandler mHandler;
887 dispatch_queue_t mQueue;
890 class CHIPDoorLockClusterSetRfidResponseCallbackBridge : public Callback::Callback<DoorLockClusterSetRfidResponseCallback> {
892 CHIPDoorLockClusterSetRfidResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
893 : Callback::Callback<DoorLockClusterSetRfidResponseCallback>(CallbackFn, this)
899 ~CHIPDoorLockClusterSetRfidResponseCallbackBridge() {};
901 static void CallbackFn(void * context)
903 CHIPDoorLockClusterSetRfidResponseCallbackBridge * callback
904 = reinterpret_cast<CHIPDoorLockClusterSetRfidResponseCallbackBridge *>(context);
905 if (callback && callback->mQueue) {
906 dispatch_async(callback->mQueue, ^{
907 callback->mHandler(nil, @ {});
915 ResponseHandler mHandler;
916 dispatch_queue_t mQueue;
919 class CHIPDoorLockClusterSetUserTypeResponseCallbackBridge : public Callback::Callback<DoorLockClusterSetUserTypeResponseCallback> {
921 CHIPDoorLockClusterSetUserTypeResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
922 : Callback::Callback<DoorLockClusterSetUserTypeResponseCallback>(CallbackFn, this)
928 ~CHIPDoorLockClusterSetUserTypeResponseCallbackBridge() {};
930 static void CallbackFn(void * context)
932 CHIPDoorLockClusterSetUserTypeResponseCallbackBridge * callback
933 = reinterpret_cast<CHIPDoorLockClusterSetUserTypeResponseCallbackBridge *>(context);
934 if (callback && callback->mQueue) {
935 dispatch_async(callback->mQueue, ^{
936 callback->mHandler(nil, @ {});
944 ResponseHandler mHandler;
945 dispatch_queue_t mQueue;
948 class CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge
949 : public Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback> {
951 CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
952 : Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback>(CallbackFn, this)
958 ~CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge() {};
960 static void CallbackFn(void * context)
962 CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge * callback
963 = reinterpret_cast<CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge *>(context);
964 if (callback && callback->mQueue) {
965 dispatch_async(callback->mQueue, ^{
966 callback->mHandler(nil, @ {});
974 ResponseHandler mHandler;
975 dispatch_queue_t mQueue;
978 class CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge
979 : public Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback> {
981 CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
982 : Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback>(CallbackFn, this)
988 ~CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge() {};
990 static void CallbackFn(void * context)
992 CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge * callback
993 = reinterpret_cast<CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge *>(context);
994 if (callback && callback->mQueue) {
995 dispatch_async(callback->mQueue, ^{
996 callback->mHandler(nil, @ {});
1004 ResponseHandler mHandler;
1005 dispatch_queue_t mQueue;
1008 class CHIPDoorLockClusterUnlockDoorResponseCallbackBridge : public Callback::Callback<DoorLockClusterUnlockDoorResponseCallback> {
1010 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1011 : Callback::Callback<DoorLockClusterUnlockDoorResponseCallback>(CallbackFn, this)
1017 ~CHIPDoorLockClusterUnlockDoorResponseCallbackBridge() {};
1019 static void CallbackFn(void * context)
1021 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * callback
1022 = reinterpret_cast<CHIPDoorLockClusterUnlockDoorResponseCallbackBridge *>(context);
1023 if (callback && callback->mQueue) {
1024 dispatch_async(callback->mQueue, ^{
1025 callback->mHandler(nil, @ {});
1033 ResponseHandler mHandler;
1034 dispatch_queue_t mQueue;
1037 class CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge
1038 : public Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback> {
1040 CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1041 : Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback>(CallbackFn, this)
1047 ~CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge() {};
1049 static void CallbackFn(void * context)
1051 CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge * callback
1052 = reinterpret_cast<CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge *>(context);
1053 if (callback && callback->mQueue) {
1054 dispatch_async(callback->mQueue, ^{
1055 callback->mHandler(nil, @ {});
1063 ResponseHandler mHandler;
1064 dispatch_queue_t mQueue;
1067 class CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge
1068 : public Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback> {
1070 CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1071 : Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback>(CallbackFn, this)
1077 ~CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge() {};
1079 static void CallbackFn(void * context, uint8_t errorCode, uint8_t * debugText)
1081 CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge * callback
1082 = reinterpret_cast<CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge *>(context);
1083 if (callback && callback->mQueue) {
1084 dispatch_async(callback->mQueue, ^{
1085 callback->mHandler(nil, @ {
1086 @"errorCode" : [NSNumber numberWithUnsignedChar:errorCode],
1087 @"debugText" : [NSString stringWithFormat:@"%s", debugText],
1096 ResponseHandler mHandler;
1097 dispatch_queue_t mQueue;
1100 class CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge
1101 : public Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback> {
1103 CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1104 : Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback>(CallbackFn, this)
1110 ~CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge() {};
1112 static void CallbackFn(void * context, uint8_t errorCode, uint8_t * debugText)
1114 CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge * callback
1115 = reinterpret_cast<CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge *>(context);
1116 if (callback && callback->mQueue) {
1117 dispatch_async(callback->mQueue, ^{
1118 callback->mHandler(nil, @ {
1119 @"errorCode" : [NSNumber numberWithUnsignedChar:errorCode],
1120 @"debugText" : [NSString stringWithFormat:@"%s", debugText],
1129 ResponseHandler mHandler;
1130 dispatch_queue_t mQueue;
1133 class CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge
1134 : public Callback::Callback<GeneralCommissioningClusterSetFabricResponseCallback> {
1136 CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1137 : Callback::Callback<GeneralCommissioningClusterSetFabricResponseCallback>(CallbackFn, this)
1143 ~CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge() {};
1145 static void CallbackFn(void * context, uint8_t errorCode, uint8_t * debugText)
1147 CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge * callback
1148 = reinterpret_cast<CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge *>(context);
1149 if (callback && callback->mQueue) {
1150 dispatch_async(callback->mQueue, ^{
1151 callback->mHandler(nil, @ {
1152 @"errorCode" : [NSNumber numberWithUnsignedChar:errorCode],
1153 @"debugText" : [NSString stringWithFormat:@"%s", debugText],
1162 ResponseHandler mHandler;
1163 dispatch_queue_t mQueue;
1166 class CHIPGroupsClusterAddGroupResponseCallbackBridge : public Callback::Callback<GroupsClusterAddGroupResponseCallback> {
1168 CHIPGroupsClusterAddGroupResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1169 : Callback::Callback<GroupsClusterAddGroupResponseCallback>(CallbackFn, this)
1175 ~CHIPGroupsClusterAddGroupResponseCallbackBridge() {};
1177 static void CallbackFn(void * context, uint16_t groupId)
1179 CHIPGroupsClusterAddGroupResponseCallbackBridge * callback
1180 = reinterpret_cast<CHIPGroupsClusterAddGroupResponseCallbackBridge *>(context);
1181 if (callback && callback->mQueue) {
1182 dispatch_async(callback->mQueue, ^{
1183 callback->mHandler(nil, @ {
1184 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1193 ResponseHandler mHandler;
1194 dispatch_queue_t mQueue;
1197 class CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge
1198 : public Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback> {
1200 CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1201 : Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback>(CallbackFn, this)
1207 ~CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge() {};
1209 static void CallbackFn(
1210 void * context, uint8_t capacity, uint8_t groupCount, /* TYPE WARNING: array array defaults to */ uint8_t * groupList)
1212 CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge * callback
1213 = reinterpret_cast<CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge *>(context);
1214 if (callback && callback->mQueue) {
1215 dispatch_async(callback->mQueue, ^{
1216 callback->mHandler(nil, @ {
1217 @"capacity" : [NSNumber numberWithUnsignedChar:capacity],
1218 @"groupCount" : [NSNumber numberWithUnsignedChar:groupCount],
1219 // groupList: /* TYPE WARNING: array array defaults to */ uint8_t *
1220 // Conversion from this type to Objc is not properly implemented yet
1229 ResponseHandler mHandler;
1230 dispatch_queue_t mQueue;
1233 class CHIPGroupsClusterRemoveGroupResponseCallbackBridge : public Callback::Callback<GroupsClusterRemoveGroupResponseCallback> {
1235 CHIPGroupsClusterRemoveGroupResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1236 : Callback::Callback<GroupsClusterRemoveGroupResponseCallback>(CallbackFn, this)
1242 ~CHIPGroupsClusterRemoveGroupResponseCallbackBridge() {};
1244 static void CallbackFn(void * context, uint16_t groupId)
1246 CHIPGroupsClusterRemoveGroupResponseCallbackBridge * callback
1247 = reinterpret_cast<CHIPGroupsClusterRemoveGroupResponseCallbackBridge *>(context);
1248 if (callback && callback->mQueue) {
1249 dispatch_async(callback->mQueue, ^{
1250 callback->mHandler(nil, @ {
1251 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1260 ResponseHandler mHandler;
1261 dispatch_queue_t mQueue;
1264 class CHIPGroupsClusterViewGroupResponseCallbackBridge : public Callback::Callback<GroupsClusterViewGroupResponseCallback> {
1266 CHIPGroupsClusterViewGroupResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1267 : Callback::Callback<GroupsClusterViewGroupResponseCallback>(CallbackFn, this)
1273 ~CHIPGroupsClusterViewGroupResponseCallbackBridge() {};
1275 static void CallbackFn(void * context, uint16_t groupId, uint8_t * groupName)
1277 CHIPGroupsClusterViewGroupResponseCallbackBridge * callback
1278 = reinterpret_cast<CHIPGroupsClusterViewGroupResponseCallbackBridge *>(context);
1279 if (callback && callback->mQueue) {
1280 dispatch_async(callback->mQueue, ^{
1281 callback->mHandler(nil, @ {
1282 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1283 @"groupName" : [NSString stringWithFormat:@"%s", groupName],
1292 ResponseHandler mHandler;
1293 dispatch_queue_t mQueue;
1296 class CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge
1297 : public Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback> {
1299 CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1300 : Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback>(CallbackFn, this)
1306 ~CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge() {};
1308 static void CallbackFn(void * context, uint16_t timeout)
1310 CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge * callback
1311 = reinterpret_cast<CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge *>(context);
1312 if (callback && callback->mQueue) {
1313 dispatch_async(callback->mQueue, ^{
1314 callback->mHandler(nil, @ {
1315 @"timeout" : [NSNumber numberWithUnsignedShort:timeout],
1324 ResponseHandler mHandler;
1325 dispatch_queue_t mQueue;
1328 class CHIPMediaPlaybackClusterPlaybackCallbackBridge : public Callback::Callback<MediaPlaybackClusterPlaybackCallback> {
1330 CHIPMediaPlaybackClusterPlaybackCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1331 : Callback::Callback<MediaPlaybackClusterPlaybackCallback>(CallbackFn, this)
1337 ~CHIPMediaPlaybackClusterPlaybackCallbackBridge() {};
1339 static void CallbackFn(void * context)
1341 CHIPMediaPlaybackClusterPlaybackCallbackBridge * callback
1342 = reinterpret_cast<CHIPMediaPlaybackClusterPlaybackCallbackBridge *>(context);
1343 if (callback && callback->mQueue) {
1344 dispatch_async(callback->mQueue, ^{
1345 callback->mHandler(nil, @ {});
1353 ResponseHandler mHandler;
1354 dispatch_queue_t mQueue;
1357 class CHIPScenesClusterAddSceneResponseCallbackBridge : public Callback::Callback<ScenesClusterAddSceneResponseCallback> {
1359 CHIPScenesClusterAddSceneResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1360 : Callback::Callback<ScenesClusterAddSceneResponseCallback>(CallbackFn, this)
1366 ~CHIPScenesClusterAddSceneResponseCallbackBridge() {};
1368 static void CallbackFn(void * context, uint16_t groupId, uint8_t sceneId)
1370 CHIPScenesClusterAddSceneResponseCallbackBridge * callback
1371 = reinterpret_cast<CHIPScenesClusterAddSceneResponseCallbackBridge *>(context);
1372 if (callback && callback->mQueue) {
1373 dispatch_async(callback->mQueue, ^{
1374 callback->mHandler(nil, @ {
1375 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1376 @"sceneId" : [NSNumber numberWithUnsignedChar:sceneId],
1385 ResponseHandler mHandler;
1386 dispatch_queue_t mQueue;
1389 class CHIPScenesClusterGetSceneMembershipResponseCallbackBridge
1390 : public Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback> {
1392 CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1393 : Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback>(CallbackFn, this)
1399 ~CHIPScenesClusterGetSceneMembershipResponseCallbackBridge() {};
1401 static void CallbackFn(void * context, uint8_t capacity, uint16_t groupId, uint8_t sceneCount,
1402 /* TYPE WARNING: array array defaults to */ uint8_t * sceneList)
1404 CHIPScenesClusterGetSceneMembershipResponseCallbackBridge * callback
1405 = reinterpret_cast<CHIPScenesClusterGetSceneMembershipResponseCallbackBridge *>(context);
1406 if (callback && callback->mQueue) {
1407 dispatch_async(callback->mQueue, ^{
1408 callback->mHandler(nil, @ {
1409 @"capacity" : [NSNumber numberWithUnsignedChar:capacity],
1410 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1411 @"sceneCount" : [NSNumber numberWithUnsignedChar:sceneCount],
1412 // sceneList: /* TYPE WARNING: array array defaults to */ uint8_t *
1413 // Conversion from this type to Objc is not properly implemented yet
1422 ResponseHandler mHandler;
1423 dispatch_queue_t mQueue;
1426 class CHIPScenesClusterRemoveAllScenesResponseCallbackBridge
1427 : public Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback> {
1429 CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1430 : Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback>(CallbackFn, this)
1436 ~CHIPScenesClusterRemoveAllScenesResponseCallbackBridge() {};
1438 static void CallbackFn(void * context, uint16_t groupId)
1440 CHIPScenesClusterRemoveAllScenesResponseCallbackBridge * callback
1441 = reinterpret_cast<CHIPScenesClusterRemoveAllScenesResponseCallbackBridge *>(context);
1442 if (callback && callback->mQueue) {
1443 dispatch_async(callback->mQueue, ^{
1444 callback->mHandler(nil, @ {
1445 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1454 ResponseHandler mHandler;
1455 dispatch_queue_t mQueue;
1458 class CHIPScenesClusterRemoveSceneResponseCallbackBridge : public Callback::Callback<ScenesClusterRemoveSceneResponseCallback> {
1460 CHIPScenesClusterRemoveSceneResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1461 : Callback::Callback<ScenesClusterRemoveSceneResponseCallback>(CallbackFn, this)
1467 ~CHIPScenesClusterRemoveSceneResponseCallbackBridge() {};
1469 static void CallbackFn(void * context, uint16_t groupId, uint8_t sceneId)
1471 CHIPScenesClusterRemoveSceneResponseCallbackBridge * callback
1472 = reinterpret_cast<CHIPScenesClusterRemoveSceneResponseCallbackBridge *>(context);
1473 if (callback && callback->mQueue) {
1474 dispatch_async(callback->mQueue, ^{
1475 callback->mHandler(nil, @ {
1476 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1477 @"sceneId" : [NSNumber numberWithUnsignedChar:sceneId],
1486 ResponseHandler mHandler;
1487 dispatch_queue_t mQueue;
1490 class CHIPScenesClusterStoreSceneResponseCallbackBridge : public Callback::Callback<ScenesClusterStoreSceneResponseCallback> {
1492 CHIPScenesClusterStoreSceneResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1493 : Callback::Callback<ScenesClusterStoreSceneResponseCallback>(CallbackFn, this)
1499 ~CHIPScenesClusterStoreSceneResponseCallbackBridge() {};
1501 static void CallbackFn(void * context, uint16_t groupId, uint8_t sceneId)
1503 CHIPScenesClusterStoreSceneResponseCallbackBridge * callback
1504 = reinterpret_cast<CHIPScenesClusterStoreSceneResponseCallbackBridge *>(context);
1505 if (callback && callback->mQueue) {
1506 dispatch_async(callback->mQueue, ^{
1507 callback->mHandler(nil, @ {
1508 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1509 @"sceneId" : [NSNumber numberWithUnsignedChar:sceneId],
1518 ResponseHandler mHandler;
1519 dispatch_queue_t mQueue;
1522 class CHIPScenesClusterViewSceneResponseCallbackBridge : public Callback::Callback<ScenesClusterViewSceneResponseCallback> {
1524 CHIPScenesClusterViewSceneResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
1525 : Callback::Callback<ScenesClusterViewSceneResponseCallback>(CallbackFn, this)
1531 ~CHIPScenesClusterViewSceneResponseCallbackBridge() {};
1533 static void CallbackFn(void * context, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, uint8_t * sceneName,
1534 /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets)
1536 CHIPScenesClusterViewSceneResponseCallbackBridge * callback
1537 = reinterpret_cast<CHIPScenesClusterViewSceneResponseCallbackBridge *>(context);
1538 if (callback && callback->mQueue) {
1539 dispatch_async(callback->mQueue, ^{
1540 callback->mHandler(nil, @ {
1541 @"groupId" : [NSNumber numberWithUnsignedShort:groupId],
1542 @"sceneId" : [NSNumber numberWithUnsignedChar:sceneId],
1543 @"transitionTime" : [NSNumber numberWithUnsignedShort:transitionTime],
1544 @"sceneName" : [NSString stringWithFormat:@"%s", sceneName],
1545 // extensionFieldSets: /* TYPE WARNING: array array defaults to */ uint8_t *
1546 // Conversion from this type to Objc is not properly implemented yet
1555 ResponseHandler mHandler;
1556 dispatch_queue_t mQueue;
1559 @interface CHIPCluster ()
1560 @property (readonly, nonatomic) dispatch_queue_t callbackQueue;
1561 - (Controller::ClusterBase *)getCluster;
1564 @implementation CHIPCluster
1565 - (instancetype)initWithDevice:(CHIPDevice *)device endpoint:(EndpointId)endpoint queue:(dispatch_queue_t)queue
1567 if (self = [super init]) {
1568 Controller::ClusterBase * cppCluster = [self getCluster];
1569 if (cppCluster == nullptr) {
1573 CHIP_ERROR err = cppCluster->Associate([device internalDevice], endpoint);
1574 if (err != CHIP_NO_ERROR) {
1578 _callbackQueue = queue;
1583 - (Controller::ClusterBase *)getCluster
1589 @interface CHIPApplicationBasic ()
1590 @property (readonly) Controller::ApplicationBasicCluster cppCluster;
1593 @implementation CHIPApplicationBasic
1595 - (Controller::ClusterBase *)getCluster
1597 return &_cppCluster;
1600 - (void)readAttributeVendorName:(ResponseHandler)completionHandler
1602 CHIPUnsupportedAttributeCallbackBridge * onSuccess
1603 = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1605 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1609 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1612 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1616 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
1617 if (err != CHIP_NO_ERROR) {
1620 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1624 - (void)readAttributeVendorId:(ResponseHandler)completionHandler
1626 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1628 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1632 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1635 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1639 CHIP_ERROR err = self.cppCluster.ReadAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel());
1640 if (err != CHIP_NO_ERROR) {
1643 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1647 - (void)readAttributeApplicationName:(ResponseHandler)completionHandler
1649 CHIPUnsupportedAttributeCallbackBridge * onSuccess
1650 = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1652 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1656 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1659 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1663 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationName(onSuccess->Cancel(), onFailure->Cancel());
1664 if (err != CHIP_NO_ERROR) {
1667 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1671 - (void)readAttributeProductId:(ResponseHandler)completionHandler
1673 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1675 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1679 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1682 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1686 CHIP_ERROR err = self.cppCluster.ReadAttributeProductId(onSuccess->Cancel(), onFailure->Cancel());
1687 if (err != CHIP_NO_ERROR) {
1690 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1694 - (void)readAttributeApplicationId:(ResponseHandler)completionHandler
1696 CHIPUnsupportedAttributeCallbackBridge * onSuccess
1697 = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1699 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1703 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1706 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1710 CHIP_ERROR err = self.cppCluster.ReadAttributeApplicationId(onSuccess->Cancel(), onFailure->Cancel());
1711 if (err != CHIP_NO_ERROR) {
1714 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1718 - (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler
1720 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1722 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1726 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1729 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1733 CHIP_ERROR err = self.cppCluster.ReadAttributeCatalogVendorId(onSuccess->Cancel(), onFailure->Cancel());
1734 if (err != CHIP_NO_ERROR) {
1737 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1741 - (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler
1743 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
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.ReadAttributeApplicationSatus(onSuccess->Cancel(), onFailure->Cancel());
1757 if (err != CHIP_NO_ERROR) {
1760 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1764 - (void)readAttributeClusterRevision:(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.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
1780 if (err != CHIP_NO_ERROR) {
1783 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1789 @interface CHIPBarrierControl ()
1790 @property (readonly) Controller::BarrierControlCluster cppCluster;
1793 @implementation CHIPBarrierControl
1795 - (Controller::ClusterBase *)getCluster
1797 return &_cppCluster;
1800 - (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler
1802 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1804 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1808 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1811 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1815 CHIP_ERROR err = self.cppCluster.BarrierControlGoToPercent(onSuccess->Cancel(), onFailure->Cancel(), percentOpen);
1816 if (err != CHIP_NO_ERROR) {
1819 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1822 - (void)barrierControlStop:(ResponseHandler)completionHandler
1824 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1826 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1830 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1833 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1837 CHIP_ERROR err = self.cppCluster.BarrierControlStop(onSuccess->Cancel(), onFailure->Cancel());
1838 if (err != CHIP_NO_ERROR) {
1841 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1845 - (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler
1847 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
1849 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1853 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1856 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1860 CHIP_ERROR err = self.cppCluster.ReadAttributeBarrierMovingState(onSuccess->Cancel(), onFailure->Cancel());
1861 if (err != CHIP_NO_ERROR) {
1864 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1868 - (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler
1870 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(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.ReadAttributeBarrierSafetyStatus(onSuccess->Cancel(), onFailure->Cancel());
1884 if (err != CHIP_NO_ERROR) {
1887 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1891 - (void)readAttributeBarrierCapabilities:(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.ReadAttributeBarrierCapabilities(onSuccess->Cancel(), onFailure->Cancel());
1907 if (err != CHIP_NO_ERROR) {
1910 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1914 - (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler
1916 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(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.ReadAttributeBarrierPosition(onSuccess->Cancel(), onFailure->Cancel());
1930 if (err != CHIP_NO_ERROR) {
1933 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1937 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
1939 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(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.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
1953 if (err != CHIP_NO_ERROR) {
1956 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1962 @interface CHIPBasic ()
1963 @property (readonly) Controller::BasicCluster cppCluster;
1966 @implementation CHIPBasic
1968 - (Controller::ClusterBase *)getCluster
1970 return &_cppCluster;
1973 - (void)mfgSpecificPing:(ResponseHandler)completionHandler
1975 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1977 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1981 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
1984 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
1988 CHIP_ERROR err = self.cppCluster.MfgSpecificPing(onSuccess->Cancel(), onFailure->Cancel());
1989 if (err != CHIP_NO_ERROR) {
1992 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
1995 - (void)resetToFactoryDefaults:(ResponseHandler)completionHandler
1997 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
1999 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2003 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2006 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2010 CHIP_ERROR err = self.cppCluster.ResetToFactoryDefaults(onSuccess->Cancel(), onFailure->Cancel());
2011 if (err != CHIP_NO_ERROR) {
2014 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2018 - (void)readAttributeZclVersion:(ResponseHandler)completionHandler
2020 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2022 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2026 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2029 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2033 CHIP_ERROR err = self.cppCluster.ReadAttributeZclVersion(onSuccess->Cancel(), onFailure->Cancel());
2034 if (err != CHIP_NO_ERROR) {
2037 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2041 - (void)readAttributePowerSource:(ResponseHandler)completionHandler
2043 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2045 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2049 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2052 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2056 CHIP_ERROR err = self.cppCluster.ReadAttributePowerSource(onSuccess->Cancel(), onFailure->Cancel());
2057 if (err != CHIP_NO_ERROR) {
2060 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2064 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
2066 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2068 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2072 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2075 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2079 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
2080 if (err != CHIP_NO_ERROR) {
2083 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2089 @interface CHIPBinding ()
2090 @property (readonly) Controller::BindingCluster cppCluster;
2093 @implementation CHIPBinding
2095 - (Controller::ClusterBase *)getCluster
2097 return &_cppCluster;
2100 - (void)bind:(uint64_t)nodeId
2101 groupId:(uint16_t)groupId
2102 endpointId:(uint8_t)endpointId
2103 clusterId:(uint16_t)clusterId
2104 completionHandler:(ResponseHandler)completionHandler
2106 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2108 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2112 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2115 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2119 CHIP_ERROR err = self.cppCluster.Bind(onSuccess->Cancel(), onFailure->Cancel(), nodeId, groupId, endpointId, clusterId);
2120 if (err != CHIP_NO_ERROR) {
2123 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2126 - (void)unbind:(uint64_t)nodeId
2127 groupId:(uint16_t)groupId
2128 endpointId:(uint8_t)endpointId
2129 clusterId:(uint16_t)clusterId
2130 completionHandler:(ResponseHandler)completionHandler
2132 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2134 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2138 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2141 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2145 CHIP_ERROR err = self.cppCluster.Unbind(onSuccess->Cancel(), onFailure->Cancel(), nodeId, groupId, endpointId, clusterId);
2146 if (err != CHIP_NO_ERROR) {
2149 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2153 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
2155 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2157 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2161 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2164 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2168 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
2169 if (err != CHIP_NO_ERROR) {
2172 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2178 @interface CHIPColorControl ()
2179 @property (readonly) Controller::ColorControlCluster cppCluster;
2182 @implementation CHIPColorControl
2184 - (Controller::ClusterBase *)getCluster
2186 return &_cppCluster;
2189 - (void)moveColor:(int16_t)rateX
2190 rateY:(int16_t)rateY
2191 optionsMask:(uint8_t)optionsMask
2192 optionsOverride:(uint8_t)optionsOverride
2193 completionHandler:(ResponseHandler)completionHandler
2195 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2197 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2201 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2204 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2209 = self.cppCluster.MoveColor(onSuccess->Cancel(), onFailure->Cancel(), rateX, rateY, optionsMask, optionsOverride);
2210 if (err != CHIP_NO_ERROR) {
2213 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2216 - (void)moveColorTemperature:(uint8_t)moveMode
2218 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
2219 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
2220 optionsMask:(uint8_t)optionsMask
2221 optionsOverride:(uint8_t)optionsOverride
2222 completionHandler:(ResponseHandler)completionHandler
2224 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2226 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2230 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2233 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2237 CHIP_ERROR err = self.cppCluster.MoveColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate,
2238 colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
2239 if (err != CHIP_NO_ERROR) {
2242 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2245 - (void)moveHue:(uint8_t)moveMode
2247 optionsMask:(uint8_t)optionsMask
2248 optionsOverride:(uint8_t)optionsOverride
2249 completionHandler:(ResponseHandler)completionHandler
2251 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2253 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2257 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2260 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2265 = self.cppCluster.MoveHue(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
2266 if (err != CHIP_NO_ERROR) {
2269 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2272 - (void)moveSaturation:(uint8_t)moveMode
2274 optionsMask:(uint8_t)optionsMask
2275 optionsOverride:(uint8_t)optionsOverride
2276 completionHandler:(ResponseHandler)completionHandler
2278 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2280 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2284 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2287 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2292 = self.cppCluster.MoveSaturation(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionsMask, optionsOverride);
2293 if (err != CHIP_NO_ERROR) {
2296 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2299 - (void)moveToColor:(uint16_t)colorX
2300 colorY:(uint16_t)colorY
2301 transitionTime:(uint16_t)transitionTime
2302 optionsMask:(uint8_t)optionsMask
2303 optionsOverride:(uint8_t)optionsOverride
2304 completionHandler:(ResponseHandler)completionHandler
2306 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(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.MoveToColor(
2320 onSuccess->Cancel(), onFailure->Cancel(), colorX, colorY, transitionTime, optionsMask, optionsOverride);
2321 if (err != CHIP_NO_ERROR) {
2324 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2327 - (void)moveToColorTemperature:(uint16_t)colorTemperature
2328 transitionTime:(uint16_t)transitionTime
2329 optionsMask:(uint8_t)optionsMask
2330 optionsOverride:(uint8_t)optionsOverride
2331 completionHandler:(ResponseHandler)completionHandler
2333 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2335 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2339 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2342 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2346 CHIP_ERROR err = self.cppCluster.MoveToColorTemperature(
2347 onSuccess->Cancel(), onFailure->Cancel(), colorTemperature, transitionTime, optionsMask, optionsOverride);
2348 if (err != CHIP_NO_ERROR) {
2351 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2354 - (void)moveToHue:(uint8_t)hue
2355 direction:(uint8_t)direction
2356 transitionTime:(uint16_t)transitionTime
2357 optionsMask:(uint8_t)optionsMask
2358 optionsOverride:(uint8_t)optionsOverride
2359 completionHandler:(ResponseHandler)completionHandler
2361 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2363 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2367 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2370 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2374 CHIP_ERROR err = self.cppCluster.MoveToHue(
2375 onSuccess->Cancel(), onFailure->Cancel(), hue, direction, transitionTime, optionsMask, optionsOverride);
2376 if (err != CHIP_NO_ERROR) {
2379 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2382 - (void)moveToHueAndSaturation:(uint8_t)hue
2383 saturation:(uint8_t)saturation
2384 transitionTime:(uint16_t)transitionTime
2385 optionsMask:(uint8_t)optionsMask
2386 optionsOverride:(uint8_t)optionsOverride
2387 completionHandler:(ResponseHandler)completionHandler
2389 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2391 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2395 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2398 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2402 CHIP_ERROR err = self.cppCluster.MoveToHueAndSaturation(
2403 onSuccess->Cancel(), onFailure->Cancel(), hue, saturation, transitionTime, optionsMask, optionsOverride);
2404 if (err != CHIP_NO_ERROR) {
2407 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2410 - (void)moveToSaturation:(uint8_t)saturation
2411 transitionTime:(uint16_t)transitionTime
2412 optionsMask:(uint8_t)optionsMask
2413 optionsOverride:(uint8_t)optionsOverride
2414 completionHandler:(ResponseHandler)completionHandler
2416 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2418 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2422 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2425 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2429 CHIP_ERROR err = self.cppCluster.MoveToSaturation(
2430 onSuccess->Cancel(), onFailure->Cancel(), saturation, transitionTime, optionsMask, optionsOverride);
2431 if (err != CHIP_NO_ERROR) {
2434 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2437 - (void)stepColor:(int16_t)stepX
2438 stepY:(int16_t)stepY
2439 transitionTime:(uint16_t)transitionTime
2440 optionsMask:(uint8_t)optionsMask
2441 optionsOverride:(uint8_t)optionsOverride
2442 completionHandler:(ResponseHandler)completionHandler
2444 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2446 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2450 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2453 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2457 CHIP_ERROR err = self.cppCluster.StepColor(
2458 onSuccess->Cancel(), onFailure->Cancel(), stepX, stepY, transitionTime, optionsMask, optionsOverride);
2459 if (err != CHIP_NO_ERROR) {
2462 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2465 - (void)stepColorTemperature:(uint8_t)stepMode
2466 stepSize:(uint16_t)stepSize
2467 transitionTime:(uint16_t)transitionTime
2468 colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum
2469 colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum
2470 optionsMask:(uint8_t)optionsMask
2471 optionsOverride:(uint8_t)optionsOverride
2472 completionHandler:(ResponseHandler)completionHandler
2474 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2476 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2480 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2483 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2487 CHIP_ERROR err = self.cppCluster.StepColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize,
2488 transitionTime, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride);
2489 if (err != CHIP_NO_ERROR) {
2492 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2495 - (void)stepHue:(uint8_t)stepMode
2496 stepSize:(uint8_t)stepSize
2497 transitionTime:(uint8_t)transitionTime
2498 optionsMask:(uint8_t)optionsMask
2499 optionsOverride:(uint8_t)optionsOverride
2500 completionHandler:(ResponseHandler)completionHandler
2502 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2504 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2508 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2511 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2515 CHIP_ERROR err = self.cppCluster.StepHue(
2516 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
2517 if (err != CHIP_NO_ERROR) {
2520 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2523 - (void)stepSaturation:(uint8_t)stepMode
2524 stepSize:(uint8_t)stepSize
2525 transitionTime:(uint8_t)transitionTime
2526 optionsMask:(uint8_t)optionsMask
2527 optionsOverride:(uint8_t)optionsOverride
2528 completionHandler:(ResponseHandler)completionHandler
2530 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2532 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2536 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2539 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2543 CHIP_ERROR err = self.cppCluster.StepSaturation(
2544 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionsMask, optionsOverride);
2545 if (err != CHIP_NO_ERROR) {
2548 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2551 - (void)stopMoveStep:(uint8_t)optionsMask
2552 optionsOverride:(uint8_t)optionsOverride
2553 completionHandler:(ResponseHandler)completionHandler
2555 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2557 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2561 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2564 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2568 CHIP_ERROR err = self.cppCluster.StopMoveStep(onSuccess->Cancel(), onFailure->Cancel(), optionsMask, optionsOverride);
2569 if (err != CHIP_NO_ERROR) {
2572 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2576 - (void)readAttributeCurrentHue:(ResponseHandler)completionHandler
2578 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2580 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2584 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2587 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2591 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
2592 if (err != CHIP_NO_ERROR) {
2595 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2599 - (void)configureAttributeCurrentHue:(uint16_t)minInterval
2600 maxInterval:(uint16_t)maxInterval
2601 change:(uint8_t)change
2602 completionHandler:(ResponseHandler)completionHandler
2604 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2606 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2610 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2613 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2618 = self.cppCluster.ConfigureAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
2619 if (err != CHIP_NO_ERROR) {
2622 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2626 - (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler
2628 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
2630 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2634 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentHue(onReport->Cancel());
2635 if (err != CHIP_NO_ERROR) {
2637 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
2641 - (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler
2643 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2645 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2649 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2652 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2656 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentSaturation(onSuccess->Cancel(), onFailure->Cancel());
2657 if (err != CHIP_NO_ERROR) {
2660 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2664 - (void)configureAttributeCurrentSaturation:(uint16_t)minInterval
2665 maxInterval:(uint16_t)maxInterval
2666 change:(uint8_t)change
2667 completionHandler:(ResponseHandler)completionHandler
2669 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2671 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2675 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2678 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2682 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentSaturation(
2683 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
2684 if (err != CHIP_NO_ERROR) {
2687 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2691 - (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler
2693 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
2695 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2699 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentSaturation(onReport->Cancel());
2700 if (err != CHIP_NO_ERROR) {
2702 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
2706 - (void)readAttributeRemainingTime:(ResponseHandler)completionHandler
2708 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2710 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2714 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2717 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2721 CHIP_ERROR err = self.cppCluster.ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel());
2722 if (err != CHIP_NO_ERROR) {
2725 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2729 - (void)readAttributeCurrentX:(ResponseHandler)completionHandler
2731 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(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.ReadAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel());
2745 if (err != CHIP_NO_ERROR) {
2748 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2752 - (void)configureAttributeCurrentX:(uint16_t)minInterval
2753 maxInterval:(uint16_t)maxInterval
2754 change:(uint16_t)change
2755 completionHandler:(ResponseHandler)completionHandler
2757 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2759 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2763 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2766 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2771 = self.cppCluster.ConfigureAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
2772 if (err != CHIP_NO_ERROR) {
2775 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2779 - (void)reportAttributeCurrentX:(ResponseHandler)reportHandler
2781 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
2783 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2787 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentX(onReport->Cancel());
2788 if (err != CHIP_NO_ERROR) {
2790 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
2794 - (void)readAttributeCurrentY:(ResponseHandler)completionHandler
2796 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2798 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2802 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2805 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2809 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel());
2810 if (err != CHIP_NO_ERROR) {
2813 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2817 - (void)configureAttributeCurrentY:(uint16_t)minInterval
2818 maxInterval:(uint16_t)maxInterval
2819 change:(uint16_t)change
2820 completionHandler:(ResponseHandler)completionHandler
2822 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2824 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2828 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2831 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2836 = self.cppCluster.ConfigureAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
2837 if (err != CHIP_NO_ERROR) {
2840 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2844 - (void)reportAttributeCurrentY:(ResponseHandler)reportHandler
2846 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
2848 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2852 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentY(onReport->Cancel());
2853 if (err != CHIP_NO_ERROR) {
2855 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
2859 - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler
2861 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2863 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2867 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2870 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2874 CHIP_ERROR err = self.cppCluster.ReadAttributeDriftCompensation(onSuccess->Cancel(), onFailure->Cancel());
2875 if (err != CHIP_NO_ERROR) {
2878 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2882 - (void)readAttributeCompensationText:(ResponseHandler)completionHandler
2884 CHIPUnsupportedAttributeCallbackBridge * onSuccess
2885 = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2887 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2891 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2894 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2898 CHIP_ERROR err = self.cppCluster.ReadAttributeCompensationText(onSuccess->Cancel(), onFailure->Cancel());
2899 if (err != CHIP_NO_ERROR) {
2902 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2906 - (void)readAttributeColorTemperature:(ResponseHandler)completionHandler
2908 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2910 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2914 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2917 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2921 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTemperature(onSuccess->Cancel(), onFailure->Cancel());
2922 if (err != CHIP_NO_ERROR) {
2925 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2929 - (void)configureAttributeColorTemperature:(uint16_t)minInterval
2930 maxInterval:(uint16_t)maxInterval
2931 change:(uint16_t)change
2932 completionHandler:(ResponseHandler)completionHandler
2934 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
2936 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2940 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2943 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2947 CHIP_ERROR err = self.cppCluster.ConfigureAttributeColorTemperature(
2948 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
2949 if (err != CHIP_NO_ERROR) {
2952 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2956 - (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler
2958 CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
2960 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2964 CHIP_ERROR err = self.cppCluster.ReportAttributeColorTemperature(onReport->Cancel());
2965 if (err != CHIP_NO_ERROR) {
2967 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
2971 - (void)readAttributeColorMode:(ResponseHandler)completionHandler
2973 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2975 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2979 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
2982 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
2986 CHIP_ERROR err = self.cppCluster.ReadAttributeColorMode(onSuccess->Cancel(), onFailure->Cancel());
2987 if (err != CHIP_NO_ERROR) {
2990 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
2994 - (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler
2996 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
2998 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3002 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3005 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3009 CHIP_ERROR err = self.cppCluster.ReadAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel());
3010 if (err != CHIP_NO_ERROR) {
3013 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3017 - (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
3019 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3021 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3025 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3028 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3032 CHIP_ERROR err = self.cppCluster.WriteAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel(), value);
3033 if (err != CHIP_NO_ERROR) {
3036 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3040 - (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler
3042 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3044 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3048 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3051 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3055 CHIP_ERROR err = self.cppCluster.ReadAttributeNumberOfPrimaries(onSuccess->Cancel(), onFailure->Cancel());
3056 if (err != CHIP_NO_ERROR) {
3059 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3063 - (void)readAttributePrimary1X:(ResponseHandler)completionHandler
3065 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3067 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3071 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3074 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3078 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1X(onSuccess->Cancel(), onFailure->Cancel());
3079 if (err != CHIP_NO_ERROR) {
3082 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3086 - (void)readAttributePrimary1Y:(ResponseHandler)completionHandler
3088 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3090 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3094 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3097 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3101 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Y(onSuccess->Cancel(), onFailure->Cancel());
3102 if (err != CHIP_NO_ERROR) {
3105 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3109 - (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler
3111 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3113 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3117 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3120 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3124 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary1Intensity(onSuccess->Cancel(), onFailure->Cancel());
3125 if (err != CHIP_NO_ERROR) {
3128 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3132 - (void)readAttributePrimary2X:(ResponseHandler)completionHandler
3134 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3136 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3140 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3143 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3147 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2X(onSuccess->Cancel(), onFailure->Cancel());
3148 if (err != CHIP_NO_ERROR) {
3151 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3155 - (void)readAttributePrimary2Y:(ResponseHandler)completionHandler
3157 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3159 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3163 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3166 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3170 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Y(onSuccess->Cancel(), onFailure->Cancel());
3171 if (err != CHIP_NO_ERROR) {
3174 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3178 - (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler
3180 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3182 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3186 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3189 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3193 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary2Intensity(onSuccess->Cancel(), onFailure->Cancel());
3194 if (err != CHIP_NO_ERROR) {
3197 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3201 - (void)readAttributePrimary3X:(ResponseHandler)completionHandler
3203 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3205 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3209 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3212 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3216 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3X(onSuccess->Cancel(), onFailure->Cancel());
3217 if (err != CHIP_NO_ERROR) {
3220 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3224 - (void)readAttributePrimary3Y:(ResponseHandler)completionHandler
3226 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3228 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3232 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3235 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3239 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Y(onSuccess->Cancel(), onFailure->Cancel());
3240 if (err != CHIP_NO_ERROR) {
3243 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3247 - (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler
3249 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3251 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3255 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3258 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3262 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary3Intensity(onSuccess->Cancel(), onFailure->Cancel());
3263 if (err != CHIP_NO_ERROR) {
3266 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3270 - (void)readAttributePrimary4X:(ResponseHandler)completionHandler
3272 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3274 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3278 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3281 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3285 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4X(onSuccess->Cancel(), onFailure->Cancel());
3286 if (err != CHIP_NO_ERROR) {
3289 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3293 - (void)readAttributePrimary4Y:(ResponseHandler)completionHandler
3295 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3297 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3301 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3304 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3308 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Y(onSuccess->Cancel(), onFailure->Cancel());
3309 if (err != CHIP_NO_ERROR) {
3312 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3316 - (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler
3318 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3320 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3324 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3327 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3331 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary4Intensity(onSuccess->Cancel(), onFailure->Cancel());
3332 if (err != CHIP_NO_ERROR) {
3335 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3339 - (void)readAttributePrimary5X:(ResponseHandler)completionHandler
3341 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3343 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3347 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3350 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3354 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5X(onSuccess->Cancel(), onFailure->Cancel());
3355 if (err != CHIP_NO_ERROR) {
3358 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3362 - (void)readAttributePrimary5Y:(ResponseHandler)completionHandler
3364 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3366 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3370 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3373 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3377 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Y(onSuccess->Cancel(), onFailure->Cancel());
3378 if (err != CHIP_NO_ERROR) {
3381 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3385 - (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler
3387 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3389 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3393 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3396 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3400 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary5Intensity(onSuccess->Cancel(), onFailure->Cancel());
3401 if (err != CHIP_NO_ERROR) {
3404 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3408 - (void)readAttributePrimary6X:(ResponseHandler)completionHandler
3410 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3412 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3416 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3419 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3423 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6X(onSuccess->Cancel(), onFailure->Cancel());
3424 if (err != CHIP_NO_ERROR) {
3427 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3431 - (void)readAttributePrimary6Y:(ResponseHandler)completionHandler
3433 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3435 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3439 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3442 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3446 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Y(onSuccess->Cancel(), onFailure->Cancel());
3447 if (err != CHIP_NO_ERROR) {
3450 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3454 - (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler
3456 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3458 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3462 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3465 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3469 CHIP_ERROR err = self.cppCluster.ReadAttributePrimary6Intensity(onSuccess->Cancel(), onFailure->Cancel());
3470 if (err != CHIP_NO_ERROR) {
3473 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3477 - (void)readAttributeWhitePointX:(ResponseHandler)completionHandler
3479 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3481 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3485 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3488 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3492 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel());
3493 if (err != CHIP_NO_ERROR) {
3496 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3500 - (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3502 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3504 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3508 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3511 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3515 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel(), value);
3516 if (err != CHIP_NO_ERROR) {
3519 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3523 - (void)readAttributeWhitePointY:(ResponseHandler)completionHandler
3525 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3527 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3531 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3534 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3538 CHIP_ERROR err = self.cppCluster.ReadAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel());
3539 if (err != CHIP_NO_ERROR) {
3542 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3546 - (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3548 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3550 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3554 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3557 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3561 CHIP_ERROR err = self.cppCluster.WriteAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel(), value);
3562 if (err != CHIP_NO_ERROR) {
3565 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3569 - (void)readAttributeColorPointRX:(ResponseHandler)completionHandler
3571 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3573 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3577 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3580 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3584 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel());
3585 if (err != CHIP_NO_ERROR) {
3588 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3592 - (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3594 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3596 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3600 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3603 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3607 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel(), value);
3608 if (err != CHIP_NO_ERROR) {
3611 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3615 - (void)readAttributeColorPointRY:(ResponseHandler)completionHandler
3617 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3619 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3623 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3626 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3630 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel());
3631 if (err != CHIP_NO_ERROR) {
3634 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3638 - (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3640 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3642 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3646 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3649 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3653 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel(), value);
3654 if (err != CHIP_NO_ERROR) {
3657 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3661 - (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler
3663 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3665 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3669 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3672 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3676 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel());
3677 if (err != CHIP_NO_ERROR) {
3680 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3684 - (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
3686 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3688 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3692 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3695 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3699 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
3700 if (err != CHIP_NO_ERROR) {
3703 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3707 - (void)readAttributeColorPointGX:(ResponseHandler)completionHandler
3709 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3711 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3715 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3718 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3722 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel());
3723 if (err != CHIP_NO_ERROR) {
3726 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3730 - (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3732 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3734 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3738 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3741 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3745 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel(), value);
3746 if (err != CHIP_NO_ERROR) {
3749 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3753 - (void)readAttributeColorPointGY:(ResponseHandler)completionHandler
3755 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3757 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3761 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3764 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3768 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel());
3769 if (err != CHIP_NO_ERROR) {
3772 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3776 - (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3778 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3780 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3784 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3787 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3791 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel(), value);
3792 if (err != CHIP_NO_ERROR) {
3795 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3799 - (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler
3801 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3803 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3807 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3810 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3814 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel());
3815 if (err != CHIP_NO_ERROR) {
3818 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3822 - (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
3824 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3826 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3830 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3833 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3837 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
3838 if (err != CHIP_NO_ERROR) {
3841 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3845 - (void)readAttributeColorPointBX:(ResponseHandler)completionHandler
3847 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3849 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3853 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3856 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3860 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel());
3861 if (err != CHIP_NO_ERROR) {
3864 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3868 - (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3870 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3872 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3876 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3879 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3883 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel(), value);
3884 if (err != CHIP_NO_ERROR) {
3887 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3891 - (void)readAttributeColorPointBY:(ResponseHandler)completionHandler
3893 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3895 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3899 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3902 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3906 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel());
3907 if (err != CHIP_NO_ERROR) {
3910 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3914 - (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
3916 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3918 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3922 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3925 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3929 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel(), value);
3930 if (err != CHIP_NO_ERROR) {
3933 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3937 - (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler
3939 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3941 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3945 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3948 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3952 CHIP_ERROR err = self.cppCluster.ReadAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel());
3953 if (err != CHIP_NO_ERROR) {
3956 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3960 - (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler
3962 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
3964 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3968 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3971 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3975 CHIP_ERROR err = self.cppCluster.WriteAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel(), value);
3976 if (err != CHIP_NO_ERROR) {
3979 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
3983 - (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler
3985 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
3987 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3991 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
3994 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
3998 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
3999 if (err != CHIP_NO_ERROR) {
4002 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4006 - (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler
4008 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4010 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4014 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4017 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4021 CHIP_ERROR err = self.cppCluster.ReadAttributeEnhancedColorMode(onSuccess->Cancel(), onFailure->Cancel());
4022 if (err != CHIP_NO_ERROR) {
4025 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4029 - (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler
4031 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4033 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4037 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4040 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4044 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopActive(onSuccess->Cancel(), onFailure->Cancel());
4045 if (err != CHIP_NO_ERROR) {
4048 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4052 - (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler
4054 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4056 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4060 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4063 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4067 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopDirection(onSuccess->Cancel(), onFailure->Cancel());
4068 if (err != CHIP_NO_ERROR) {
4071 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4075 - (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler
4077 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4079 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4083 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4086 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4090 CHIP_ERROR err = self.cppCluster.ReadAttributeColorLoopTime(onSuccess->Cancel(), onFailure->Cancel());
4091 if (err != CHIP_NO_ERROR) {
4094 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4098 - (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler
4100 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4102 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4106 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4109 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4113 CHIP_ERROR err = self.cppCluster.ReadAttributeColorCapabilities(onSuccess->Cancel(), onFailure->Cancel());
4114 if (err != CHIP_NO_ERROR) {
4117 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4121 - (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler
4123 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4125 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4129 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4132 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4136 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMin(onSuccess->Cancel(), onFailure->Cancel());
4137 if (err != CHIP_NO_ERROR) {
4140 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4144 - (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler
4146 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4148 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4152 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4155 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4159 CHIP_ERROR err = self.cppCluster.ReadAttributeColorTempPhysicalMax(onSuccess->Cancel(), onFailure->Cancel());
4160 if (err != CHIP_NO_ERROR) {
4163 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4167 - (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler
4169 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4171 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4175 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4178 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4182 CHIP_ERROR err = self.cppCluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccess->Cancel(), onFailure->Cancel());
4183 if (err != CHIP_NO_ERROR) {
4186 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4190 - (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler
4192 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4194 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4198 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4201 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4205 CHIP_ERROR err = self.cppCluster.ReadAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel());
4206 if (err != CHIP_NO_ERROR) {
4209 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4213 - (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
4215 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4217 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4221 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4224 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4228 CHIP_ERROR err = self.cppCluster.WriteAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel(), value);
4229 if (err != CHIP_NO_ERROR) {
4232 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4236 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4238 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4240 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4244 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4247 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4251 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4252 if (err != CHIP_NO_ERROR) {
4255 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4261 @interface CHIPContentLaunch ()
4262 @property (readonly) Controller::ContentLaunchCluster cppCluster;
4265 @implementation CHIPContentLaunch
4267 - (Controller::ClusterBase *)getCluster
4269 return &_cppCluster;
4272 - (void)launchContent:(ResponseHandler)completionHandler
4274 CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * onSuccess
4275 = new CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(completionHandler, [self callbackQueue]);
4277 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4281 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4284 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4288 CHIP_ERROR err = self.cppCluster.LaunchContent(onSuccess->Cancel(), onFailure->Cancel());
4289 if (err != CHIP_NO_ERROR) {
4292 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4295 - (void)launchURL:(ResponseHandler)completionHandler
4297 CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * onSuccess
4298 = new CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(completionHandler, [self callbackQueue]);
4300 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4304 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4307 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4311 CHIP_ERROR err = self.cppCluster.LaunchURL(onSuccess->Cancel(), onFailure->Cancel());
4312 if (err != CHIP_NO_ERROR) {
4315 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4319 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
4321 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4323 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4327 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4330 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4334 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
4335 if (err != CHIP_NO_ERROR) {
4338 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4344 @interface CHIPDoorLock ()
4345 @property (readonly) Controller::DoorLockCluster cppCluster;
4348 @implementation CHIPDoorLock
4350 - (Controller::ClusterBase *)getCluster
4352 return &_cppCluster;
4355 - (void)clearAllPins:(ResponseHandler)completionHandler
4357 CHIPDoorLockClusterClearAllPinsResponseCallbackBridge * onSuccess
4358 = new CHIPDoorLockClusterClearAllPinsResponseCallbackBridge(completionHandler, [self callbackQueue]);
4360 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4364 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4367 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4371 CHIP_ERROR err = self.cppCluster.ClearAllPins(onSuccess->Cancel(), onFailure->Cancel());
4372 if (err != CHIP_NO_ERROR) {
4375 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4378 - (void)clearAllRfids:(ResponseHandler)completionHandler
4380 CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge * onSuccess
4381 = new CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge(completionHandler, [self callbackQueue]);
4383 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4387 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4390 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4394 CHIP_ERROR err = self.cppCluster.ClearAllRfids(onSuccess->Cancel(), onFailure->Cancel());
4395 if (err != CHIP_NO_ERROR) {
4398 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4401 - (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
4403 CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge * onSuccess
4404 = new CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4406 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4410 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4413 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4417 CHIP_ERROR err = self.cppCluster.ClearHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
4418 if (err != CHIP_NO_ERROR) {
4421 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4424 - (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4426 CHIPDoorLockClusterClearPinResponseCallbackBridge * onSuccess
4427 = new CHIPDoorLockClusterClearPinResponseCallbackBridge(completionHandler, [self callbackQueue]);
4429 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4433 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4436 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4440 CHIP_ERROR err = self.cppCluster.ClearPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
4441 if (err != CHIP_NO_ERROR) {
4444 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4447 - (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4449 CHIPDoorLockClusterClearRfidResponseCallbackBridge * onSuccess
4450 = new CHIPDoorLockClusterClearRfidResponseCallbackBridge(completionHandler, [self callbackQueue]);
4452 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4456 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4459 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4463 CHIP_ERROR err = self.cppCluster.ClearRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
4464 if (err != CHIP_NO_ERROR) {
4467 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4470 - (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4472 CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge * onSuccess
4473 = new CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4475 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4479 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4482 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4486 CHIP_ERROR err = self.cppCluster.ClearWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
4487 if (err != CHIP_NO_ERROR) {
4490 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4493 - (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4495 CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge * onSuccess
4496 = new CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4498 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4502 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4505 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4509 CHIP_ERROR err = self.cppCluster.ClearYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
4510 if (err != CHIP_NO_ERROR) {
4513 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4516 - (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler
4518 CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge * onSuccess
4519 = new CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4521 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4525 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4528 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4532 CHIP_ERROR err = self.cppCluster.GetHolidaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId);
4533 if (err != CHIP_NO_ERROR) {
4536 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4539 - (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler
4541 CHIPDoorLockClusterGetLogRecordResponseCallbackBridge * onSuccess
4542 = new CHIPDoorLockClusterGetLogRecordResponseCallbackBridge(completionHandler, [self callbackQueue]);
4544 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4548 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4551 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4555 CHIP_ERROR err = self.cppCluster.GetLogRecord(onSuccess->Cancel(), onFailure->Cancel(), logIndex);
4556 if (err != CHIP_NO_ERROR) {
4559 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4562 - (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4564 CHIPDoorLockClusterGetPinResponseCallbackBridge * onSuccess
4565 = new CHIPDoorLockClusterGetPinResponseCallbackBridge(completionHandler, [self callbackQueue]);
4567 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4571 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4574 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4578 CHIP_ERROR err = self.cppCluster.GetPin(onSuccess->Cancel(), onFailure->Cancel(), userId);
4579 if (err != CHIP_NO_ERROR) {
4582 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4585 - (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4587 CHIPDoorLockClusterGetRfidResponseCallbackBridge * onSuccess
4588 = new CHIPDoorLockClusterGetRfidResponseCallbackBridge(completionHandler, [self callbackQueue]);
4590 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4594 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4597 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4601 CHIP_ERROR err = self.cppCluster.GetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId);
4602 if (err != CHIP_NO_ERROR) {
4605 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4608 - (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4610 CHIPDoorLockClusterGetUserTypeResponseCallbackBridge * onSuccess
4611 = new CHIPDoorLockClusterGetUserTypeResponseCallbackBridge(completionHandler, [self callbackQueue]);
4613 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4617 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4620 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4624 CHIP_ERROR err = self.cppCluster.GetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId);
4625 if (err != CHIP_NO_ERROR) {
4628 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4631 - (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4633 CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge * onSuccess
4634 = new CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4636 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4640 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4643 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4647 CHIP_ERROR err = self.cppCluster.GetWeekdaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
4648 if (err != CHIP_NO_ERROR) {
4651 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4654 - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler
4656 CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge * onSuccess
4657 = new CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4659 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4663 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4666 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4670 CHIP_ERROR err = self.cppCluster.GetYeardaySchedule(onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId);
4671 if (err != CHIP_NO_ERROR) {
4674 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4677 - (void)lockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler
4679 CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess
4680 = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
4682 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4686 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4689 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4693 CHIP_ERROR err = self.cppCluster.LockDoor(onSuccess->Cancel(), onFailure->Cancel(), pin);
4694 if (err != CHIP_NO_ERROR) {
4697 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4700 - (void)setHolidaySchedule:(uint8_t)scheduleId
4701 localStartTime:(uint32_t)localStartTime
4702 localEndTime:(uint32_t)localEndTime
4703 operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday
4704 completionHandler:(ResponseHandler)completionHandler
4706 CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge * onSuccess
4707 = new CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4709 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4713 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4716 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4720 CHIP_ERROR err = self.cppCluster.SetHolidaySchedule(
4721 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, localStartTime, localEndTime, operatingModeDuringHoliday);
4722 if (err != CHIP_NO_ERROR) {
4725 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4728 - (void)setPin:(uint16_t)userId
4729 userStatus:(uint8_t)userStatus
4730 userType:(uint8_t)userType
4732 completionHandler:(ResponseHandler)completionHandler
4734 CHIPDoorLockClusterSetPinResponseCallbackBridge * onSuccess
4735 = new CHIPDoorLockClusterSetPinResponseCallbackBridge(completionHandler, [self callbackQueue]);
4737 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4741 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4744 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4748 CHIP_ERROR err = self.cppCluster.SetPin(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType, pin);
4749 if (err != CHIP_NO_ERROR) {
4752 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4755 - (void)setRfid:(uint16_t)userId
4756 userStatus:(uint8_t)userStatus
4757 userType:(uint8_t)userType
4759 completionHandler:(ResponseHandler)completionHandler
4761 CHIPDoorLockClusterSetRfidResponseCallbackBridge * onSuccess
4762 = new CHIPDoorLockClusterSetRfidResponseCallbackBridge(completionHandler, [self callbackQueue]);
4764 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4768 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4771 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4775 CHIP_ERROR err = self.cppCluster.SetRfid(onSuccess->Cancel(), onFailure->Cancel(), userId, userStatus, userType, id);
4776 if (err != CHIP_NO_ERROR) {
4779 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4782 - (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler
4784 CHIPDoorLockClusterSetUserTypeResponseCallbackBridge * onSuccess
4785 = new CHIPDoorLockClusterSetUserTypeResponseCallbackBridge(completionHandler, [self callbackQueue]);
4787 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4791 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4794 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4798 CHIP_ERROR err = self.cppCluster.SetUserType(onSuccess->Cancel(), onFailure->Cancel(), userId, userType);
4799 if (err != CHIP_NO_ERROR) {
4802 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4805 - (void)setWeekdaySchedule:(uint8_t)scheduleId
4806 userId:(uint16_t)userId
4807 daysMask:(uint8_t)daysMask
4808 startHour:(uint8_t)startHour
4809 startMinute:(uint8_t)startMinute
4810 endHour:(uint8_t)endHour
4811 endMinute:(uint8_t)endMinute
4812 completionHandler:(ResponseHandler)completionHandler
4814 CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge * onSuccess
4815 = new CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4817 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4821 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4824 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4828 CHIP_ERROR err = self.cppCluster.SetWeekdaySchedule(
4829 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, daysMask, startHour, startMinute, endHour, endMinute);
4830 if (err != CHIP_NO_ERROR) {
4833 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4836 - (void)setYeardaySchedule:(uint8_t)scheduleId
4837 userId:(uint16_t)userId
4838 localStartTime:(uint32_t)localStartTime
4839 localEndTime:(uint32_t)localEndTime
4840 completionHandler:(ResponseHandler)completionHandler
4842 CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge * onSuccess
4843 = new CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]);
4845 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4849 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4852 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4856 CHIP_ERROR err = self.cppCluster.SetYeardaySchedule(
4857 onSuccess->Cancel(), onFailure->Cancel(), scheduleId, userId, localStartTime, localEndTime);
4858 if (err != CHIP_NO_ERROR) {
4861 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4864 - (void)unlockDoor:(char *)pin completionHandler:(ResponseHandler)completionHandler
4866 CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess
4867 = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]);
4869 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4873 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4876 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4880 CHIP_ERROR err = self.cppCluster.UnlockDoor(onSuccess->Cancel(), onFailure->Cancel(), pin);
4881 if (err != CHIP_NO_ERROR) {
4884 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4887 - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(char *)pin completionHandler:(ResponseHandler)completionHandler
4889 CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge * onSuccess
4890 = new CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(completionHandler, [self callbackQueue]);
4892 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4896 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4899 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4903 CHIP_ERROR err = self.cppCluster.UnlockWithTimeout(onSuccess->Cancel(), onFailure->Cancel(), timeoutInSeconds, pin);
4904 if (err != CHIP_NO_ERROR) {
4907 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4911 - (void)readAttributeLockState:(ResponseHandler)completionHandler
4913 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4915 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4919 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4922 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4926 CHIP_ERROR err = self.cppCluster.ReadAttributeLockState(onSuccess->Cancel(), onFailure->Cancel());
4927 if (err != CHIP_NO_ERROR) {
4930 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4934 - (void)configureAttributeLockState:(uint16_t)minInterval
4935 maxInterval:(uint16_t)maxInterval
4936 completionHandler:(ResponseHandler)completionHandler
4938 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
4940 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4944 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4947 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4952 = self.cppCluster.ConfigureAttributeLockState(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
4953 if (err != CHIP_NO_ERROR) {
4956 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4960 - (void)reportAttributeLockState:(ResponseHandler)reportHandler
4962 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
4964 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4968 CHIP_ERROR err = self.cppCluster.ReportAttributeLockState(onReport->Cancel());
4969 if (err != CHIP_NO_ERROR) {
4971 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
4975 - (void)readAttributeLockType:(ResponseHandler)completionHandler
4977 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
4979 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4983 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
4986 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
4990 CHIP_ERROR err = self.cppCluster.ReadAttributeLockType(onSuccess->Cancel(), onFailure->Cancel());
4991 if (err != CHIP_NO_ERROR) {
4994 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
4998 - (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler
5000 CHIPBooleanAttributeCallbackBridge * onSuccess
5001 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5003 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5007 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5010 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5014 CHIP_ERROR err = self.cppCluster.ReadAttributeActuatorEnabled(onSuccess->Cancel(), onFailure->Cancel());
5015 if (err != CHIP_NO_ERROR) {
5018 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5022 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5024 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(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.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5038 if (err != CHIP_NO_ERROR) {
5041 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5047 @interface CHIPGeneralCommissioning ()
5048 @property (readonly) Controller::GeneralCommissioningCluster cppCluster;
5051 @implementation CHIPGeneralCommissioning
5053 - (Controller::ClusterBase *)getCluster
5055 return &_cppCluster;
5058 - (void)armFailSafe:(uint16_t)expiryLengthSeconds
5059 breadcrumb:(uint64_t)breadcrumb
5060 timeoutMs:(uint32_t)timeoutMs
5061 completionHandler:(ResponseHandler)completionHandler
5063 CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge * onSuccess
5064 = new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(completionHandler, [self callbackQueue]);
5066 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5070 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5073 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5078 = self.cppCluster.ArmFailSafe(onSuccess->Cancel(), onFailure->Cancel(), expiryLengthSeconds, breadcrumb, timeoutMs);
5079 if (err != CHIP_NO_ERROR) {
5082 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5085 - (void)commissioningComplete:(ResponseHandler)completionHandler
5087 CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge * onSuccess
5088 = new CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(completionHandler, [self callbackQueue]);
5090 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5094 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5097 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5101 CHIP_ERROR err = self.cppCluster.CommissioningComplete(onSuccess->Cancel(), onFailure->Cancel());
5102 if (err != CHIP_NO_ERROR) {
5105 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5108 - (void)setFabric:(NSData *)fabricId
5109 fabricSecret:(NSData *)fabricSecret
5110 breadcrumb:(uint64_t)breadcrumb
5111 timeoutMs:(uint32_t)timeoutMs
5112 completionHandler:(ResponseHandler)completionHandler
5114 CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge * onSuccess
5115 = new CHIPGeneralCommissioningClusterSetFabricResponseCallbackBridge(completionHandler, [self callbackQueue]);
5117 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5121 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5124 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5128 CHIP_ERROR err = self.cppCluster.SetFabric(onSuccess->Cancel(), onFailure->Cancel(),
5129 chip::ByteSpan((const uint8_t *) fabricId.bytes, fabricId.length),
5130 chip::ByteSpan((const uint8_t *) fabricSecret.bytes, fabricSecret.length), breadcrumb, timeoutMs);
5131 if (err != CHIP_NO_ERROR) {
5134 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5138 - (void)readAttributeFabricId:(ResponseHandler)completionHandler
5140 CHIPUnsupportedAttributeCallbackBridge * onSuccess
5141 = new CHIPUnsupportedAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5143 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5147 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5150 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5154 CHIP_ERROR err = self.cppCluster.ReadAttributeFabricId(onSuccess->Cancel(), onFailure->Cancel());
5155 if (err != CHIP_NO_ERROR) {
5158 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5162 - (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler
5164 CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5166 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5170 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5173 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5177 CHIP_ERROR err = self.cppCluster.ReadAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel());
5178 if (err != CHIP_NO_ERROR) {
5181 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5185 - (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHandler)completionHandler
5187 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5189 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5193 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5196 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5200 CHIP_ERROR err = self.cppCluster.WriteAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel(), value);
5201 if (err != CHIP_NO_ERROR) {
5204 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5208 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5210 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(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.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5224 if (err != CHIP_NO_ERROR) {
5227 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5233 @interface CHIPGroups ()
5234 @property (readonly) Controller::GroupsCluster cppCluster;
5237 @implementation CHIPGroups
5239 - (Controller::ClusterBase *)getCluster
5241 return &_cppCluster;
5244 - (void)addGroup:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler
5246 CHIPGroupsClusterAddGroupResponseCallbackBridge * onSuccess
5247 = new CHIPGroupsClusterAddGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
5249 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5253 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5256 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5260 CHIP_ERROR err = self.cppCluster.AddGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId, groupName);
5261 if (err != CHIP_NO_ERROR) {
5264 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5267 - (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(char *)groupName completionHandler:(ResponseHandler)completionHandler
5269 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5271 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5275 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5278 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5282 CHIP_ERROR err = self.cppCluster.AddGroupIfIdentifying(onSuccess->Cancel(), onFailure->Cancel(), groupId, groupName);
5283 if (err != CHIP_NO_ERROR) {
5286 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5289 - (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler
5291 CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge * onSuccess
5292 = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]);
5294 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5298 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5301 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5305 CHIP_ERROR err = self.cppCluster.GetGroupMembership(onSuccess->Cancel(), onFailure->Cancel(), groupCount, groupList);
5306 if (err != CHIP_NO_ERROR) {
5309 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5312 - (void)removeAllGroups:(ResponseHandler)completionHandler
5314 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5316 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5320 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5323 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5327 CHIP_ERROR err = self.cppCluster.RemoveAllGroups(onSuccess->Cancel(), onFailure->Cancel());
5328 if (err != CHIP_NO_ERROR) {
5331 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5334 - (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
5336 CHIPGroupsClusterRemoveGroupResponseCallbackBridge * onSuccess
5337 = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
5339 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5343 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5346 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5350 CHIP_ERROR err = self.cppCluster.RemoveGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId);
5351 if (err != CHIP_NO_ERROR) {
5354 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5357 - (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
5359 CHIPGroupsClusterViewGroupResponseCallbackBridge * onSuccess
5360 = new CHIPGroupsClusterViewGroupResponseCallbackBridge(completionHandler, [self callbackQueue]);
5362 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5366 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5369 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5373 CHIP_ERROR err = self.cppCluster.ViewGroup(onSuccess->Cancel(), onFailure->Cancel(), groupId);
5374 if (err != CHIP_NO_ERROR) {
5377 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5381 - (void)readAttributeNameSupport:(ResponseHandler)completionHandler
5383 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5385 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5389 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5392 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5396 CHIP_ERROR err = self.cppCluster.ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
5397 if (err != CHIP_NO_ERROR) {
5400 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5404 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5406 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5408 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5412 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5415 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5419 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5420 if (err != CHIP_NO_ERROR) {
5423 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5429 @interface CHIPIdentify ()
5430 @property (readonly) Controller::IdentifyCluster cppCluster;
5433 @implementation CHIPIdentify
5435 - (Controller::ClusterBase *)getCluster
5437 return &_cppCluster;
5440 - (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler
5442 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5444 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5448 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5451 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5455 CHIP_ERROR err = self.cppCluster.Identify(onSuccess->Cancel(), onFailure->Cancel(), identifyTime);
5456 if (err != CHIP_NO_ERROR) {
5459 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5462 - (void)identifyQuery:(ResponseHandler)completionHandler
5464 CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge * onSuccess
5465 = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(completionHandler, [self callbackQueue]);
5467 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5471 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5474 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5478 CHIP_ERROR err = self.cppCluster.IdentifyQuery(onSuccess->Cancel(), onFailure->Cancel());
5479 if (err != CHIP_NO_ERROR) {
5482 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5486 - (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler
5488 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5490 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5494 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5497 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5501 CHIP_ERROR err = self.cppCluster.ReadAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel());
5502 if (err != CHIP_NO_ERROR) {
5505 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5509 - (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler
5511 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5513 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5517 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5520 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5524 CHIP_ERROR err = self.cppCluster.WriteAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel(), value);
5525 if (err != CHIP_NO_ERROR) {
5528 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5532 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5534 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5536 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5540 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5543 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5547 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5548 if (err != CHIP_NO_ERROR) {
5551 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5557 @interface CHIPLevelControl ()
5558 @property (readonly) Controller::LevelControlCluster cppCluster;
5561 @implementation CHIPLevelControl
5563 - (Controller::ClusterBase *)getCluster
5565 return &_cppCluster;
5568 - (void)move:(uint8_t)moveMode
5570 optionMask:(uint8_t)optionMask
5571 optionOverride:(uint8_t)optionOverride
5572 completionHandler:(ResponseHandler)completionHandler
5574 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5576 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5580 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5583 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5587 CHIP_ERROR err = self.cppCluster.Move(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate, optionMask, optionOverride);
5588 if (err != CHIP_NO_ERROR) {
5591 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5594 - (void)moveToLevel:(uint8_t)level
5595 transitionTime:(uint16_t)transitionTime
5596 optionMask:(uint8_t)optionMask
5597 optionOverride:(uint8_t)optionOverride
5598 completionHandler:(ResponseHandler)completionHandler
5600 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5602 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5606 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5609 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5614 = self.cppCluster.MoveToLevel(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime, optionMask, optionOverride);
5615 if (err != CHIP_NO_ERROR) {
5618 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5621 - (void)moveToLevelWithOnOff:(uint8_t)level
5622 transitionTime:(uint16_t)transitionTime
5623 completionHandler:(ResponseHandler)completionHandler
5625 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5627 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5631 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5634 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5638 CHIP_ERROR err = self.cppCluster.MoveToLevelWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), level, transitionTime);
5639 if (err != CHIP_NO_ERROR) {
5642 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5645 - (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler
5647 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5649 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5653 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5656 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5660 CHIP_ERROR err = self.cppCluster.MoveWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), moveMode, rate);
5661 if (err != CHIP_NO_ERROR) {
5664 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5667 - (void)step:(uint8_t)stepMode
5668 stepSize:(uint8_t)stepSize
5669 transitionTime:(uint16_t)transitionTime
5670 optionMask:(uint8_t)optionMask
5671 optionOverride:(uint8_t)optionOverride
5672 completionHandler:(ResponseHandler)completionHandler
5674 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5676 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5680 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5683 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5687 CHIP_ERROR err = self.cppCluster.Step(
5688 onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime, optionMask, optionOverride);
5689 if (err != CHIP_NO_ERROR) {
5692 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5695 - (void)stepWithOnOff:(uint8_t)stepMode
5696 stepSize:(uint8_t)stepSize
5697 transitionTime:(uint16_t)transitionTime
5698 completionHandler:(ResponseHandler)completionHandler
5700 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5702 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5706 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5709 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5713 CHIP_ERROR err = self.cppCluster.StepWithOnOff(onSuccess->Cancel(), onFailure->Cancel(), stepMode, stepSize, transitionTime);
5714 if (err != CHIP_NO_ERROR) {
5717 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5720 - (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler
5722 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5724 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5728 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5731 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5735 CHIP_ERROR err = self.cppCluster.Stop(onSuccess->Cancel(), onFailure->Cancel(), optionMask, optionOverride);
5736 if (err != CHIP_NO_ERROR) {
5739 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5742 - (void)stopWithOnOff:(ResponseHandler)completionHandler
5744 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5746 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5750 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5753 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5757 CHIP_ERROR err = self.cppCluster.StopWithOnOff(onSuccess->Cancel(), onFailure->Cancel());
5758 if (err != CHIP_NO_ERROR) {
5761 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5765 - (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler
5767 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5769 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5773 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5776 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5780 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentLevel(onSuccess->Cancel(), onFailure->Cancel());
5781 if (err != CHIP_NO_ERROR) {
5784 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5788 - (void)configureAttributeCurrentLevel:(uint16_t)minInterval
5789 maxInterval:(uint16_t)maxInterval
5790 change:(uint8_t)change
5791 completionHandler:(ResponseHandler)completionHandler
5793 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5795 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5799 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5802 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5806 CHIP_ERROR err = self.cppCluster.ConfigureAttributeCurrentLevel(
5807 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
5808 if (err != CHIP_NO_ERROR) {
5811 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5815 - (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler
5817 CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
5819 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5823 CHIP_ERROR err = self.cppCluster.ReportAttributeCurrentLevel(onReport->Cancel());
5824 if (err != CHIP_NO_ERROR) {
5826 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
5830 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5832 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5834 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5838 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5841 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5845 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5846 if (err != CHIP_NO_ERROR) {
5849 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5855 @interface CHIPLowPower ()
5856 @property (readonly) Controller::LowPowerCluster cppCluster;
5859 @implementation CHIPLowPower
5861 - (Controller::ClusterBase *)getCluster
5863 return &_cppCluster;
5866 - (void)sleep:(ResponseHandler)completionHandler
5868 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5870 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5874 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5877 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5881 CHIP_ERROR err = self.cppCluster.Sleep(onSuccess->Cancel(), onFailure->Cancel());
5882 if (err != CHIP_NO_ERROR) {
5885 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5889 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
5891 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
5893 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5897 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5900 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5904 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
5905 if (err != CHIP_NO_ERROR) {
5908 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5914 @interface CHIPMediaPlayback ()
5915 @property (readonly) Controller::MediaPlaybackCluster cppCluster;
5918 @implementation CHIPMediaPlayback
5920 - (Controller::ClusterBase *)getCluster
5922 return &_cppCluster;
5925 - (void)fastForwardRequest:(ResponseHandler)completionHandler
5927 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5929 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5933 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5936 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5940 CHIP_ERROR err = self.cppCluster.FastForwardRequest(onSuccess->Cancel(), onFailure->Cancel());
5941 if (err != CHIP_NO_ERROR) {
5944 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5947 - (void)nextRequest:(ResponseHandler)completionHandler
5949 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5951 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5955 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5958 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5962 CHIP_ERROR err = self.cppCluster.NextRequest(onSuccess->Cancel(), onFailure->Cancel());
5963 if (err != CHIP_NO_ERROR) {
5966 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5969 - (void)pauseRequest:(ResponseHandler)completionHandler
5971 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5973 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5977 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
5980 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5984 CHIP_ERROR err = self.cppCluster.PauseRequest(onSuccess->Cancel(), onFailure->Cancel());
5985 if (err != CHIP_NO_ERROR) {
5988 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
5991 - (void)playRequest:(ResponseHandler)completionHandler
5993 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
5995 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
5999 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6002 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6006 CHIP_ERROR err = self.cppCluster.PlayRequest(onSuccess->Cancel(), onFailure->Cancel());
6007 if (err != CHIP_NO_ERROR) {
6010 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6013 - (void)previousRequest:(ResponseHandler)completionHandler
6015 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6017 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6021 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6024 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6028 CHIP_ERROR err = self.cppCluster.PreviousRequest(onSuccess->Cancel(), onFailure->Cancel());
6029 if (err != CHIP_NO_ERROR) {
6032 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6035 - (void)rewindRequest:(ResponseHandler)completionHandler
6037 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6039 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6043 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6046 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6050 CHIP_ERROR err = self.cppCluster.RewindRequest(onSuccess->Cancel(), onFailure->Cancel());
6051 if (err != CHIP_NO_ERROR) {
6054 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6057 - (void)skipBackwardRequest:(ResponseHandler)completionHandler
6059 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6061 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6065 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6068 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6072 CHIP_ERROR err = self.cppCluster.SkipBackwardRequest(onSuccess->Cancel(), onFailure->Cancel());
6073 if (err != CHIP_NO_ERROR) {
6076 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6079 - (void)skipForwardRequest:(ResponseHandler)completionHandler
6081 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6083 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6087 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6090 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6094 CHIP_ERROR err = self.cppCluster.SkipForwardRequest(onSuccess->Cancel(), onFailure->Cancel());
6095 if (err != CHIP_NO_ERROR) {
6098 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6101 - (void)startOverRequest:(ResponseHandler)completionHandler
6103 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6105 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6109 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6112 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6116 CHIP_ERROR err = self.cppCluster.StartOverRequest(onSuccess->Cancel(), onFailure->Cancel());
6117 if (err != CHIP_NO_ERROR) {
6120 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6123 - (void)stopRequest:(ResponseHandler)completionHandler
6125 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6127 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6131 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6134 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6138 CHIP_ERROR err = self.cppCluster.StopRequest(onSuccess->Cancel(), onFailure->Cancel());
6139 if (err != CHIP_NO_ERROR) {
6142 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6146 - (void)readAttributeCurrentState:(ResponseHandler)completionHandler
6148 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6150 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6154 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6157 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6161 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentState(onSuccess->Cancel(), onFailure->Cancel());
6162 if (err != CHIP_NO_ERROR) {
6165 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6169 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6171 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6173 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6177 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6180 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6184 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6185 if (err != CHIP_NO_ERROR) {
6188 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6194 @interface CHIPOnOff ()
6195 @property (readonly) Controller::OnOffCluster cppCluster;
6198 @implementation CHIPOnOff
6200 - (Controller::ClusterBase *)getCluster
6202 return &_cppCluster;
6205 - (void)off:(ResponseHandler)completionHandler
6207 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6209 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6213 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6216 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6220 CHIP_ERROR err = self.cppCluster.Off(onSuccess->Cancel(), onFailure->Cancel());
6221 if (err != CHIP_NO_ERROR) {
6224 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6227 - (void)on:(ResponseHandler)completionHandler
6229 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6231 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6235 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6238 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6242 CHIP_ERROR err = self.cppCluster.On(onSuccess->Cancel(), onFailure->Cancel());
6243 if (err != CHIP_NO_ERROR) {
6246 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6249 - (void)toggle:(ResponseHandler)completionHandler
6251 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6253 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6257 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6260 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6264 CHIP_ERROR err = self.cppCluster.Toggle(onSuccess->Cancel(), onFailure->Cancel());
6265 if (err != CHIP_NO_ERROR) {
6268 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6272 - (void)readAttributeOnOff:(ResponseHandler)completionHandler
6274 CHIPBooleanAttributeCallbackBridge * onSuccess
6275 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6277 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6281 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6284 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6288 CHIP_ERROR err = self.cppCluster.ReadAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel());
6289 if (err != CHIP_NO_ERROR) {
6292 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6296 - (void)configureAttributeOnOff:(uint16_t)minInterval
6297 maxInterval:(uint16_t)maxInterval
6298 completionHandler:(ResponseHandler)completionHandler
6300 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6302 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6306 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6309 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6313 CHIP_ERROR err = self.cppCluster.ConfigureAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval);
6314 if (err != CHIP_NO_ERROR) {
6317 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6321 - (void)reportAttributeOnOff:(ResponseHandler)reportHandler
6323 CHIPBooleanAttributeCallbackBridge * onReport
6324 = new CHIPBooleanAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
6326 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6330 CHIP_ERROR err = self.cppCluster.ReportAttributeOnOff(onReport->Cancel());
6331 if (err != CHIP_NO_ERROR) {
6333 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
6337 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6339 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6341 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6345 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6348 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6352 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6353 if (err != CHIP_NO_ERROR) {
6356 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6362 @interface CHIPScenes ()
6363 @property (readonly) Controller::ScenesCluster cppCluster;
6366 @implementation CHIPScenes
6368 - (Controller::ClusterBase *)getCluster
6370 return &_cppCluster;
6373 - (void)addScene:(uint16_t)groupId
6374 sceneId:(uint8_t)sceneId
6375 transitionTime:(uint16_t)transitionTime
6376 sceneName:(char *)sceneName
6377 clusterId:(uint16_t)clusterId
6378 length:(uint8_t)length
6379 value:(uint8_t)value
6380 completionHandler:(ResponseHandler)completionHandler
6382 CHIPScenesClusterAddSceneResponseCallbackBridge * onSuccess
6383 = new CHIPScenesClusterAddSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
6385 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6389 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6392 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6396 CHIP_ERROR err = self.cppCluster.AddScene(
6397 onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime, sceneName, clusterId, length, value);
6398 if (err != CHIP_NO_ERROR) {
6401 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6404 - (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
6406 CHIPScenesClusterGetSceneMembershipResponseCallbackBridge * onSuccess
6407 = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]);
6409 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6413 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6416 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6420 CHIP_ERROR err = self.cppCluster.GetSceneMembership(onSuccess->Cancel(), onFailure->Cancel(), groupId);
6421 if (err != CHIP_NO_ERROR) {
6424 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6427 - (void)recallScene:(uint16_t)groupId
6428 sceneId:(uint8_t)sceneId
6429 transitionTime:(uint16_t)transitionTime
6430 completionHandler:(ResponseHandler)completionHandler
6432 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6434 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6438 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6441 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6445 CHIP_ERROR err = self.cppCluster.RecallScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId, transitionTime);
6446 if (err != CHIP_NO_ERROR) {
6449 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6452 - (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler
6454 CHIPScenesClusterRemoveAllScenesResponseCallbackBridge * onSuccess
6455 = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(completionHandler, [self callbackQueue]);
6457 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6461 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6464 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6468 CHIP_ERROR err = self.cppCluster.RemoveAllScenes(onSuccess->Cancel(), onFailure->Cancel(), groupId);
6469 if (err != CHIP_NO_ERROR) {
6472 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6475 - (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
6477 CHIPScenesClusterRemoveSceneResponseCallbackBridge * onSuccess
6478 = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
6480 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6484 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6487 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6491 CHIP_ERROR err = self.cppCluster.RemoveScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
6492 if (err != CHIP_NO_ERROR) {
6495 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6498 - (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
6500 CHIPScenesClusterStoreSceneResponseCallbackBridge * onSuccess
6501 = new CHIPScenesClusterStoreSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
6503 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6507 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6510 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6514 CHIP_ERROR err = self.cppCluster.StoreScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
6515 if (err != CHIP_NO_ERROR) {
6518 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6521 - (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler
6523 CHIPScenesClusterViewSceneResponseCallbackBridge * onSuccess
6524 = new CHIPScenesClusterViewSceneResponseCallbackBridge(completionHandler, [self callbackQueue]);
6526 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6530 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6533 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6537 CHIP_ERROR err = self.cppCluster.ViewScene(onSuccess->Cancel(), onFailure->Cancel(), groupId, sceneId);
6538 if (err != CHIP_NO_ERROR) {
6541 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6545 - (void)readAttributeSceneCount:(ResponseHandler)completionHandler
6547 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6549 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6553 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6556 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6560 CHIP_ERROR err = self.cppCluster.ReadAttributeSceneCount(onSuccess->Cancel(), onFailure->Cancel());
6561 if (err != CHIP_NO_ERROR) {
6564 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6568 - (void)readAttributeCurrentScene:(ResponseHandler)completionHandler
6570 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6572 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6576 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6579 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6583 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentScene(onSuccess->Cancel(), onFailure->Cancel());
6584 if (err != CHIP_NO_ERROR) {
6587 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6591 - (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler
6593 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6595 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6599 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6602 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6606 CHIP_ERROR err = self.cppCluster.ReadAttributeCurrentGroup(onSuccess->Cancel(), onFailure->Cancel());
6607 if (err != CHIP_NO_ERROR) {
6610 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6614 - (void)readAttributeSceneValid:(ResponseHandler)completionHandler
6616 CHIPBooleanAttributeCallbackBridge * onSuccess
6617 = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6619 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6623 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6626 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6630 CHIP_ERROR err = self.cppCluster.ReadAttributeSceneValid(onSuccess->Cancel(), onFailure->Cancel());
6631 if (err != CHIP_NO_ERROR) {
6634 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6638 - (void)readAttributeNameSupport:(ResponseHandler)completionHandler
6640 CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(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.ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
6654 if (err != CHIP_NO_ERROR) {
6657 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6661 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6663 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6665 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6669 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6672 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6676 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6677 if (err != CHIP_NO_ERROR) {
6680 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6686 @interface CHIPTemperatureMeasurement ()
6687 @property (readonly) Controller::TemperatureMeasurementCluster cppCluster;
6690 @implementation CHIPTemperatureMeasurement
6692 - (Controller::ClusterBase *)getCluster
6694 return &_cppCluster;
6697 - (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler
6699 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6701 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6705 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6708 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6712 CHIP_ERROR err = self.cppCluster.ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
6713 if (err != CHIP_NO_ERROR) {
6716 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6720 - (void)configureAttributeMeasuredValue:(uint16_t)minInterval
6721 maxInterval:(uint16_t)maxInterval
6722 change:(int16_t)change
6723 completionHandler:(ResponseHandler)completionHandler
6725 CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
6727 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6731 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6734 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6738 CHIP_ERROR err = self.cppCluster.ConfigureAttributeMeasuredValue(
6739 onSuccess->Cancel(), onFailure->Cancel(), minInterval, maxInterval, change);
6740 if (err != CHIP_NO_ERROR) {
6743 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6747 - (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler
6749 CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true);
6751 reportHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6755 CHIP_ERROR err = self.cppCluster.ReportAttributeMeasuredValue(onReport->Cancel());
6756 if (err != CHIP_NO_ERROR) {
6758 reportHandler([CHIPError errorForCHIPErrorCode:err], nil);
6762 - (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler
6764 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6766 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6770 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6773 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6777 CHIP_ERROR err = self.cppCluster.ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
6778 if (err != CHIP_NO_ERROR) {
6781 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6785 - (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler
6787 CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6789 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6793 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6796 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6800 CHIP_ERROR err = self.cppCluster.ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
6801 if (err != CHIP_NO_ERROR) {
6804 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
6808 - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
6810 CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
6812 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6816 CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
6819 completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
6823 CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
6824 if (err != CHIP_NO_ERROR) {
6827 completionHandler([CHIPError errorForCHIPErrorCode:err], nil);