diff --git a/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.mm b/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.mm index 2f3eb9e8d2fc41..d26f40bfc1538b 100644 --- a/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.mm +++ b/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.mm @@ -17,47 +17,57 @@ #import +#import "MTRError_Utils.h" + #include "OpenCommissioningWindowCommand.h" CHIP_ERROR OpenCommissioningWindowCommand::RunCommand() { + mWorkQueue = dispatch_queue_create("com.chip.open_commissioning_window", DISPATCH_QUEUE_SERIAL); auto * controller = CurrentCommissioner(); - NSError * error; - __block NSString * pairingCode; + auto * device = [[MTRBaseDevice alloc] initWithNodeID:@(mNodeId) controller:controller]; + + auto * self = this; if (mCommissioningWindowOption == 0) { - [controller openPairingWindow:mNodeId duration:mCommissioningWindowTimeoutMs error:&error]; + auto * cluster = [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mWorkQueue]; + auto * params = [[MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = @(mCommissioningWindowTimeoutMs); + params.timedInvokeTimeoutMs = @(10000); + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable error) { + if (error == nil) { + self->SetCommandExitStatus(CHIP_NO_ERROR); + } else { + self->SetCommandExitStatus(MTRErrorToCHIPErrorCode(error)); + } + }]; } else { - pairingCode = [controller openPairingWindowWithPIN:mNodeId - duration:mCommissioningWindowTimeoutMs - discriminator:mDiscriminator - setupPIN:[MTRSetupPayload generateRandomPIN] - error:&error]; - } + [device + openCommissioningWindowWithSetupPasscode:[MTRSetupPayload generateRandomSetupPasscode] + discriminator:@(mDiscriminator) + duration:@(mCommissioningWindowTimeoutMs) + clientQueue:mWorkQueue + completion:^(MTRSetupPayload * _Nullable payload, NSError * error) { + if (error != nil) { + self->SetCommandExitStatus(MTRErrorToCHIPErrorCode(error)); + return; + } - if (error != nil) { - SetCommandExitStatus(error); - return CHIP_NO_ERROR; - } + if (payload == nil) { + self->SetCommandExitStatus(CHIP_ERROR_INVALID_ARGUMENT); + return; + } - // TODO: Those should be async operations and we should not claim to - // be done until they complete. As things stand, we have no idea - // how to tell when we're done, so just set a timer for slightly - // less than our command timeout to call SetCommandExitStatus. - mWorkQueue = dispatch_queue_create("com.chip.open_commissioning_window", DISPATCH_QUEUE_SERIAL); - mTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, mWorkQueue); - auto * self = this; - dispatch_source_set_event_handler(mTimer, ^{ - dispatch_source_cancel(mTimer); - mTimer = nil; - mWorkQueue = nil; - if (pairingCode != nil) { - ChipLogProgress(chipTool, "Setup code: %s\n", [pairingCode UTF8String]); - } - self->SetCommandExitStatus(CHIP_NO_ERROR); - }); - dispatch_source_set_timer( - mTimer, dispatch_time(DISPATCH_TIME_NOW, (GetWaitDuration().count() - 2000) * NSEC_PER_MSEC), DISPATCH_TIME_FOREVER, 0); - dispatch_resume(mTimer); + auto * pairingCode = [payload manualEntryCode]; + if (pairingCode == nil) { + self->SetCommandExitStatus(CHIP_ERROR_INVALID_ARGUMENT); + return; + } + + ChipLogProgress(chipTool, "Setup code: %s\n", [[payload manualEntryCode] UTF8String]); + self->SetCommandExitStatus(CHIP_NO_ERROR); + }]; + } return CHIP_NO_ERROR; } diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/MultiAdmin/MultiAdminViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/MultiAdmin/MultiAdminViewController.m index 1a4524faa0f481..43f4894b9a0531 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/MultiAdmin/MultiAdminViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/MultiAdmin/MultiAdminViewController.m @@ -199,7 +199,6 @@ - (IBAction)overrideControls:(id)sender - (IBAction)openPairingWindow:(id)sender { - NSUInteger setupPIN = [MTRSetupPayload generateRandomPIN]; [_deviceSelector forSelectedDevices:^(uint64_t deviceId) { if (MTRGetConnectedDeviceWithID(deviceId, ^(MTRBaseDevice * _Nullable chipDevice, NSError * _Nullable error) { if (chipDevice) { @@ -209,9 +208,6 @@ - (IBAction)openPairingWindow:(id)sender } int timeout = [timeoutStr intValue]; - NSString * output; - NSError * error; - MTRDeviceController * controller = InitializeMTR(); if ([self.useOnboardingTokenSwitch isOn]) { NSString * discriminatorStr = [self.discriminatorField text]; if (discriminatorStr.length == 0) { @@ -219,26 +215,53 @@ - (IBAction)openPairingWindow:(id)sender } NSInteger discriminator = [discriminatorStr intValue]; - output = [controller openPairingWindowWithPIN:deviceId - duration:timeout - discriminator:discriminator - setupPIN:setupPIN - error:&error]; - - if (output != nil) { - NSString * result = [@"Use Manual Code: " stringByAppendingString:output]; - [self updateResult:result]; - } else { - [self updateResult:@"Failed in opening the pairing window"]; - } + __auto_type setupPasscode = [MTRSetupPayload generateRandomSetupPasscode]; + [chipDevice + openCommissioningWindowWithSetupPasscode:setupPasscode + discriminator:@(discriminator) + duration:@(timeout) + clientQueue:dispatch_get_main_queue() + completion:^( + MTRSetupPayload * _Nullable payload, NSError * _Nullable error) { + NSString * _Nullable code = nil; + if (payload != nil) { + code = [payload manualEntryCode]; + } + + if (code != nil) { + NSString * result = + [@"Use Manual Code: " stringByAppendingString:code]; + [self updateResult:result]; + } else { + NSString * errorDesc; + if (error == nil) { + errorDesc = @"Failed to generate manual code"; + } else { + errorDesc = error.localizedDescription; + } + [self updateResult:[@"Failed in opening the pairing window" + stringByAppendingString:errorDesc]]; + } + }]; } else { - BOOL didSend = [controller openPairingWindow:deviceId duration:timeout error:&error]; - if (didSend) { - [self updateResult:@"Scan the QR code on the device"]; - } else { - NSString * errorString = [@"Error: " stringByAppendingString:error.localizedDescription]; - [self updateResult:errorString]; - } + __auto_type * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:chipDevice + endpoint:0 + queue:dispatch_get_main_queue()]; + __auto_type * params = + [[MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = @(timeout); + params.timedInvokeTimeoutMs = @(10000); + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable error) { + if (error == nil) { + [self updateResult:@"Scan the QR code on the device"]; + } else { + NSString * errorString = + [@"Error: " stringByAppendingString:error.localizedDescription]; + [self updateResult:errorString]; + } + }]; } } else { [self updateResult:[NSString stringWithFormat:@"Failed to establish a connection with the device"]]; diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.h b/src/darwin/Framework/CHIP/MTRBaseDevice.h index f2b3e01a7e6fcf..9b60d6d8488f2e 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.h @@ -17,6 +17,8 @@ #import +@class MTRSetupPayload; + NS_ASSUME_NONNULL_BEGIN /** @@ -87,6 +89,11 @@ typedef void (^MTRDeviceErrorHandler)(NSError * error); */ typedef void (^MTRDeviceResubscriptionScheduledHandler)(NSError * error, NSNumber * resubscriptionDelay); +/** + * Handler for openCommissioningWindow. + */ +typedef void (^MTRDeviceOpenCommissioningWindowHandler)(MTRSetupPayload * _Nullable payload, NSError * _Nullable error); + extern NSString * const MTRAttributePathKey; extern NSString * const MTRCommandPathKey; extern NSString * const MTREventPathKey; @@ -109,12 +116,21 @@ extern NSString * const MTRArrayValueType; @class MTRAttributeCacheContainer; @class MTRReadParams; @class MTRSubscribeParams; +@class MTRDeviceController; @interface MTRBaseDevice : NSObject - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; +/** + * Initialize the device object with the given node id and controller. This + * will always succeed, even if there is no such node id on the controller's + * fabric, but attempts to actually use the MTRBaseDevice will fail + * (asynchronously) in that case. + */ +- (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller; + /** * Subscribe to receive attribute reports for everything (all endpoints, all * clusters, all attributes, all events) on the device. @@ -238,6 +254,26 @@ extern NSString * const MTRArrayValueType; */ - (void)deregisterReportHandlersWithClientQueue:(dispatch_queue_t)clientQueue completion:(void (^)(void))completion; +/** + * Open a commissioning window on the device. + * + * On success, completion will be called with the MTRSetupPayload that + * can be used to commission the device. + * + * @param setupPasscode The setup passcode to use for the commissioning window. + * See MTRSetupPayload's generateRandomSetupPasscode for + * generating a valid random passcode. + * @param discriminator The discriminator to use for the commissionable + * advertisement. + * @param duration Duration, in seconds, during which the commissioning + * window will be open. + */ +- (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode + discriminator:(NSNumber *)discriminator + duration:(NSNumber *)duration + clientQueue:(dispatch_queue_t)clientQueue + completion:(MTRDeviceOpenCommissioningWindowHandler)completion; + @end @interface MTRAttributePath : NSObject diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index d5ffc41f529127..9d7b93061512b3 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -24,6 +24,7 @@ #import "MTRError_Internal.h" #import "MTREventTLVValueDecoder_Internal.h" #import "MTRLogging.h" +#import "MTRSetupPayload_Internal.h" #include "app/ConcreteAttributePath.h" #include "app/ConcreteCommandPath.h" @@ -36,8 +37,12 @@ #include #include #include +#include #include #include +#include +#include +#include #include @@ -75,6 +80,7 @@ @interface MTRBaseDevice () @property (nonatomic, readwrite) NSMutableDictionary * reportHandlerBridges; - (chip::NodeId)deviceID; +- (BOOL)isPASEDevice; @end @interface MTRReadClientContainer : NSObject @@ -235,11 +241,11 @@ - (instancetype)initWithPASEDevice:(chip::DeviceProxy *)device controller:(MTRDe return self; } -- (instancetype)initWithNodeID:(chip::NodeId)nodeID controller:(MTRDeviceController *)controller +- (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller { if (self = [super init]) { _cppPASEDevice = nil; - _nodeID = nodeID; + _nodeID = [nodeID unsignedLongLongValue]; _deviceController = controller; } return self; @@ -259,9 +265,14 @@ - (instancetype)initWithNodeID:(chip::NodeId)nodeID controller:(MTRDeviceControl return self.nodeID; } +- (BOOL)isPASEDevice +{ + return _cppPASEDevice != nullptr; +} + - (void)invalidateCASESession { - if (self.paseDevice) { + if (self.isPASEDevice) { return; } @@ -298,7 +309,7 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue subscriptionEstablished:(nullable void (^)(void))subscriptionEstablishedHandler resubscriptionScheduled:(MTRDeviceResubscriptionScheduledHandler _Nullable)resubscriptionScheduledHandler { - if (self.paseDevice != nil) { + if (self.isPASEDevice) { // We don't support subscriptions over PASE. dispatch_async(queue, ^{ errorHandler([MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); @@ -1113,7 +1124,7 @@ - (void)subscribeAttributeWithEndpointId:(NSNumber * _Nullable)endpointId reportHandler:(MTRDeviceResponseHandler)reportHandler subscriptionEstablished:(SubscriptionEstablishedHandler)subscriptionEstablishedHandler { - if (self.paseDevice != nil) { + if (self.isPASEDevice) { // We don't support subscriptions over PASE. dispatch_async(clientQueue, ^{ reportHandler(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); @@ -1250,6 +1261,144 @@ - (void)deregisterReportHandlersWithClientQueue:(dispatch_queue_t)clientQueue co PurgeReadClientContainers([self deviceID], clientQueue, completion); } +namespace { +class OpenCommissioningWindowHelper { + typedef void (^ResultCallback)(CHIP_ERROR status, const SetupPayload &); + +public: + static CHIP_ERROR OpenCommissioningWindow(Controller::DeviceController * controller, NodeId nodeID, + System::Clock::Seconds16 timeout, uint16_t discriminator, uint32_t setupPIN, ResultCallback callback); + +private: + OpenCommissioningWindowHelper(Controller::DeviceController * controller, ResultCallback callback); + + static void OnOpenCommissioningWindowResponse(void * context, NodeId deviceId, CHIP_ERROR status, chip::SetupPayload payload); + + Controller::CommissioningWindowOpener mOpener; + Callback::Callback mOnOpenCommissioningWindowCallback; + ResultCallback mResultCallback; +}; + +OpenCommissioningWindowHelper::OpenCommissioningWindowHelper(Controller::DeviceController * controller, ResultCallback callback) + : mOpener(controller) + , mOnOpenCommissioningWindowCallback(OnOpenCommissioningWindowResponse, this) + , mResultCallback(callback) +{ +} + +CHIP_ERROR OpenCommissioningWindowHelper::OpenCommissioningWindow(Controller::DeviceController * controller, NodeId nodeID, + System::Clock::Seconds16 timeout, uint16_t discriminator, uint32_t setupPIN, ResultCallback callback) +{ + auto * self = new (std::nothrow) OpenCommissioningWindowHelper(controller, callback); + if (self == nullptr) { + return CHIP_ERROR_NO_MEMORY; + } + + SetupPayload unused; + CHIP_ERROR err = self->mOpener.OpenCommissioningWindow(nodeID, timeout, Crypto::kSpake2p_Min_PBKDF_Iterations, discriminator, + MakeOptional(setupPIN), NullOptional, &self->mOnOpenCommissioningWindowCallback, unused); + if (err != CHIP_NO_ERROR) { + delete self; + } + // Else will clean up when the callback is called. + return err; +} + +void OpenCommissioningWindowHelper::OnOpenCommissioningWindowResponse( + void * context, NodeId deviceId, CHIP_ERROR status, chip::SetupPayload payload) +{ + auto * self = static_cast(context); + self->mResultCallback(status, payload); + delete self; +} + +} // anonymous namespace + +- (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode + discriminator:(NSNumber *)discriminator + duration:(NSNumber *)duration + clientQueue:(dispatch_queue_t)clientQueue + completion:(MTRDeviceOpenCommissioningWindowHandler)completion +{ + if (self.isPASEDevice) { + MTR_LOG_ERROR("Can't open a commissioning window over PASE"); + dispatch_async(clientQueue, ^{ + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); + }); + return; + } + + unsigned long long durationVal = [duration unsignedLongLongValue]; + if (!CanCastTo(durationVal)) { + MTR_LOG_ERROR("Error: Duration %llu is too large.", durationVal); + dispatch_async(clientQueue, ^{ + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE]); + }); + return; + } + + unsigned long long discriminatorVal = [discriminator unsignedLongLongValue]; + + if (discriminatorVal > 0xFFF) { + MTR_LOG_ERROR("Error: Discriminator %llu is too large. Max value %d", discriminatorVal, 0xFFF); + dispatch_async(clientQueue, ^{ + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE]); + }); + return; + } + + unsigned long long passcodeVal = [setupPasscode unsignedLongLongValue]; + if (!CanCastTo(passcodeVal) || !SetupPayload::IsValidSetupPIN(static_cast(passcodeVal))) { + MTR_LOG_ERROR("Error: Setup passcode %llu is not valid", passcodeVal); + dispatch_async(clientQueue, ^{ + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE]); + }); + return; + } + + [self.deviceController + asyncDispatchToMatterQueue:^(Controller::DeviceCommissioner * commissioner) { + auto resultCallback = ^(CHIP_ERROR status, const SetupPayload & payload) { + if (status != CHIP_NO_ERROR) { + dispatch_async(clientQueue, ^{ + completion(nil, [MTRError errorForCHIPErrorCode:status]); + }); + return; + } + auto * payloadObj = [[MTRSetupPayload alloc] initWithSetupPayload:payload]; + if (payloadObj == nil) { + dispatch_async(clientQueue, ^{ + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_NO_MEMORY]); + }); + return; + } + + dispatch_async(clientQueue, ^{ + completion(payloadObj, nil); + }); + }; + + SetupPayload setupPayload; + auto errorCode = OpenCommissioningWindowHelper::OpenCommissioningWindow(commissioner, self.nodeID, + chip::System::Clock::Seconds16(static_cast(durationVal)), static_cast(discriminatorVal), + static_cast(passcodeVal), resultCallback); + + if (errorCode != CHIP_NO_ERROR) { + dispatch_async(clientQueue, ^{ + completion(nil, [MTRError errorForCHIPErrorCode:errorCode]); + }); + return; + } + + // resultCallback will handle things now. + } + errorHandler:^(NSError * error) { + dispatch_async(clientQueue, ^{ + completion(nil, error); + }); + }]; +} + #ifdef DEBUG // This method is for unit testing only - (void)failSubscribers:(dispatch_queue_t)clientQueue completion:(void (^)(void))completion diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h index afc5add0978acf..3acfb162459393 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h @@ -23,14 +23,11 @@ #include #include -@class MTRDeviceController; - NS_ASSUME_NONNULL_BEGIN @interface MTRBaseDevice () - (instancetype)initWithPASEDevice:(chip::DeviceProxy *)device controller:(MTRDeviceController *)controller; -- (instancetype)initWithNodeID:(chip::NodeId)nodeID controller:(MTRDeviceController *)controller; /** * Only returns non-nil if the device is using a PASE session. Otherwise, the diff --git a/src/darwin/Framework/CHIP/MTRDevice.h b/src/darwin/Framework/CHIP/MTRDevice.h index ea2d047bc44b09..e858e53d149db3 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.h +++ b/src/darwin/Framework/CHIP/MTRDevice.h @@ -44,7 +44,7 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) { * retrieved when performing actions using a combination of MTRBaseDevice * and MTRAsyncCallbackQueue. */ -+ (instancetype)deviceWithNodeID:(uint64_t)nodeID deviceController:(MTRDeviceController *)deviceController; ++ (instancetype)deviceWithNodeID:(uint64_t)nodeID controller:(MTRDeviceController *)controller; /** * The current state of the device. @@ -137,6 +137,26 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) { clientQueue:(dispatch_queue_t)clientQueue completion:(MTRDeviceResponseHandler)completion; +/** + * Open a commissioning window on the device. + * + * On success, completion will be called with the MTRSetupPayload that + * can be used to commission the device. + * + * @param setupPasscode The setup passcode to use for the commissioning window. + * See MTRSetupPayload's generateRandomSetupPasscode for + * generating a valid random passcode. + * @param discriminator The discriminator to use for the commissionable + * advertisement. + * @param duration Duration, in seconds, during which the commissioning + * window will be open. + */ +- (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode + discriminator:(NSNumber *)discriminator + duration:(NSNumber *)duration + clientQueue:(dispatch_queue_t)clientQueue + completion:(MTRDeviceOpenCommissioningWindowHandler)completion; + @end @protocol MTRDeviceDelegate diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 7a84d514185329..8393c8a2243e13 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -142,12 +142,12 @@ @interface MTRDevice () @implementation MTRDevice -- (instancetype)initWithNodeID:(uint64_t)nodeID deviceController:(MTRDeviceController *)deviceController +- (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller { if (self = [super init]) { _lock = OS_UNFAIR_LOCK_INIT; - _nodeID = nodeID; - _deviceController = deviceController; + _nodeID = [nodeID unsignedLongLongValue]; + _deviceController = controller; _queue = dispatch_queue_create("com.apple.matter.framework.xpc.workqueue", DISPATCH_QUEUE_SERIAL); ; _readCache = [NSMutableDictionary dictionary]; @@ -158,9 +158,9 @@ - (instancetype)initWithNodeID:(uint64_t)nodeID deviceController:(MTRDeviceContr return self; } -+ (instancetype)deviceWithNodeID:(uint64_t)nodeID deviceController:(MTRDeviceController *)deviceController ++ (instancetype)deviceWithNodeID:(uint64_t)nodeID controller:(MTRDeviceController *)controller { - return [deviceController deviceForNodeID:nodeID]; + return [controller deviceForNodeID:nodeID]; } #pragma mark Subscription and delegate handling @@ -369,7 +369,7 @@ - (void)subscribeWithMinInterval:(uint16_t)minInterval maxInterval:(uint16_t)max // Create work item, set ready handler to perform task, then enqueue the work MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:_queue]; MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.nodeID controller:self.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.nodeID) controller:self.deviceController]; [baseDevice readAttributeWithEndpointId:endpointID @@ -412,7 +412,7 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID timedWriteTimeout:(NSNumber * _Nullable)timeout { // Start the asynchronous operation - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.nodeID controller:self.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.nodeID) controller:self.deviceController]; [baseDevice writeAttributeWithEndpointId:endpointID clusterId:clusterID @@ -446,7 +446,7 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID completion:(MTRDeviceResponseHandler)completion { // Perform this operation - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.nodeID controller:self.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.nodeID) controller:self.deviceController]; [baseDevice invokeCommandWithEndpointId:endpointID clusterId:clusterID @@ -463,6 +463,20 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID [self setExpectedValues:expectedValues expectedValueInterval:expectedValueInterval]; } +- (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode + discriminator:(NSNumber *)discriminator + duration:(NSNumber *)duration + clientQueue:(dispatch_queue_t)clientQueue + completion:(MTRDeviceOpenCommissioningWindowHandler)completion +{ + auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.nodeID) controller:self.deviceController]; + [baseDevice openCommissioningWindowWithSetupPasscode:setupPasscode + discriminator:discriminator + duration:duration + clientQueue:clientQueue + completion:completion]; +} + #pragma mark - Cache management // assume lock is held diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index 7b515886a71bb7..905ca078ea3025 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -98,13 +98,6 @@ typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NS queue:(dispatch_queue_t)queue completionHandler:(MTRDeviceConnectionCallback)completionHandler; -- (BOOL)openPairingWindow:(uint64_t)deviceID duration:(NSUInteger)duration error:(NSError * __autoreleasing *)error; -- (nullable NSString *)openPairingWindowWithPIN:(uint64_t)deviceID - duration:(NSUInteger)duration - discriminator:(NSUInteger)discriminator - setupPIN:(NSUInteger)setupPIN - error:(NSError * __autoreleasing *)error; - /** * Controllers are created via the MTRControllerFactory object. */ diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index d5365145da9821..c85a6c5b6f02dc 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -44,7 +44,6 @@ #include #include -#include #include #include #include @@ -559,7 +558,7 @@ - (BOOL)getBaseDevice:(uint64_t)deviceID dispatch_async(queue, ^{ MTRBaseDevice * device; if (error == nil) { - device = [[MTRBaseDevice alloc] initWithNodeID:deviceID controller:self]; + device = [[MTRBaseDevice alloc] initWithNodeID:@(deviceID) controller:self]; } else { device = nil; } @@ -573,7 +572,7 @@ - (MTRDevice *)deviceForNodeID:(uint64_t)nodeID os_unfair_lock_lock(&_deviceMapLock); MTRDevice * deviceToReturn = self.nodeIDToDeviceMap[@(nodeID)]; if (!deviceToReturn) { - deviceToReturn = [[MTRDevice alloc] initWithNodeID:nodeID deviceController:self]; + deviceToReturn = [[MTRDevice alloc] initWithNodeID:@(nodeID) controller:self]; self.nodeIDToDeviceMap[@(nodeID)] = deviceToReturn; } os_unfair_lock_unlock(&_deviceMapLock); @@ -593,90 +592,6 @@ - (void)removeDevice:(MTRDevice *)device os_unfair_lock_unlock(&_deviceMapLock); } -- (BOOL)openPairingWindow:(uint64_t)deviceID duration:(NSUInteger)duration error:(NSError * __autoreleasing *)error -{ - VerifyOrReturnValue([self checkIsRunning:error], NO); - - if (duration > UINT16_MAX) { - MTR_LOG_ERROR("Error: Duration %tu is too large. Max value %d", duration, UINT16_MAX); - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE]; - } - return NO; - } - - __block BOOL success = NO; - dispatch_sync(_chipWorkQueue, ^{ - VerifyOrReturn([self checkIsRunning:error]); - - auto errorCode = chip::Controller::AutoCommissioningWindowOpener::OpenBasicCommissioningWindow( - self.cppCommissioner, deviceID, chip::System::Clock::Seconds16(static_cast(duration))); - success = ![self checkForError:errorCode logMsg:kErrorOpenPairingWindow error:error]; - }); - - return success; -} - -- (NSString *)openPairingWindowWithPIN:(uint64_t)deviceID - duration:(NSUInteger)duration - discriminator:(NSUInteger)discriminator - setupPIN:(NSUInteger)setupPIN - error:(NSError * __autoreleasing *)error -{ - __block NSString * rv = nil; - - VerifyOrReturnValue([self checkIsRunning:error], rv); - - if (duration > UINT16_MAX) { - MTR_LOG_ERROR("Error: Duration %tu is too large. Max value %d", duration, UINT16_MAX); - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE]; - } - return rv; - } - - if (discriminator > 0xfff) { - MTR_LOG_ERROR("Error: Discriminator %tu is too large. Max value %d", discriminator, 0xfff); - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE]; - } - return rv; - } - - if (!chip::CanCastTo(setupPIN) || !chip::SetupPayload::IsValidSetupPIN(static_cast(setupPIN))) { - MTR_LOG_ERROR("Error: Setup pin %lu is not valid", static_cast(setupPIN)); - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE]; - } - return rv; - } - - dispatch_sync(_chipWorkQueue, ^{ - VerifyOrReturn([self checkIsRunning:error]); - - chip::SetupPayload setupPayload; - auto errorCode = chip::Controller::AutoCommissioningWindowOpener::OpenCommissioningWindow(self.cppCommissioner, deviceID, - chip::System::Clock::Seconds16(static_cast(duration)), chip::Crypto::kSpake2p_Min_PBKDF_Iterations, - static_cast(discriminator), chip::MakeOptional(static_cast(setupPIN)), chip::NullOptional, - setupPayload); - - auto success = ![self checkForError:errorCode logMsg:kErrorOpenPairingWindow error:error]; - VerifyOrReturn(success); - - chip::ManualSetupPayloadGenerator generator(setupPayload); - std::string outCode; - - if (generator.payloadDecimalStringRepresentation(outCode) == CHIP_NO_ERROR) { - MTR_LOG_ERROR("Setup code is %s", outCode.c_str()); - rv = [NSString stringWithCString:outCode.c_str() encoding:[NSString defaultCStringEncoding]]; - } else { - MTR_LOG_ERROR("Failed to get decimal setup code"); - } - }); - - return rv; -} - - (void)setPairingDelegate:(id)delegate queue:(dispatch_queue_t)queue { dispatch_async(_chipWorkQueue, ^{ @@ -845,6 +760,28 @@ - (BOOL)getSessionForNode:(chip::NodeId)nodeID completionHandler:(MTRInternalDev return YES; } +- (void)asyncDispatchToMatterQueue:(void (^)(chip::Controller::DeviceCommissioner *))block + errorHandler:(void (^)(NSError *))errorHandler +{ + { + NSError * error; + if (![self checkIsRunning:&error]) { + errorHandler(error); + return; + } + } + + dispatch_async(_chipWorkQueue, ^{ + NSError * error; + if (![self checkIsRunning:&error]) { + errorHandler(error); + return; + } + + block(self.cppCommissioner); + }); +} + @end @implementation MTRDeviceController (InternalMethods) @@ -904,4 +841,5 @@ - (void)invalidateCASESessionForNode:(chip::NodeId)nodeID; self->_cppCommissioner->GetPeerScopedId(nodeID), chip::MakeOptional(chip::Transport::SecureSession::Type::kCASE)); }); } + @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m index 54463a59f99a65..7b15409b0e3ec6 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m @@ -138,22 +138,6 @@ - (BOOL)getBaseDevice:(uint64_t)deviceID return YES; } -- (BOOL)openPairingWindow:(uint64_t)deviceID duration:(NSUInteger)duration error:(NSError * __autoreleasing *)error -{ - MTR_LOG_ERROR("MTRDevice doesn't support openPairingWindow over XPC"); - return NO; -} - -- (nullable NSString *)openPairingWindowWithPIN:(uint64_t)deviceID - duration:(NSUInteger)duration - discriminator:(NSUInteger)discriminator - setupPIN:(NSUInteger)setupPIN - error:(NSError * __autoreleasing *)error -{ - MTR_LOG_ERROR("MTRDevice doesn't support openPairingWindow over XPC"); - return nil; -} - - (instancetype)initWithControllerId:(id)controllerId workQueue:(dispatch_queue_t)queue xpcConnection:(MTRDeviceControllerXPCConnection *)connection diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index ab385ce74f7e9a..baa0844f3ca0f9 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -36,6 +36,10 @@ namespace chip { class FabricTable; + +namespace Controller { + class DeviceCommissioner; +} } // namespace chip NS_ASSUME_NONNULL_BEGIN @@ -114,6 +118,19 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)invalidateCASESessionForNode:(chip::NodeId)nodeID; +/** + * Try to asynchronously dispatch the given block on the Matter queue. If the + * controller is not running either at call time or when the block would be + * about to run, the provided error handler will be called with an error. Note + * that this means the error handler might be called on an arbitrary queue, and + * might be called before this function returns or after it returns. + * + * The DeviceCommissioner pointer passed to the callback should only be used + * synchronously during the callback invocation. + */ +- (void)asyncDispatchToMatterQueue:(void (^)(chip::Controller::DeviceCommissioner *))block + errorHandler:(void (^)(NSError *))erroHandler; + #pragma mark - Device-specific data and SDK access // DeviceController will act as a central repository for this opaque dictionary that MTRDevice manages - (MTRDevice *)deviceForNodeID:(uint64_t)nodeID; diff --git a/src/darwin/Framework/CHIP/MTRDeviceOverXPC.m b/src/darwin/Framework/CHIP/MTRDeviceOverXPC.m index 2f0a7c47918652..b0d462c53e1d2f 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceOverXPC.m +++ b/src/darwin/Framework/CHIP/MTRDeviceOverXPC.m @@ -290,6 +290,18 @@ - (void)deregisterReportHandlersWithClientQueue:(dispatch_queue_t)clientQueue co }]; } +- (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode + discriminator:(NSNumber *)discriminator + duration:(NSNumber *)duration + clientQueue:(dispatch_queue_t)clientQueue + completion:(MTRDeviceOpenCommissioningWindowHandler)completion +{ + MTR_LOG_ERROR("MTRDevice doesn't support openCommissioningWindowWithSetupPasscode over XPC"); + dispatch_async(clientQueue, ^{ + completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeInvalidState userInfo:nil]); + }); +} + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index 8be51b0e3fa46c..a7e0ba5a9e571f 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN typedef void (^MTRDevicePerformAsyncBlock)(MTRBaseDevice * baseDevice); @interface MTRDevice () -- (instancetype)initWithNodeID:(uint64_t)nodeID deviceController:(MTRDeviceController *)deviceController; +- (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller; // Called from MTRClusters for writes and commands - (void)setExpectedValues:(NSArray *> *)values diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.h b/src/darwin/Framework/CHIP/MTRSetupPayload.h index 3291b01e1b3905..4d6587ac6d7b88 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.h +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.h @@ -70,9 +70,9 @@ typedef NS_ENUM(NSUInteger, MTROptionalQRCodeInfoType) { - (nullable NSArray *)getAllOptionalVendorData:(NSError * __autoreleasing *)error; /** - * Generate a random Matter-valid setup PIN. + * Generate a random Matter-valid setup passcode. */ -+ (NSUInteger)generateRandomPIN; ++ (NSNumber *)generateRandomSetupPasscode; /** Get 11 digit manual entry code from the setup payload. */ - (nullable NSString *)manualEntryCode; diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.mm b/src/darwin/Framework/CHIP/MTRSetupPayload.mm index 39c18a33d1a66c..2dbcd1e3cfede5 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.mm +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.mm @@ -119,13 +119,13 @@ - (void)getSerialNumber:(chip::SetupPayload)setupPayload return allOptionalData; } -+ (NSUInteger)generateRandomPIN ++ (NSNumber *)generateRandomSetupPasscode { do { // Make sure the thing we generate is in the right range. uint32_t setupPIN = arc4random_uniform(chip::kSetupPINCodeMaximumValue) + 1; if (chip::SetupPayload::IsValidSetupPIN(setupPIN)) { - return setupPIN; + return @(setupPIN); } // We got pretty unlikely with our random number generation. Just try @@ -135,7 +135,7 @@ + (NSUInteger)generateRandomPIN } while (1); // Not reached. - return chip::kSetupPINCodeUndefinedValue; + return @(chip::kSetupPINCodeUndefinedValue); } #pragma mark - NSSecureCoding diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt index 77bc1e0fb37867..269097edea4d28 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt @@ -52,7 +52,7 @@ using chip::SessionHandle; { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice *baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice *baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) controller:self.device.deviceController]; new MTR{{>callbackName}}CallbackBridge(self.callbackQueue, baseDevice, {{#if hasSpecificResponse}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index ee13b7540a75aa..f1dc3b60d51bb9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -63,7 +63,8 @@ - (void)identifyWithParams:(MTRIdentifyClusterIdentifyParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -96,7 +97,8 @@ - (void)triggerEffectWithParams:(MTRIdentifyClusterTriggerEffectParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -225,7 +227,8 @@ - (void)addGroupWithParams:(MTRGroupsClusterAddGroupParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRGroupsClusterAddGroupResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -256,7 +259,8 @@ - (void)viewGroupWithParams:(MTRGroupsClusterViewGroupParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRGroupsClusterViewGroupResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -286,7 +290,8 @@ - (void)getGroupMembershipWithParams:(MTRGroupsClusterGetGroupMembershipParams * { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRGroupsClusterGetGroupMembershipResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -337,7 +342,8 @@ - (void)removeGroupWithParams:(MTRGroupsClusterRemoveGroupParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRGroupsClusterRemoveGroupResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -375,7 +381,8 @@ - (void)removeAllGroupsWithParams:(MTRGroupsClusterRemoveAllGroupsParams * _Null { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -407,7 +414,8 @@ - (void)addGroupIfIdentifyingWithParams:(MTRGroupsClusterAddGroupIfIdentifyingPa { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -507,7 +515,8 @@ - (void)addSceneWithParams:(MTRScenesClusterAddSceneParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRScenesClusterAddSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -613,7 +622,8 @@ - (void)viewSceneWithParams:(MTRScenesClusterViewSceneParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRScenesClusterViewSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -644,7 +654,8 @@ - (void)removeSceneWithParams:(MTRScenesClusterRemoveSceneParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRScenesClusterRemoveSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -675,7 +686,8 @@ - (void)removeAllScenesWithParams:(MTRScenesClusterRemoveAllScenesParams *)param { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRScenesClusterRemoveAllScenesResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -705,7 +717,8 @@ - (void)storeSceneWithParams:(MTRScenesClusterStoreSceneParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRScenesClusterStoreSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -735,7 +748,8 @@ - (void)recallSceneWithParams:(MTRScenesClusterRecallSceneParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -779,7 +793,8 @@ - (void)getSceneMembershipWithParams:(MTRScenesClusterGetSceneMembershipParams * { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRScenesClusterGetSceneMembershipResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -809,7 +824,8 @@ - (void)enhancedAddSceneWithParams:(MTRScenesClusterEnhancedAddSceneParams *)par { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRScenesClusterEnhancedAddSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -915,7 +931,8 @@ - (void)enhancedViewSceneWithParams:(MTRScenesClusterEnhancedViewSceneParams *)p { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRScenesClusterEnhancedViewSceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -946,7 +963,8 @@ - (void)copySceneWithParams:(MTRScenesClusterCopySceneParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRScenesClusterCopySceneResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -1093,7 +1111,8 @@ - (void)offWithParams:(MTROnOffClusterOffParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1134,7 +1153,8 @@ - (void)onWithParams:(MTROnOffClusterOnParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1175,7 +1195,8 @@ - (void)toggleWithParams:(MTROnOffClusterToggleParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1207,7 +1228,8 @@ - (void)offWithEffectWithParams:(MTROnOffClusterOffWithEffectParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1251,7 +1273,8 @@ - (void)onWithRecallGlobalSceneWithParams:(MTROnOffClusterOnWithRecallGlobalScen { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1283,7 +1306,8 @@ - (void)onWithTimedOffWithParams:(MTROnOffClusterOnWithTimedOffParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1565,7 +1589,8 @@ - (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1606,7 +1631,8 @@ - (void)moveWithParams:(MTRLevelControlClusterMoveParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1647,7 +1673,8 @@ - (void)stepWithParams:(MTRLevelControlClusterStepParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1689,7 +1716,8 @@ - (void)stopWithParams:(MTRLevelControlClusterStopParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1723,7 +1751,8 @@ - (void)moveToLevelWithOnOffWithParams:(MTRLevelControlClusterMoveToLevelWithOnO { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1764,7 +1793,8 @@ - (void)moveWithOnOffWithParams:(MTRLevelControlClusterMoveWithOnOffParams *)par { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1805,7 +1835,8 @@ - (void)stepWithOnOffWithParams:(MTRLevelControlClusterStepWithOnOffParams *)par { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1847,7 +1878,8 @@ - (void)stopWithOnOffWithParams:(MTRLevelControlClusterStopWithOnOffParams *)par { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -1881,7 +1913,8 @@ - (void)moveToClosestFrequencyWithParams:(MTRLevelControlClusterMoveToClosestFre { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -2767,7 +2800,8 @@ - (void)instantActionWithParams:(MTRActionsClusterInstantActionParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -2804,7 +2838,8 @@ - (void)instantActionWithTransitionWithParams:(MTRActionsClusterInstantActionWit { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -2842,7 +2877,8 @@ - (void)startActionWithParams:(MTRActionsClusterStartActionParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -2879,7 +2915,8 @@ - (void)startActionWithDurationWithParams:(MTRActionsClusterStartActionWithDurat { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -2917,7 +2954,8 @@ - (void)stopActionWithParams:(MTRActionsClusterStopActionParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -2954,7 +2992,8 @@ - (void)pauseActionWithParams:(MTRActionsClusterPauseActionParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -2991,7 +3030,8 @@ - (void)pauseActionWithDurationWithParams:(MTRActionsClusterPauseActionWithDurat { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -3029,7 +3069,8 @@ - (void)resumeActionWithParams:(MTRActionsClusterResumeActionParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -3066,7 +3107,8 @@ - (void)enableActionWithParams:(MTRActionsClusterEnableActionParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -3103,7 +3145,8 @@ - (void)enableActionWithDurationWithParams:(MTRActionsClusterEnableActionWithDur { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -3141,7 +3184,8 @@ - (void)disableActionWithParams:(MTRActionsClusterDisableActionParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -3178,7 +3222,8 @@ - (void)disableActionWithDurationWithParams:(MTRActionsClusterDisableActionWithD { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -3306,7 +3351,8 @@ - (void)mfgSpecificPingWithParams:(MTRBasicClusterMfgSpecificPingParams * _Nulla { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -3613,7 +3659,8 @@ - (void)queryImageWithParams:(MTROtaSoftwareUpdateProviderClusterQueryImageParam { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTROtaSoftwareUpdateProviderClusterQueryImageResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -3684,7 +3731,8 @@ - (void)applyUpdateRequestWithParams:(MTROtaSoftwareUpdateProviderClusterApplyUp { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTROtaSoftwareUpdateProviderClusterApplyUpdateResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -3714,7 +3762,8 @@ - (void)notifyUpdateAppliedWithParams:(MTROtaSoftwareUpdateProviderClusterNotify { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -3805,7 +3854,8 @@ - (void)announceOtaProviderWithParams:(MTROtaSoftwareUpdateRequestorClusterAnnou { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -4620,7 +4670,8 @@ - (void)armFailSafeWithParams:(MTRGeneralCommissioningClusterArmFailSafeParams * { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -4651,7 +4702,8 @@ - (void)setRegulatoryConfigWithParams:(MTRGeneralCommissioningClusterSetRegulato { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -4696,7 +4748,8 @@ - (void)commissioningCompleteWithParams:(MTRGeneralCommissioningClusterCommissio { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -4842,7 +4895,8 @@ - (void)scanNetworksWithParams:(MTRNetworkCommissioningClusterScanNetworksParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRNetworkCommissioningClusterScanNetworksResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -4886,7 +4940,8 @@ - (void)addOrUpdateWiFiNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpd { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -4921,7 +4976,8 @@ - (void)addOrUpdateThreadNetworkWithParams:(MTRNetworkCommissioningClusterAddOrU { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -4955,7 +5011,8 @@ - (void)removeNetworkWithParams:(MTRNetworkCommissioningClusterRemoveNetworkPara { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -4989,7 +5046,8 @@ - (void)connectNetworkWithParams:(MTRNetworkCommissioningClusterConnectNetworkPa { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRNetworkCommissioningClusterConnectNetworkResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -5023,7 +5081,8 @@ - (void)reorderNetworkWithParams:(MTRNetworkCommissioningClusterReorderNetworkPa { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRNetworkCommissioningClusterNetworkConfigResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -5198,7 +5257,8 @@ - (void)retrieveLogsRequestWithParams:(MTRDiagnosticLogsClusterRetrieveLogsReque { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -5287,7 +5347,8 @@ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTrigger { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -5459,7 +5520,8 @@ - (void)resetWatermarksWithParams:(MTRSoftwareDiagnosticsClusterResetWatermarksP { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -5589,7 +5651,8 @@ - (void)resetCountsWithParams:(MTRThreadNetworkDiagnosticsClusterResetCountsPara { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -6192,7 +6255,8 @@ - (void)resetCountsWithParams:(MTRWiFiNetworkDiagnosticsClusterResetCountsParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -6394,7 +6458,8 @@ - (void)resetCountsWithParams:(MTREthernetNetworkDiagnosticsClusterResetCountsPa { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -6832,7 +6897,8 @@ - (void)openCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterO { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -6872,7 +6938,8 @@ - (void)openBasicCommissioningWindowWithParams:(MTRAdministratorCommissioningClu { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -6917,7 +6984,8 @@ - (void)revokeCommissioningWithParams:(MTRAdministratorCommissioningClusterRevok { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -7034,7 +7102,8 @@ - (void)attestationRequestWithParams:(MTROperationalCredentialsClusterAttestatio { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTROperationalCredentialsClusterAttestationResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -7064,7 +7133,8 @@ - (void)certificateChainRequestWithParams:(MTROperationalCredentialsClusterCerti { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTROperationalCredentialsClusterCertificateChainResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -7094,7 +7164,8 @@ - (void)CSRRequestWithParams:(MTROperationalCredentialsClusterCSRRequestParams * { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTROperationalCredentialsClusterCSRResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -7128,7 +7199,8 @@ - (void)addNOCWithParams:(MTROperationalCredentialsClusterAddNOCParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -7166,7 +7238,8 @@ - (void)updateNOCWithParams:(MTROperationalCredentialsClusterUpdateNOCParams *)p { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -7200,7 +7273,8 @@ - (void)updateFabricLabelWithParams:(MTROperationalCredentialsClusterUpdateFabri { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -7230,7 +7304,8 @@ - (void)removeFabricWithParams:(MTROperationalCredentialsClusterRemoveFabricPara { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTROperationalCredentialsClusterNOCResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -7259,7 +7334,8 @@ - (void)addTrustedRootCertificateWithParams:(MTROperationalCredentialsClusterAdd { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -7397,7 +7473,8 @@ - (void)keySetWriteWithParams:(MTRGroupKeyManagementClusterKeySetWriteParams *)p { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -7470,7 +7547,8 @@ - (void)keySetReadWithParams:(MTRGroupKeyManagementClusterKeySetReadParams *)par { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRGroupKeyManagementClusterKeySetReadResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -7499,7 +7577,8 @@ - (void)keySetRemoveWithParams:(MTRGroupKeyManagementClusterKeySetRemoveParams * { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -7533,7 +7612,8 @@ - (void)keySetReadAllIndicesWithParams:(MTRGroupKeyManagementClusterKeySetReadAl { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -7905,7 +7985,8 @@ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8081,7 +8162,8 @@ - (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8122,7 +8204,8 @@ - (void)unlockDoorWithParams:(MTRDoorLockClusterUnlockDoorParams * _Nullable)par { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8163,7 +8246,8 @@ - (void)unlockWithTimeoutWithParams:(MTRDoorLockClusterUnlockWithTimeoutParams * { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8203,7 +8287,8 @@ - (void)setWeekDayScheduleWithParams:(MTRDoorLockClusterSetWeekDayScheduleParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8243,7 +8328,8 @@ - (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -8273,7 +8359,8 @@ - (void)clearWeekDayScheduleWithParams:(MTRDoorLockClusterClearWeekDaySchedulePa { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8307,7 +8394,8 @@ - (void)setYearDayScheduleWithParams:(MTRDoorLockClusterSetYearDayScheduleParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8344,7 +8432,8 @@ - (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRDoorLockClusterGetYearDayScheduleResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -8374,7 +8463,8 @@ - (void)clearYearDayScheduleWithParams:(MTRDoorLockClusterClearYearDaySchedulePa { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8408,7 +8498,8 @@ - (void)setHolidayScheduleWithParams:(MTRDoorLockClusterSetHolidayScheduleParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8446,7 +8537,8 @@ - (void)getHolidayScheduleWithParams:(MTRDoorLockClusterGetHolidayScheduleParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRDoorLockClusterGetHolidayScheduleResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -8475,7 +8567,8 @@ - (void)clearHolidayScheduleWithParams:(MTRDoorLockClusterClearHolidaySchedulePa { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8508,7 +8601,8 @@ - (void)setUserWithParams:(MTRDoorLockClusterSetUserParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8579,7 +8673,8 @@ - (void)getUserWithParams:(MTRDoorLockClusterGetUserParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRDoorLockClusterGetUserResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -8608,7 +8703,8 @@ - (void)clearUserWithParams:(MTRDoorLockClusterClearUserParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -8645,7 +8741,8 @@ - (void)setCredentialWithParams:(MTRDoorLockClusterSetCredentialParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRDoorLockClusterSetCredentialResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -8702,7 +8799,8 @@ - (void)getCredentialStatusWithParams:(MTRDoorLockClusterGetCredentialStatusPara { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRDoorLockClusterGetCredentialStatusResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -8733,7 +8831,8 @@ - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)par { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -9486,7 +9585,8 @@ - (void)upOrOpenWithParams:(MTRWindowCoveringClusterUpOrOpenParams * _Nullable)p { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -9527,7 +9627,8 @@ - (void)downOrCloseWithParams:(MTRWindowCoveringClusterDownOrCloseParams * _Null { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -9568,7 +9669,8 @@ - (void)stopMotionWithParams:(MTRWindowCoveringClusterStopMotionParams * _Nullab { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -9600,7 +9702,8 @@ - (void)goToLiftValueWithParams:(MTRWindowCoveringClusterGoToLiftValueParams *)p { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -9633,7 +9736,8 @@ - (void)goToLiftPercentageWithParams:(MTRWindowCoveringClusterGoToLiftPercentage { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -9666,7 +9770,8 @@ - (void)goToTiltValueWithParams:(MTRWindowCoveringClusterGoToTiltValueParams *)p { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -9699,7 +9804,8 @@ - (void)goToTiltPercentageWithParams:(MTRWindowCoveringClusterGoToTiltPercentage { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -9984,7 +10090,8 @@ - (void)barrierControlGoToPercentWithParams:(MTRBarrierControlClusterBarrierCont { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -10026,7 +10133,8 @@ - (void)barrierControlStopWithParams:(MTRBarrierControlClusterBarrierControlStop { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -10632,7 +10740,8 @@ - (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerPara { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -10666,7 +10775,8 @@ - (void)setWeeklyScheduleWithParams:(MTRThermostatClusterSetWeeklyScheduleParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -10738,7 +10848,8 @@ - (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRThermostatClusterGetWeeklyScheduleResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -10779,7 +10890,8 @@ - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklySchedulePa { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12197,7 +12309,8 @@ - (void)moveToHueWithParams:(MTRColorControlClusterMoveToHueParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12235,7 +12348,8 @@ - (void)moveHueWithParams:(MTRColorControlClusterMoveHueParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12271,7 +12385,8 @@ - (void)stepHueWithParams:(MTRColorControlClusterStepHueParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12308,7 +12423,8 @@ - (void)moveToSaturationWithParams:(MTRColorControlClusterMoveToSaturationParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12344,7 +12460,8 @@ - (void)moveSaturationWithParams:(MTRColorControlClusterMoveSaturationParams *)p { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12380,7 +12497,8 @@ - (void)stepSaturationWithParams:(MTRColorControlClusterStepSaturationParams *)p { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12417,7 +12535,8 @@ - (void)moveToHueAndSaturationWithParams:(MTRColorControlClusterMoveToHueAndSatu { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12454,7 +12573,8 @@ - (void)moveToColorWithParams:(MTRColorControlClusterMoveToColorParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12491,7 +12611,8 @@ - (void)moveColorWithParams:(MTRColorControlClusterMoveColorParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12527,7 +12648,8 @@ - (void)stepColorWithParams:(MTRColorControlClusterStepColorParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12564,7 +12686,8 @@ - (void)moveToColorTemperatureWithParams:(MTRColorControlClusterMoveToColorTempe { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12600,7 +12723,8 @@ - (void)enhancedMoveToHueWithParams:(MTRColorControlClusterEnhancedMoveToHuePara { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12638,7 +12762,8 @@ - (void)enhancedMoveHueWithParams:(MTRColorControlClusterEnhancedMoveHueParams * { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12674,7 +12799,8 @@ - (void)enhancedStepHueWithParams:(MTRColorControlClusterEnhancedStepHueParams * { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12711,7 +12837,8 @@ - (void)enhancedMoveToHueAndSaturationWithParams:(MTRColorControlClusterEnhanced { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12748,7 +12875,8 @@ - (void)colorLoopSetWithParams:(MTRColorControlClusterColorLoopSetParams *)param { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12789,7 +12917,8 @@ - (void)stopMoveStepWithParams:(MTRColorControlClusterStopMoveStepParams *)param { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12823,7 +12952,8 @@ - (void)moveColorTemperatureWithParams:(MTRColorControlClusterMoveColorTemperatu { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -12861,7 +12991,8 @@ - (void)stepColorTemperatureWithParams:(MTRColorControlClusterStepColorTemperatu { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -14890,7 +15021,8 @@ - (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRChannelClusterChangeChannelResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -14919,7 +15051,8 @@ - (void)changeChannelByNumberWithParams:(MTRChannelClusterChangeChannelByNumberP { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -14953,7 +15086,8 @@ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -15068,7 +15202,8 @@ - (void)navigateTargetWithParams:(MTRTargetNavigatorClusterNavigateTargetParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTargetNavigatorClusterNavigateTargetResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15185,7 +15320,8 @@ - (void)playWithParams:(MTRMediaPlaybackClusterPlayParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15224,7 +15360,8 @@ - (void)pauseWithParams:(MTRMediaPlaybackClusterPauseParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15263,7 +15400,8 @@ - (void)stopPlaybackWithParams:(MTRMediaPlaybackClusterStopPlaybackParams * _Nul { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15302,7 +15440,8 @@ - (void)startOverWithParams:(MTRMediaPlaybackClusterStartOverParams * _Nullable) { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15341,7 +15480,8 @@ - (void)previousWithParams:(MTRMediaPlaybackClusterPreviousParams * _Nullable)pa { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15380,7 +15520,8 @@ - (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15419,7 +15560,8 @@ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15458,7 +15600,8 @@ - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nulla { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15487,7 +15630,8 @@ - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15517,7 +15661,8 @@ - (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)para { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15547,7 +15692,8 @@ - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRMediaPlaybackClusterPlaybackResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -15689,7 +15835,8 @@ - (void)selectInputWithParams:(MTRMediaInputClusterSelectInputParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -15731,7 +15878,8 @@ - (void)showInputStatusWithParams:(MTRMediaInputClusterShowInputStatusParams * _ { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -15772,7 +15920,8 @@ - (void)hideInputStatusWithParams:(MTRMediaInputClusterHideInputStatusParams * _ { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -15804,7 +15953,8 @@ - (void)renameInputWithParams:(MTRMediaInputClusterRenameInputParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -15920,7 +16070,8 @@ - (void)sleepWithParams:(MTRLowPowerClusterSleepParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -16010,7 +16161,8 @@ - (void)sendKeyWithParams:(MTRKeypadInputClusterSendKeyParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRKeypadInputClusterSendKeyResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -16097,7 +16249,8 @@ - (void)launchContentWithParams:(MTRContentLauncherClusterLaunchContentParams *) { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRContentLauncherClusterLaunchResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -16183,7 +16336,8 @@ - (void)launchURLWithParams:(MTRContentLauncherClusterLaunchURLParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRContentLauncherClusterLaunchResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -16404,7 +16558,8 @@ - (void)selectOutputWithParams:(MTRAudioOutputClusterSelectOutputParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -16437,7 +16592,8 @@ - (void)renameOutputWithParams:(MTRAudioOutputClusterRenameOutputParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -16545,7 +16701,8 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)para { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -16580,7 +16737,8 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -16611,7 +16769,8 @@ - (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRApplicationLauncherClusterLauncherResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -16855,7 +17014,8 @@ - (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRAccountLoginClusterGetSetupPINResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -16887,7 +17047,8 @@ - (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -16933,7 +17094,8 @@ - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -17034,7 +17196,8 @@ - (void)getProfileInfoCommandWithParams:(MTRElectricalMeasurementClusterGetProfi { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -17066,7 +17229,8 @@ - (void)getMeasurementProfileCommandWithParams:(MTRElectricalMeasurementClusterG { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -18355,7 +18519,8 @@ - (void)testWithParams:(MTRTestClusterClusterTestParams * _Nullable)params { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -18396,7 +18561,8 @@ - (void)testNotHandledWithParams:(MTRTestClusterClusterTestNotHandledParams * _N { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -18439,7 +18605,8 @@ - (void)testSpecificWithParams:(MTRTestClusterClusterTestSpecificParams * _Nulla { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterTestSpecificResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18476,7 +18643,8 @@ - (void)testUnknownCommandWithParams:(MTRTestClusterClusterTestUnknownCommandPar { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -18509,7 +18677,8 @@ - (void)testAddArgumentsWithParams:(MTRTestClusterClusterTestAddArgumentsParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterTestAddArgumentsResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18540,7 +18709,8 @@ - (void)testSimpleArgumentRequestWithParams:(MTRTestClusterClusterTestSimpleArgu { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterTestSimpleArgumentResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18571,7 +18741,8 @@ - (void)testStructArrayArgumentRequestWithParams:(MTRTestClusterClusterTestStruc { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterTestStructArrayArgumentResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18810,7 +18981,8 @@ - (void)testStructArgumentRequestWithParams:(MTRTestClusterClusterTestStructArgu { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18847,7 +19019,8 @@ - (void)testNestedStructArgumentRequestWithParams:(MTRTestClusterClusterTestNest { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18886,7 +19059,8 @@ - (void)testListStructArgumentRequestWithParams:(MTRTestClusterClusterTestListSt { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18946,7 +19120,8 @@ - (void)testListInt8UArgumentRequestWithParams:(MTRTestClusterClusterTestListInt { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -18997,7 +19172,8 @@ - (void)testNestedStructListArgumentRequestWithParams:(MTRTestClusterClusterTest { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19134,7 +19310,8 @@ - (void)testListNestedStructListArgumentRequestWithParams: { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterBooleanResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19295,7 +19472,8 @@ - (void)testListInt8UReverseRequestWithParams:(MTRTestClusterClusterTestListInt8 { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterTestListInt8UReverseResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19346,7 +19524,8 @@ - (void)testEnumsRequestWithParams:(MTRTestClusterClusterTestEnumsRequestParams { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterTestEnumsResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19377,7 +19556,8 @@ - (void)testNullableOptionalRequestWithParams:(MTRTestClusterClusterTestNullable { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterTestNullableOptionalResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19418,7 +19598,8 @@ - (void)testComplexNullableOptionalRequestWithParams:(MTRTestClusterClusterTestC { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterTestComplexNullableOptionalResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19616,7 +19797,8 @@ - (void)simpleStructEchoRequestWithParams:(MTRTestClusterClusterSimpleStructEcho { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterSimpleStructResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19661,7 +19843,8 @@ - (void)timedInvokeRequestWithParams:(MTRTestClusterClusterTimedInvokeRequestPar { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -19696,7 +19879,8 @@ - (void)testSimpleOptionalArgumentRequestWithParams:(MTRTestClusterClusterTestSi { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRCommandSuccessCallbackBridge( self.callbackQueue, baseDevice, ^(id _Nullable value, NSError * _Nullable error) { @@ -19735,7 +19919,8 @@ - (void)testEmitTestEventRequestWithParams:(MTRTestClusterClusterTestEmitTestEve { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterTestEmitTestEventResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs; @@ -19769,7 +19954,8 @@ - (void)testEmitTestFabricScopedEventRequestWithParams:(MTRTestClusterClusterTes { // Make a copy of params before we go async. params = [params copy]; - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:@(self.device.nodeID) + controller:self.device.deviceController]; new MTRTestClusterClusterTestEmitTestFabricScopedEventResponseCallbackBridge(self.callbackQueue, baseDevice, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { chip::Optional timedInvokeTimeoutMs;