From 83228d147b7dc2cd769386c40b3bdb908719bc88 Mon Sep 17 00:00:00 2001 From: Jeff Tung Date: Tue, 5 Jul 2022 21:51:54 -0700 Subject: [PATCH] Issue 20336 - Darwin: rename MTRDevice and MTRClsutersObjc files and classes --- .../Framework Helpers/DefaultsUtils.h | 2 +- .../Framework Helpers/DefaultsUtils.m | 11 +- .../Bindings/BindingsViewController.m | 4 +- .../Enumeration/EnumerateViewController.m | 6 +- .../Fabric/FabricUIViewController.m | 45 +++--- .../MultiAdmin/MultiAdminViewController.m | 2 +- .../OnOffCluster/OnOffViewController.m | 24 ++-- .../QRCode/QRCodeViewController.m | 4 +- .../TemperatureSensorViewController.m | 13 +- .../CHIP/MTRAttributeCacheContainer.mm | 2 +- .../CHIP/{MTRDevice.h => MTRBaseDevice.h} | 2 +- .../CHIP/{MTRDevice.mm => MTRBaseDevice.mm} | 6 +- ...ce_Internal.h => MTRBaseDevice_Internal.h} | 4 +- .../CHIP/MTRCallbackBridgeBase_internal.h | 2 +- src/darwin/Framework/CHIP/MTRCluster.h | 4 +- src/darwin/Framework/CHIP/MTRCluster.mm | 4 +- .../Framework/CHIP/MTRCluster_internal.h | 6 +- .../CHIP/MTRDeviceConnectionBridge.mm | 4 +- .../Framework/CHIP/MTRDeviceController+XPC.m | 2 +- .../Framework/CHIP/MTRDeviceController.h | 6 +- .../Framework/CHIP/MTRDeviceController.mm | 8 +- .../CHIP/MTRDeviceControllerOverXPC.m | 2 +- src/darwin/Framework/CHIP/MTRDeviceOverXPC.h | 4 +- src/darwin/Framework/CHIP/Matter.h | 4 +- ...Objc-src.zapt => MTRBaseClusters-src.zapt} | 8 +- ...ClustersObjc.zapt => MTRBaseClusters.zapt} | 2 +- ...nal.zapt => MTRBaseClusters_internal.zapt} | 7 +- .../Framework/CHIP/templates/templates.json | 12 +- .../{MTRClustersObjc.h => MTRBaseClusters.h} | 128 ++++++++--------- ...{MTRClustersObjc.mm => MTRBaseClusters.mm} | 134 +++++++++--------- .../Framework/CHIPTests/MTRClustersTests.m | 6 +- .../Framework/CHIPTests/MTRControllerTests.m | 2 +- .../Framework/CHIPTests/MTRDeviceTests.m | 84 +++++------ .../CHIPTests/MTRXPCListenerSampleTests.m | 52 +++---- .../Framework/CHIPTests/MTRXPCProtocolTests.m | 70 ++++----- .../Matter.xcodeproj/project.pbxproj | 44 +++--- 36 files changed, 366 insertions(+), 354 deletions(-) rename src/darwin/Framework/CHIP/{MTRDevice.h => MTRBaseDevice.h} (99%) rename src/darwin/Framework/CHIP/{MTRDevice.mm => MTRBaseDevice.mm} (99%) rename src/darwin/Framework/CHIP/{MTRDevice_Internal.h => MTRBaseDevice_Internal.h} (96%) rename src/darwin/Framework/CHIP/templates/{MTRClustersObjc-src.zapt => MTRBaseClusters-src.zapt} (98%) rename src/darwin/Framework/CHIP/templates/{MTRClustersObjc.zapt => MTRBaseClusters.zapt} (98%) rename src/darwin/Framework/CHIP/templates/{MTRClustersObjc_internal.zapt => MTRBaseClusters_internal.zapt} (55%) rename src/darwin/Framework/CHIP/zap-generated/{MTRClustersObjc.h => MTRBaseClusters.h} (99%) rename src/darwin/Framework/CHIP/zap-generated/{MTRClustersObjc.mm => MTRBaseClusters.mm} (99%) diff --git a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h index 8b3320ec2992b5..e4f114bc4ab869 100644 --- a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h +++ b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h @@ -39,7 +39,7 @@ BOOL MTRIsDevicePaired(uint64_t id); BOOL MTRGetConnectedDevice(MTRDeviceConnectionCallback completionHandler); BOOL MTRGetConnectedDeviceWithID(uint64_t deviceId, MTRDeviceConnectionCallback completionHandler); void MTRUnpairDeviceWithID(uint64_t deviceId); -MTRDevice * _Nullable MTRGetDeviceBeingCommissioned(void); +MTRBaseDevice * _Nullable MTRGetDeviceBeingCommissioned(void); @interface CHIPToolPersistentStorageDelegate : NSObject - (nullable NSData *)storageDataForKey:(NSString *)key; diff --git a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m index bdf66f2db41a7d..31229d8a47eb35 100644 --- a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m +++ b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m @@ -138,11 +138,11 @@ BOOL MTRGetConnectedDevice(MTRDeviceConnectionCallback completionHandler) return [controller getDevice:deviceId queue:dispatch_get_main_queue() completionHandler:completionHandler]; } -MTRDevice * MTRGetDeviceBeingCommissioned(void) +MTRBaseDevice * MTRGetDeviceBeingCommissioned(void) { NSError * error; MTRDeviceController * controller = InitializeMTR(); - MTRDevice * device = [controller getDeviceBeingCommissioned:MTRGetLastPairedDeviceId() error:&error]; + MTRBaseDevice * device = [controller getDeviceBeingCommissioned:MTRGetLastPairedDeviceId() error:&error]; if (error) { NSLog(@"Error retrieving device being commissioned for deviceId %llu", MTRGetLastPairedDeviceId()); return nil; @@ -173,15 +173,14 @@ void MTRSetDevicePaired(uint64_t deviceId, BOOL paired) void MTRUnpairDeviceWithID(uint64_t deviceId) { MTRSetDevicePaired(deviceId, NO); - MTRGetConnectedDeviceWithID(deviceId, ^(MTRDevice * _Nullable device, NSError * _Nullable error) { + MTRGetConnectedDeviceWithID(deviceId, ^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { if (error) { NSLog(@"Failed to unpair device %llu still removing from CHIPTool. %@", deviceId, error); return; } NSLog(@"Attempting to unpair device %llu", deviceId); - MTROperationalCredentials * opCredsCluster = [[MTROperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:dispatch_get_main_queue()]; + MTRBaseClusterOperationalCredentials * opCredsCluster = + [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:dispatch_get_main_queue()]; [opCredsCluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { if (error) { diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m index 4e31fc87ca32e5..b98e45ec0d8749 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m @@ -134,7 +134,7 @@ - (IBAction)bind:(id)sender [scanner scanUnsignedLongLong:&nodeId]; // TODO Binding Support was removed from ObjC Clusters.h - if (MTRGetConnectedDevice(^(MTRDevice * _Nullable chipDevice, NSError * _Nullable error) { + if (MTRGetConnectedDevice(^(MTRBaseDevice * _Nullable chipDevice, NSError * _Nullable error) { if (chipDevice) { NSString * resultString = [NSString stringWithFormat:@"Not Supported"]; NSLog(resultString, nil); @@ -150,7 +150,7 @@ - (IBAction)bind:(id)sender - (IBAction)unbind:(id)sender { - if (MTRGetConnectedDevice(^(MTRDevice * _Nullable chipDevice, NSError * _Nullable error) { + if (MTRGetConnectedDevice(^(MTRBaseDevice * _Nullable chipDevice, NSError * _Nullable error) { if (chipDevice) { NSString * resultString = [NSString stringWithFormat:@"Not Supported"]; NSLog(resultString, nil); diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Enumeration/EnumerateViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Enumeration/EnumerateViewController.m index e8f9d37e6cb4dc..d31ba4f98b0aaa 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Enumeration/EnumerateViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Enumeration/EnumerateViewController.m @@ -108,14 +108,14 @@ - (IBAction)sendMessage:(id)sender // 4. Success? - (void)enumerate { - MTRGetConnectedDevice(^(MTRDevice * _Nullable device, NSError * _Nullable error) { + MTRGetConnectedDevice(^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { if (error) { NSString * resultLog = [[NSString alloc] initWithFormat:@"Unable to get connected device: Error: %@", error]; [self updateResult:resultLog]; return; } - MTRDescriptor * descriptorCluster = [[MTRDescriptor alloc] initWithDevice:device + MTRBaseClusterDescriptor * descriptorCluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device endpoint:0 queue:dispatch_get_main_queue()]; NSLog(@"Reading parts list to get list of endpoints in use..."); @@ -131,7 +131,7 @@ - (void)enumerate [self updateResult:resultLog]; for (NSNumber * endpoint in endpointsInUse) { - MTRDescriptor * descriptorCluster = [[MTRDescriptor alloc] initWithDevice:device + MTRBaseClusterDescriptor * descriptorCluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device endpoint:[endpoint unsignedShortValue] queue:dispatch_get_main_queue()]; [descriptorCluster readAttributeDeviceListWithCompletionHandler:^( diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m index 6d281c0312d80f..39f0f1a35977ee 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m @@ -217,11 +217,12 @@ - (void)updateFabricsListUIWithFabrics:(NSArray #import "MTRAttributeCacheContainer_Internal.h" +#import "MTRBaseDevice_Internal.h" #import "MTRCluster.h" #import "MTRDeviceControllerXPCConnection.h" -#import "MTRDevice_Internal.h" #import "MTRError.h" #import "MTRError_Internal.h" #import "MTRLogging.h" diff --git a/src/darwin/Framework/CHIP/MTRDevice.h b/src/darwin/Framework/CHIP/MTRBaseDevice.h similarity index 99% rename from src/darwin/Framework/CHIP/MTRDevice.h rename to src/darwin/Framework/CHIP/MTRBaseDevice.h index 3230b26a15dedf..815e37c3c7d655 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.h @@ -90,7 +90,7 @@ extern NSString * const MTRArrayValueType; @class MTRReadParams; @class MTRSubscribeParams; -@interface MTRDevice : NSObject +@interface MTRBaseDevice : NSObject - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm similarity index 99% rename from src/darwin/Framework/CHIP/MTRDevice.mm rename to src/darwin/Framework/CHIP/MTRBaseDevice.mm index 9cc39ad8aa581a..c1a54ac7b6983d 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -17,9 +17,9 @@ #import "MTRAttributeCacheContainer_Internal.h" #import "MTRAttributeTLVValueDecoder_Internal.h" +#import "MTRBaseDevice_Internal.h" #import "MTRCallbackBridgeBase_internal.h" #import "MTRCluster.h" -#import "MTRDevice_Internal.h" #import "MTRError_Internal.h" #import "MTREventTLVValueDecoder_Internal.h" #import "MTRLogging.h" @@ -65,7 +65,7 @@ class NSObjectDataValueCallbackBridge; -@interface MTRDevice () +@interface MTRBaseDevice () @property (nonatomic, readonly, strong, nonnull) NSRecursiveLock * lock; @property (readonly) chip::DeviceProxy * cppDevice; @@ -221,7 +221,7 @@ - (void)dealloc } @end -@implementation MTRDevice +@implementation MTRBaseDevice - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h similarity index 96% rename from src/darwin/Framework/CHIP/MTRDevice_Internal.h rename to src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h index 7dea9c4a92b152..0bc99ae0c3c7ba 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h @@ -15,7 +15,7 @@ * limitations under the License. */ -#import "MTRDevice.h" +#import "MTRBaseDevice.h" #import #include @@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface MTRDevice () +@interface MTRBaseDevice () - (instancetype)initWithDevice:(chip::DeviceProxy *)device; - (chip::DeviceProxy *)internalDevice; diff --git a/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h b/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h index fe7ded16cb7e57..61bc9f41de3676 100644 --- a/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h +++ b/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h @@ -18,7 +18,7 @@ #import #import "MTRError_Internal.h" -#import "zap-generated/MTRClustersObjc.h" +#import "zap-generated/MTRBaseClusters.h" #include #include diff --git a/src/darwin/Framework/CHIP/MTRCluster.h b/src/darwin/Framework/CHIP/MTRCluster.h index 75ba8c1c7f84f9..5b9a6bca9948d2 100644 --- a/src/darwin/Framework/CHIP/MTRCluster.h +++ b/src/darwin/Framework/CHIP/MTRCluster.h @@ -17,7 +17,7 @@ #import -@class MTRDevice; +@class MTRBaseDevice; NS_ASSUME_NONNULL_BEGIN @@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN * This is the base class for clusters. */ @interface MTRCluster : NSObject -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRCluster.mm b/src/darwin/Framework/CHIP/MTRCluster.mm index 37e4df6fb2ac92..4b117b61cc7445 100644 --- a/src/darwin/Framework/CHIP/MTRCluster.mm +++ b/src/darwin/Framework/CHIP/MTRCluster.mm @@ -15,14 +15,14 @@ * limitations under the License. */ +#import "MTRBaseDevice.h" #import "MTRCluster_internal.h" -#import "MTRDevice.h" #import "NSDataSpanConversion.h" using namespace ::chip; @implementation MTRCluster -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(EndpointId)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(EndpointId)endpoint queue:(dispatch_queue_t)queue { if (self = [super init]) { Controller::ClusterBase * cppCluster = [self getCluster]; diff --git a/src/darwin/Framework/CHIP/MTRCluster_internal.h b/src/darwin/Framework/CHIP/MTRCluster_internal.h index 7cb0bb86a7ed0e..0cea6956b6a06a 100644 --- a/src/darwin/Framework/CHIP/MTRCluster_internal.h +++ b/src/darwin/Framework/CHIP/MTRCluster_internal.h @@ -17,12 +17,12 @@ #import +#import "MTRBaseDevice.h" +#import "MTRBaseDevice_Internal.h" #import "MTRCluster.h" -#import "MTRDevice.h" -#import "MTRDevice_Internal.h" #import "zap-generated/CHIPClusters.h" -#import "zap-generated/MTRClustersObjc.h" +#import "zap-generated/MTRBaseClusters.h" using namespace chip::app::Clusters; diff --git a/src/darwin/Framework/CHIP/MTRDeviceConnectionBridge.mm b/src/darwin/Framework/CHIP/MTRDeviceConnectionBridge.mm index 6972ae7f788698..2ad2c2f6c08f83 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceConnectionBridge.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceConnectionBridge.mm @@ -16,13 +16,13 @@ */ #import "MTRDeviceConnectionBridge.h" -#import "MTRDevice_Internal.h" +#import "MTRBaseDevice_Internal.h" #import "MTRError_Internal.h" void MTRDeviceConnectionBridge::OnConnected(void * context, chip::OperationalDeviceProxy * device) { auto * object = static_cast(context); - MTRDevice * chipDevice = [[MTRDevice alloc] initWithDevice:device]; + MTRBaseDevice * chipDevice = [[MTRBaseDevice alloc] initWithDevice:device]; dispatch_async(object->mQueue, ^{ object->mCompletionHandler(chipDevice, nil); object->Release(); diff --git a/src/darwin/Framework/CHIP/MTRDeviceController+XPC.m b/src/darwin/Framework/CHIP/MTRDeviceController+XPC.m index 717bbff4628703..6dc425eba5cd7c 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController+XPC.m +++ b/src/darwin/Framework/CHIP/MTRDeviceController+XPC.m @@ -17,8 +17,8 @@ #import "MTRDeviceController+XPC.h" +#import "MTRBaseDevice.h" #import "MTRCluster.h" -#import "MTRDevice.h" #import "MTRDeviceControllerOverXPC.h" NS_ASSUME_NONNULL_BEGIN diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index fb04cdadb004d4..579f9ffc1a3ed4 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -19,11 +19,11 @@ #import -@class MTRDevice; +@class MTRBaseDevice; NS_ASSUME_NONNULL_BEGIN -typedef void (^MTRDeviceConnectionCallback)(MTRDevice * _Nullable device, NSError * _Nullable error); +typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NSError * _Nullable error); @class MTRCommissioningParameters; @protocol MTRDevicePairingDelegate; @@ -92,7 +92,7 @@ typedef void (^MTRDeviceConnectionCallback)(MTRDevice * _Nullable device, NSErro - (BOOL)stopDevicePairing:(uint64_t)deviceID error:(NSError * __autoreleasing *)error; -- (nullable MTRDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError * __autoreleasing *)error; +- (nullable MTRBaseDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError * __autoreleasing *)error; - (BOOL)getDevice:(uint64_t)deviceID queue:(dispatch_queue_t)queue completionHandler:(MTRDeviceConnectionCallback)completionHandler; - (BOOL)openPairingWindow:(uint64_t)deviceID duration:(NSUInteger)duration error:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index ddd0f45c47d112..d9102b352847a4 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -16,12 +16,12 @@ */ #import "MTRDeviceController.h" +#import "MTRBaseDevice_Internal.h" #import "MTRCommissioningParameters.h" #import "MTRControllerFactory_Internal.h" #import "MTRDeviceControllerStartupParams.h" #import "MTRDeviceControllerStartupParams_Internal.h" #import "MTRDevicePairingDelegateBridge.h" -#import "MTRDevice_Internal.h" #import "MTRError_Internal.h" #import "MTRKeypair.h" #import "MTRLogging.h" @@ -32,7 +32,7 @@ #import "NSDataSpanConversion.h" #import #import -#import +#import #import "MTRDeviceAttestationDelegateBridge.h" #import "MTRDeviceConnectionBridge.h" @@ -498,7 +498,7 @@ - (BOOL)stopDevicePairing:(uint64_t)deviceID error:(NSError * __autoreleasing *) return success; } -- (MTRDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError * __autoreleasing *)error +- (MTRBaseDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError * __autoreleasing *)error { CHIP_ERROR errorCode = CHIP_ERROR_INCORRECT_STATE; if (![self isRunning]) { @@ -514,7 +514,7 @@ - (MTRDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError * __ } return nil; } - return [[MTRDevice alloc] initWithDevice:deviceProxy]; + return [[MTRBaseDevice alloc] initWithDevice:deviceProxy]; } - (BOOL)getDevice:(uint64_t)deviceID queue:(dispatch_queue_t)queue completionHandler:(MTRDeviceConnectionCallback)completionHandler diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m index 74cca0b5c5f17c..3524948a5a5dc2 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m @@ -91,7 +91,7 @@ - (BOOL)stopDevicePairing:(uint64_t)deviceID error:(NSError * __autoreleasing *) return NO; } -- (nullable MTRDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError * __autoreleasing *)error +- (nullable MTRBaseDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError * __autoreleasing *)error { MTR_LOG_ERROR("MTRDevice doesn't support getDeviceBeingCommissioned over XPC"); return nil; diff --git a/src/darwin/Framework/CHIP/MTRDeviceOverXPC.h b/src/darwin/Framework/CHIP/MTRDeviceOverXPC.h index 918ab8829d9f5d..e0a46f4f17cec5 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceOverXPC.h +++ b/src/darwin/Framework/CHIP/MTRDeviceOverXPC.h @@ -15,12 +15,12 @@ * limitations under the License. */ -#import "MTRDevice.h" +#import "MTRBaseDevice.h" #import "MTRDeviceControllerXPCConnection.h" NS_ASSUME_NONNULL_BEGIN -@interface MTRDeviceOverXPC : MTRDevice +@interface MTRDeviceOverXPC : MTRBaseDevice - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/Matter.h b/src/darwin/Framework/CHIP/Matter.h index 0d5e8c403e3e37..3f5856e892c8e6 100644 --- a/src/darwin/Framework/CHIP/Matter.h +++ b/src/darwin/Framework/CHIP/Matter.h @@ -18,14 +18,14 @@ #import #import +#import +#import #import #import #import -#import #import #import #import -#import #import #import #import diff --git a/src/darwin/Framework/CHIP/templates/MTRClustersObjc-src.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt similarity index 98% rename from src/darwin/Framework/CHIP/templates/MTRClustersObjc-src.zapt rename to src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt index d15c19d82d47bb..56c27d4b8fbb98 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClustersObjc-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt @@ -3,11 +3,11 @@ #import #import "MTRAttributeCacheContainer_Internal.h" +#import "MTRBaseClusters_internal.h" +#import "MTRBaseDevice.h" +#import "MTRBaseDevice_Internal.h" #import "MTRCallbackBridge_internal.h" #import "MTRCluster_internal.h" -#import "MTRClustersObjc_internal.h" -#import "MTRDevice.h" -#import "MTRDevice_Internal.h" #import "MTRStructsObjc.h" #import "MTRCommandPayloadsObjc.h" @@ -19,7 +19,7 @@ using chip::Callback::Cancelable; using namespace chip::app::Clusters; // NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks): Linter is unable to locate the delete on these objects. {{#chip_client_clusters includeAll=true}} -@implementation MTR{{asUpperCamelCase name}} +@implementation MTRBaseCluster{{asUpperCamelCase name}} - (chip::Controller::ClusterBase *)getCluster { diff --git a/src/darwin/Framework/CHIP/templates/MTRClustersObjc.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt similarity index 98% rename from src/darwin/Framework/CHIP/templates/MTRClustersObjc.zapt rename to src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index 3794cf978758bb..f07c578420a38e 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClustersObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster {{name}} * {{description}} */ -@interface MTR{{asUpperCamelCase name}} : MTRCluster +@interface MTRBaseCluster{{asUpperCamelCase name}} : MTRCluster {{#chip_cluster_commands}} - (void){{asLowerCamelCase name}}WithParams:(MTR{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Params * {{#unless (commandHasRequiredField .)}}_Nullable{{/unless}})params completionHandler:({{>command_completion_type command=.}})completionHandler; diff --git a/src/darwin/Framework/CHIP/templates/MTRClustersObjc_internal.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters_internal.zapt similarity index 55% rename from src/darwin/Framework/CHIP/templates/MTRClustersObjc_internal.zapt rename to src/darwin/Framework/CHIP/templates/MTRBaseClusters_internal.zapt index 5641aed228461f..65ac72189a902a 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClustersObjc_internal.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters_internal.zapt @@ -2,11 +2,14 @@ #import -#import "MTRDevice.h" +#import "MTRBaseClusters.h" +#import "MTRBaseDevice.h" + +#include {{#chip_client_clusters includeAll=true}} -@interface MTR{{asUpperCamelCase name}} () +@interface MTRBaseCluster{{asUpperCamelCase name}} () @property (readonly) chip::Controller::{{asUpperCamelCase name}}Cluster cppCluster; @end diff --git a/src/darwin/Framework/CHIP/templates/templates.json b/src/darwin/Framework/CHIP/templates/templates.json index 30e9f2926fe8aa..3939322c5601b3 100644 --- a/src/darwin/Framework/CHIP/templates/templates.json +++ b/src/darwin/Framework/CHIP/templates/templates.json @@ -53,19 +53,19 @@ "output": "src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm" }, { - "path": "MTRClustersObjc_internal.zapt", + "path": "MTRBaseClusters_internal.zapt", "name": "Objc ZCL API Internal Header", - "output": "src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc_internal.h" + "output": "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h" }, { - "path": "MTRClustersObjc.zapt", + "path": "MTRBaseClusters.zapt", "name": "Objc ZCL API Header", - "output": "src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc.h" + "output": "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h" }, { - "path": "MTRClustersObjc-src.zapt", + "path": "MTRBaseClusters-src.zapt", "name": "Objc ZCL API", - "output": "src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc.mm" + "output": "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm" }, { "path": "MTRStructsObjc.zapt", diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h similarity index 99% rename from src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc.h rename to src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index dc1526bddb354d..da780b25343507 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Identify * */ -@interface MTRIdentify : MTRCluster +@interface MTRBaseClusterIdentify : MTRCluster - (void)identifyWithParams:(MTRIdentifyClusterIdentifyParams *)params completionHandler:(StatusCompletion)completionHandler; - (void)triggerEffectWithParams:(MTRIdentifyClusterTriggerEffectParams *)params @@ -177,7 +177,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Groups * */ -@interface MTRGroups : MTRCluster +@interface MTRBaseClusterGroups : MTRCluster - (void)addGroupWithParams:(MTRGroupsClusterAddGroupParams *)params completionHandler: @@ -311,7 +311,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Scenes * */ -@interface MTRScenes : MTRCluster +@interface MTRBaseClusterScenes : MTRCluster - (void)addSceneWithParams:(MTRScenesClusterAddSceneParams *)params completionHandler: @@ -544,7 +544,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster On/Off * */ -@interface MTROnOff : MTRCluster +@interface MTRBaseClusterOnOff : MTRCluster - (void)offWithParams:(MTROnOffClusterOffParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; - (void)offWithCompletionHandler:(StatusCompletion)completionHandler; @@ -751,7 +751,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster On/off Switch Configuration * */ -@interface MTROnOffSwitchConfiguration : MTRCluster +@interface MTRBaseClusterOnOffSwitchConfiguration : MTRCluster - (void)readAttributeSwitchTypeWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -889,7 +889,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Level Control * */ -@interface MTRLevelControl : MTRCluster +@interface MTRBaseClusterLevelControl : MTRCluster - (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -1280,7 +1280,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Binary Input (Basic) * */ -@interface MTRBinaryInputBasic : MTRCluster +@interface MTRBaseClusterBinaryInputBasic : MTRCluster - (void)readAttributeActiveTextWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler; @@ -1559,7 +1559,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Descriptor * */ -@interface MTRDescriptor : MTRCluster +@interface MTRBaseClusterDescriptor : MTRCluster - (void)readAttributeDeviceListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -1722,7 +1722,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Binding * */ -@interface MTRBinding : MTRCluster +@interface MTRBaseClusterBinding : MTRCluster - (void)readAttributeBindingWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -1841,7 +1841,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Access Control * */ -@interface MTRAccessControl : MTRCluster +@interface MTRBaseClusterAccessControl : MTRCluster - (void)readAttributeAclWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -2037,7 +2037,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Bridged Actions * */ -@interface MTRBridgedActions : MTRCluster +@interface MTRBaseClusterBridgedActions : MTRCluster - (void)instantActionWithParams:(MTRBridgedActionsClusterInstantActionParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -2210,7 +2210,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Basic * */ -@interface MTRBasic : MTRCluster +@interface MTRBaseClusterBasic : MTRCluster - (void)mfgSpecificPingWithParams:(MTRBasicClusterMfgSpecificPingParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; @@ -2672,7 +2672,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster OTA Software Update Provider * */ -@interface MTROtaSoftwareUpdateProvider : MTRCluster +@interface MTRBaseClusterOtaSoftwareUpdateProvider : MTRCluster - (void)queryImageWithParams:(MTROtaSoftwareUpdateProviderClusterQueryImageParams *)params completionHandler:(void (^)(MTROtaSoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable data, @@ -2780,7 +2780,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster OTA Software Update Requestor * */ -@interface MTROtaSoftwareUpdateRequestor : MTRCluster +@interface MTRBaseClusterOtaSoftwareUpdateRequestor : MTRCluster - (void)announceOtaProviderWithParams:(MTROtaSoftwareUpdateRequestorClusterAnnounceOtaProviderParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -2960,7 +2960,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Localization Configuration * */ -@interface MTRLocalizationConfiguration : MTRCluster +@interface MTRBaseClusterLocalizationConfiguration : MTRCluster - (void)readAttributeActiveLocaleWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler; @@ -3099,7 +3099,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Time Format Localization * */ -@interface MTRTimeFormatLocalization : MTRCluster +@interface MTRBaseClusterTimeFormatLocalization : MTRCluster - (void)readAttributeHourFormatWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -3260,7 +3260,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Unit Localization * */ -@interface MTRUnitLocalization : MTRCluster +@interface MTRBaseClusterUnitLocalization : MTRCluster - (void)readAttributeTemperatureUnitWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -3381,7 +3381,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Power Source Configuration * */ -@interface MTRPowerSourceConfiguration : MTRCluster +@interface MTRBaseClusterPowerSourceConfiguration : MTRCluster - (void)readAttributeSourcesWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; /** @@ -3495,7 +3495,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Power Source * */ -@interface MTRPowerSource : MTRCluster +@interface MTRBaseClusterPowerSource : MTRCluster - (void)readAttributeStatusWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; /** @@ -4164,7 +4164,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster General Commissioning * */ -@interface MTRGeneralCommissioning : MTRCluster +@interface MTRBaseClusterGeneralCommissioning : MTRCluster - (void)armFailSafeWithParams:(MTRGeneralCommissioningClusterArmFailSafeParams *)params completionHandler:(void (^)(MTRGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable data, @@ -4374,7 +4374,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Network Commissioning * */ -@interface MTRNetworkCommissioning : MTRCluster +@interface MTRBaseClusterNetworkCommissioning : MTRCluster - (void)scanNetworksWithParams:(MTRNetworkCommissioningClusterScanNetworksParams * _Nullable)params completionHandler:(void (^)(MTRNetworkCommissioningClusterScanNetworksResponseParams * _Nullable data, @@ -4639,7 +4639,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Diagnostic Logs * */ -@interface MTRDiagnosticLogs : MTRCluster +@interface MTRBaseClusterDiagnosticLogs : MTRCluster - (void)retrieveLogsRequestWithParams:(MTRDiagnosticLogsClusterRetrieveLogsRequestParams *)params completionHandler:(void (^)(MTRDiagnosticLogsClusterRetrieveLogsResponseParams * _Nullable data, @@ -4742,7 +4742,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster General Diagnostics * */ -@interface MTRGeneralDiagnostics : MTRCluster +@interface MTRBaseClusterGeneralDiagnostics : MTRCluster - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTriggerParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -5005,7 +5005,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Software Diagnostics * */ -@interface MTRSoftwareDiagnostics : MTRCluster +@interface MTRBaseClusterSoftwareDiagnostics : MTRCluster - (void)resetWatermarksWithParams:(MTRSoftwareDiagnosticsClusterResetWatermarksParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; @@ -5181,7 +5181,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Thread Network Diagnostics * */ -@interface MTRThreadNetworkDiagnostics : MTRCluster +@interface MTRBaseClusterThreadNetworkDiagnostics : MTRCluster - (void)resetCountsWithParams:(MTRThreadNetworkDiagnosticsClusterResetCountsParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; @@ -6423,7 +6423,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster WiFi Network Diagnostics * */ -@interface MTRWiFiNetworkDiagnostics : MTRCluster +@interface MTRBaseClusterWiFiNetworkDiagnostics : MTRCluster - (void)resetCountsWithParams:(MTRWiFiNetworkDiagnosticsClusterResetCountsParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; @@ -6757,7 +6757,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Ethernet Network Diagnostics * */ -@interface MTREthernetNetworkDiagnostics : MTRCluster +@interface MTRBaseClusterEthernetNetworkDiagnostics : MTRCluster - (void)resetCountsWithParams:(MTREthernetNetworkDiagnosticsClusterResetCountsParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; @@ -7018,7 +7018,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Bridged Device Basic * */ -@interface MTRBridgedDeviceBasic : MTRCluster +@interface MTRBaseClusterBridgedDeviceBasic : MTRCluster - (void)readAttributeVendorNameWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler; @@ -7381,7 +7381,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Switch * */ -@interface MTRSwitch : MTRCluster +@interface MTRBaseClusterSwitch : MTRCluster - (void)readAttributeNumberOfPositionsWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -7534,7 +7534,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster AdministratorCommissioning * */ -@interface MTRAdministratorCommissioning : MTRCluster +@interface MTRBaseClusterAdministratorCommissioning : MTRCluster - (void)openCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterOpenCommissioningWindowParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -7695,7 +7695,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Operational Credentials * */ -@interface MTROperationalCredentials : MTRCluster +@interface MTRBaseClusterOperationalCredentials : MTRCluster - (void)attestationRequestWithParams:(MTROperationalCredentialsClusterAttestationRequestParams *)params completionHandler:(void (^)(MTROperationalCredentialsClusterAttestationResponseParams * _Nullable data, @@ -7924,7 +7924,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Group Key Management * */ -@interface MTRGroupKeyManagement : MTRCluster +@interface MTRBaseClusterGroupKeyManagement : MTRCluster - (void)keySetWriteWithParams:(MTRGroupKeyManagementClusterKeySetWriteParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -8108,7 +8108,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Fixed Label * */ -@interface MTRFixedLabel : MTRCluster +@interface MTRBaseClusterFixedLabel : MTRCluster - (void)readAttributeLabelListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -8223,7 +8223,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster User Label * */ -@interface MTRUserLabel : MTRCluster +@interface MTRBaseClusterUserLabel : MTRCluster - (void)readAttributeLabelListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -8342,7 +8342,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Boolean State * */ -@interface MTRBooleanState : MTRCluster +@interface MTRBaseClusterBooleanState : MTRCluster - (void)readAttributeStateValueWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -8458,7 +8458,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Mode Select * */ -@interface MTRModeSelect : MTRCluster +@interface MTRBaseClusterModeSelect : MTRCluster - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -8670,7 +8670,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Door Lock * */ -@interface MTRDoorLock : MTRCluster +@interface MTRBaseClusterDoorLock : MTRCluster - (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; @@ -9547,7 +9547,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Window Covering * */ -@interface MTRWindowCovering : MTRCluster +@interface MTRBaseClusterWindowCovering : MTRCluster - (void)upOrOpenWithParams:(MTRWindowCoveringClusterUpOrOpenParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; @@ -10074,7 +10074,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Barrier Control * */ -@interface MTRBarrierControl : MTRCluster +@interface MTRBaseClusterBarrierControl : MTRCluster - (void)barrierControlGoToPercentWithParams:(MTRBarrierControlClusterBarrierControlGoToPercentParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -10389,7 +10389,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Pump Configuration and Control * */ -@interface MTRPumpConfigurationAndControl : MTRCluster +@interface MTRBaseClusterPumpConfigurationAndControl : MTRCluster - (void)readAttributeMaxPressureWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -10909,7 +10909,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Thermostat * */ -@interface MTRThermostat : MTRCluster +@interface MTRBaseClusterThermostat : MTRCluster - (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -12042,7 +12042,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Fan Control * */ -@interface MTRFanControl : MTRCluster +@interface MTRBaseClusterFanControl : MTRCluster - (void)readAttributeFanModeWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -12355,7 +12355,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Thermostat User Interface Configuration * */ -@interface MTRThermostatUserInterfaceConfiguration : MTRCluster +@interface MTRBaseClusterThermostatUserInterfaceConfiguration : MTRCluster - (void)readAttributeTemperatureDisplayModeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -12524,7 +12524,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Color Control * */ -@interface MTRColorControl : MTRCluster +@interface MTRBaseClusterColorControl : MTRCluster - (void)moveToHueWithParams:(MTRColorControlClusterMoveToHueParams *)params completionHandler:(StatusCompletion)completionHandler; - (void)moveHueWithParams:(MTRColorControlClusterMoveHueParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -13623,7 +13623,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Illuminance Measurement * */ -@interface MTRIlluminanceMeasurement : MTRCluster +@interface MTRBaseClusterIlluminanceMeasurement : MTRCluster - (void)readAttributeMeasuredValueWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -13810,7 +13810,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Temperature Measurement * */ -@interface MTRTemperatureMeasurement : MTRCluster +@interface MTRBaseClusterTemperatureMeasurement : MTRCluster - (void)readAttributeMeasuredValueWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -13979,7 +13979,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Pressure Measurement * */ -@interface MTRPressureMeasurement : MTRCluster +@interface MTRBaseClusterPressureMeasurement : MTRCluster - (void)readAttributeMeasuredValueWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -14234,7 +14234,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Flow Measurement * */ -@interface MTRFlowMeasurement : MTRCluster +@interface MTRBaseClusterFlowMeasurement : MTRCluster - (void)readAttributeMeasuredValueWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -14403,7 +14403,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Relative Humidity Measurement * */ -@interface MTRRelativeHumidityMeasurement : MTRCluster +@interface MTRBaseClusterRelativeHumidityMeasurement : MTRCluster - (void)readAttributeMeasuredValueWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -14572,7 +14572,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Occupancy Sensing * */ -@interface MTROccupancySensing : MTRCluster +@interface MTRBaseClusterOccupancySensing : MTRCluster - (void)readAttributeOccupancyWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -14945,7 +14945,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Wake on LAN * */ -@interface MTRWakeOnLan : MTRCluster +@interface MTRBaseClusterWakeOnLan : MTRCluster - (void)readAttributeMACAddressWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler; @@ -15061,7 +15061,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Channel * */ -@interface MTRChannel : MTRCluster +@interface MTRBaseClusterChannel : MTRCluster - (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params completionHandler:(void (^)(MTRChannelClusterChangeChannelResponseParams * _Nullable data, @@ -15220,7 +15220,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Target Navigator * */ -@interface MTRTargetNavigator : MTRCluster +@interface MTRBaseClusterTargetNavigator : MTRCluster - (void)navigateTargetWithParams:(MTRTargetNavigatorClusterNavigateTargetParams *)params completionHandler:(void (^)(MTRTargetNavigatorClusterNavigateTargetResponseParams * _Nullable data, @@ -15357,7 +15357,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Media Playback * */ -@interface MTRMediaPlayback : MTRCluster +@interface MTRBaseClusterMediaPlayback : MTRCluster - (void)playWithParams:(MTRMediaPlaybackClusterPlayParams * _Nullable)params completionHandler: @@ -15628,7 +15628,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Media Input * */ -@interface MTRMediaInput : MTRCluster +@interface MTRBaseClusterMediaInput : MTRCluster - (void)selectInputWithParams:(MTRMediaInputClusterSelectInputParams *)params completionHandler:(StatusCompletion)completionHandler; - (void)showInputStatusWithParams:(MTRMediaInputClusterShowInputStatusParams * _Nullable)params @@ -15770,7 +15770,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Low Power * */ -@interface MTRLowPower : MTRCluster +@interface MTRBaseClusterLowPower : MTRCluster - (void)sleepWithParams:(MTRLowPowerClusterSleepParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; - (void)sleepWithCompletionHandler:(StatusCompletion)completionHandler; @@ -15872,7 +15872,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Keypad Input * */ -@interface MTRKeypadInput : MTRCluster +@interface MTRBaseClusterKeypadInput : MTRCluster - (void)sendKeyWithParams:(MTRKeypadInputClusterSendKeyParams *)params completionHandler: @@ -15975,7 +15975,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Content Launcher * */ -@interface MTRContentLauncher : MTRCluster +@interface MTRBaseClusterContentLauncher : MTRCluster - (void)launchContentWithParams:(MTRContentLauncherClusterLaunchContentParams *)params completionHandler:(void (^)(MTRContentLauncherClusterLaunchResponseParams * _Nullable data, @@ -16122,7 +16122,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Audio Output * */ -@interface MTRAudioOutput : MTRCluster +@interface MTRBaseClusterAudioOutput : MTRCluster - (void)selectOutputWithParams:(MTRAudioOutputClusterSelectOutputParams *)params completionHandler:(StatusCompletion)completionHandler; @@ -16260,7 +16260,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Application Launcher * */ -@interface MTRApplicationLauncher : MTRCluster +@interface MTRBaseClusterApplicationLauncher : MTRCluster - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams *)params completionHandler:(void (^)(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable data, @@ -16409,7 +16409,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Application Basic * */ -@interface MTRApplicationBasic : MTRCluster +@interface MTRBaseClusterApplicationBasic : MTRCluster - (void)readAttributeVendorNameWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler; @@ -16646,7 +16646,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Account Login * */ -@interface MTRAccountLogin : MTRCluster +@interface MTRBaseClusterAccountLogin : MTRCluster - (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params completionHandler:(void (^)(MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable data, @@ -16753,7 +16753,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Electrical Measurement * */ -@interface MTRElectricalMeasurement : MTRCluster +@interface MTRBaseClusterElectricalMeasurement : MTRCluster - (void)getProfileInfoCommandWithParams:(MTRElectricalMeasurementClusterGetProfileInfoCommandParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; @@ -19259,7 +19259,7 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Test Cluster * */ -@interface MTRTestCluster : MTRCluster +@interface MTRBaseClusterTestCluster : MTRCluster - (void)testWithParams:(MTRTestClusterClusterTestParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; - (void)testWithCompletionHandler:(StatusCompletion)completionHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm similarity index 99% rename from src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc.mm rename to src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 94746c04cb4648..14c273a4734d47 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -20,12 +20,12 @@ #import #import "MTRAttributeCacheContainer_Internal.h" +#import "MTRBaseClusters_internal.h" +#import "MTRBaseDevice.h" +#import "MTRBaseDevice_Internal.h" #import "MTRCallbackBridge_internal.h" #import "MTRCluster_internal.h" -#import "MTRClustersObjc_internal.h" #import "MTRCommandPayloadsObjc.h" -#import "MTRDevice.h" -#import "MTRDevice_Internal.h" #import "MTRStructsObjc.h" #include @@ -35,7 +35,7 @@ using chip::Callback::Cancelable; using namespace chip::app::Clusters; // NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks): Linter is unable to locate the delete on these objects. -@implementation MTRIdentify +@implementation MTRBaseClusterIdentify - (chip::Controller::ClusterBase *)getCluster { @@ -567,7 +567,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRGroups +@implementation MTRBaseClusterGroups - (chip::Controller::ClusterBase *)getCluster { @@ -1121,7 +1121,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRScenes +@implementation MTRBaseClusterScenes - (chip::Controller::ClusterBase *)getCluster { @@ -2208,7 +2208,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTROnOff +@implementation MTRBaseClusterOnOff - (chip::Controller::ClusterBase *)getCluster { @@ -3104,7 +3104,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTROnOffSwitchConfiguration +@implementation MTRBaseClusterOnOffSwitchConfiguration - (chip::Controller::ClusterBase *)getCluster { @@ -3584,7 +3584,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRLevelControl +@implementation MTRBaseClusterLevelControl - (chip::Controller::ClusterBase *)getCluster { @@ -5268,7 +5268,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRBinaryInputBasic +@implementation MTRBaseClusterBinaryInputBasic - (chip::Controller::ClusterBase *)getCluster { @@ -6332,7 +6332,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRDescriptor +@implementation MTRBaseClusterDescriptor - (chip::Controller::ClusterBase *)getCluster { @@ -6900,7 +6900,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRBinding +@implementation MTRBaseClusterBinding - (chip::Controller::ClusterBase *)getCluster { @@ -7354,7 +7354,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRAccessControl +@implementation MTRBaseClusterAccessControl - (chip::Controller::ClusterBase *)getCluster { @@ -8176,7 +8176,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRBridgedActions +@implementation MTRBaseClusterBridgedActions - (chip::Controller::ClusterBase *)getCluster { @@ -9050,7 +9050,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRBasic +@implementation MTRBaseClusterBasic - (chip::Controller::ClusterBase *)getCluster { @@ -10722,7 +10722,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTROtaSoftwareUpdateProvider +@implementation MTRBaseClusterOtaSoftwareUpdateProvider - (chip::Controller::ClusterBase *)getCluster { @@ -11163,7 +11163,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTROtaSoftwareUpdateRequestor +@implementation MTRBaseClusterOtaSoftwareUpdateRequestor - (chip::Controller::ClusterBase *)getCluster { @@ -11838,7 +11838,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRLocalizationConfiguration +@implementation MTRBaseClusterLocalizationConfiguration - (chip::Controller::ClusterBase *)getCluster { @@ -12321,7 +12321,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRTimeFormatLocalization +@implementation MTRBaseClusterTimeFormatLocalization - (chip::Controller::ClusterBase *)getCluster { @@ -12901,7 +12901,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRUnitLocalization +@implementation MTRBaseClusterUnitLocalization - (chip::Controller::ClusterBase *)getCluster { @@ -13321,7 +13321,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRPowerSourceConfiguration +@implementation MTRBaseClusterPowerSourceConfiguration - (chip::Controller::ClusterBase *)getCluster { @@ -13708,7 +13708,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRPowerSource +@implementation MTRBaseClusterPowerSource - (chip::Controller::ClusterBase *)getCluster { @@ -15971,7 +15971,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRGeneralCommissioning +@implementation MTRBaseClusterGeneralCommissioning - (chip::Controller::ClusterBase *)getCluster { @@ -16728,7 +16728,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRNetworkCommissioning +@implementation MTRBaseClusterNetworkCommissioning - (chip::Controller::ClusterBase *)getCluster { @@ -17763,7 +17763,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRDiagnosticLogs +@implementation MTRBaseClusterDiagnosticLogs - (chip::Controller::ClusterBase *)getCluster { @@ -18113,7 +18113,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRGeneralDiagnostics +@implementation MTRBaseClusterGeneralDiagnostics - (chip::Controller::ClusterBase *)getCluster { @@ -19029,7 +19029,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRSoftwareDiagnostics +@implementation MTRBaseClusterSoftwareDiagnostics - (chip::Controller::ClusterBase *)getCluster { @@ -19632,7 +19632,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRThreadNetworkDiagnostics +@implementation MTRBaseClusterThreadNetworkDiagnostics - (chip::Controller::ClusterBase *)getCluster { @@ -23926,7 +23926,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRWiFiNetworkDiagnostics +@implementation MTRBaseClusterWiFiNetworkDiagnostics - (chip::Controller::ClusterBase *)getCluster { @@ -25092,7 +25092,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTREthernetNetworkDiagnostics +@implementation MTRBaseClusterEthernetNetworkDiagnostics - (chip::Controller::ClusterBase *)getCluster { @@ -26005,7 +26005,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRBridgedDeviceBasic +@implementation MTRBaseClusterBridgedDeviceBasic - (chip::Controller::ClusterBase *)getCluster { @@ -27276,7 +27276,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRSwitch +@implementation MTRBaseClusterSwitch - (chip::Controller::ClusterBase *)getCluster { @@ -27785,7 +27785,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRAdministratorCommissioning +@implementation MTRBaseClusterAdministratorCommissioning - (chip::Controller::ClusterBase *)getCluster { @@ -28390,7 +28390,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTROperationalCredentials +@implementation MTRBaseClusterOperationalCredentials - (chip::Controller::ClusterBase *)getCluster { @@ -29296,7 +29296,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRGroupKeyManagement +@implementation MTRBaseClusterGroupKeyManagement - (chip::Controller::ClusterBase *)getCluster { @@ -30084,7 +30084,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRFixedLabel +@implementation MTRBaseClusterFixedLabel - (chip::Controller::ClusterBase *)getCluster { @@ -30469,7 +30469,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRUserLabel +@implementation MTRBaseClusterUserLabel - (chip::Controller::ClusterBase *)getCluster { @@ -30908,7 +30908,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRBooleanState +@implementation MTRBaseClusterBooleanState - (chip::Controller::ClusterBase *)getCluster { @@ -31292,7 +31292,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRModeSelect +@implementation MTRBaseClusterModeSelect - (chip::Controller::ClusterBase *)getCluster { @@ -32087,7 +32087,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRDoorLock +@implementation MTRBaseClusterDoorLock - (chip::Controller::ClusterBase *)getCluster { @@ -35823,7 +35823,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRWindowCovering +@implementation MTRBaseClusterWindowCovering - (chip::Controller::ClusterBase *)getCluster { @@ -37761,7 +37761,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRBarrierControl +@implementation MTRBaseClusterBarrierControl - (chip::Controller::ClusterBase *)getCluster { @@ -38962,7 +38962,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRPumpConfigurationAndControl +@implementation MTRBaseClusterPumpConfigurationAndControl - (chip::Controller::ClusterBase *)getCluster { @@ -40880,7 +40880,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRThermostat +@implementation MTRBaseClusterThermostat - (chip::Controller::ClusterBase *)getCluster { @@ -45327,7 +45327,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRFanControl +@implementation MTRBaseClusterFanControl - (chip::Controller::ClusterBase *)getCluster { @@ -46530,7 +46530,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRThermostatUserInterfaceConfiguration +@implementation MTRBaseClusterThermostatUserInterfaceConfiguration - (chip::Controller::ClusterBase *)getCluster { @@ -47156,7 +47156,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRColorControl +@implementation MTRBaseClusterColorControl - (chip::Controller::ClusterBase *)getCluster { @@ -51678,7 +51678,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRIlluminanceMeasurement +@implementation MTRBaseClusterIlluminanceMeasurement - (chip::Controller::ClusterBase *)getCluster { @@ -52314,7 +52314,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRTemperatureMeasurement +@implementation MTRBaseClusterTemperatureMeasurement - (chip::Controller::ClusterBase *)getCluster { @@ -52887,7 +52887,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRPressureMeasurement +@implementation MTRBaseClusterPressureMeasurement - (chip::Controller::ClusterBase *)getCluster { @@ -53769,7 +53769,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRFlowMeasurement +@implementation MTRBaseClusterFlowMeasurement - (chip::Controller::ClusterBase *)getCluster { @@ -54342,7 +54342,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRRelativeHumidityMeasurement +@implementation MTRBaseClusterRelativeHumidityMeasurement - (chip::Controller::ClusterBase *)getCluster { @@ -54920,7 +54920,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTROccupancySensing +@implementation MTRBaseClusterOccupancySensing - (chip::Controller::ClusterBase *)getCluster { @@ -56315,7 +56315,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRWakeOnLan +@implementation MTRBaseClusterWakeOnLan - (chip::Controller::ClusterBase *)getCluster { @@ -56699,7 +56699,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRChannel +@implementation MTRBaseClusterChannel - (chip::Controller::ClusterBase *)getCluster { @@ -57285,7 +57285,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRTargetNavigator +@implementation MTRBaseClusterTargetNavigator - (chip::Controller::ClusterBase *)getCluster { @@ -57760,7 +57760,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRMediaPlayback +@implementation MTRBaseClusterMediaPlayback - (chip::Controller::ClusterBase *)getCluster { @@ -58805,7 +58805,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRMediaInput +@implementation MTRBaseClusterMediaInput - (chip::Controller::ClusterBase *)getCluster { @@ -59360,7 +59360,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRLowPower +@implementation MTRBaseClusterLowPower - (chip::Controller::ClusterBase *)getCluster { @@ -59712,7 +59712,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRKeypadInput +@implementation MTRBaseClusterKeypadInput - (chip::Controller::ClusterBase *)getCluster { @@ -60059,7 +60059,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRContentLauncher +@implementation MTRBaseClusterContentLauncher - (chip::Controller::ClusterBase *)getCluster { @@ -60743,7 +60743,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRAudioOutput +@implementation MTRBaseClusterAudioOutput - (chip::Controller::ClusterBase *)getCluster { @@ -61244,7 +61244,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRApplicationLauncher +@implementation MTRBaseClusterApplicationLauncher - (chip::Controller::ClusterBase *)getCluster { @@ -61815,7 +61815,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRApplicationBasic +@implementation MTRBaseClusterApplicationBasic - (chip::Controller::ClusterBase *)getCluster { @@ -62634,7 +62634,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRAccountLogin +@implementation MTRBaseClusterAccountLogin - (chip::Controller::ClusterBase *)getCluster { @@ -63045,7 +63045,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRElectricalMeasurement +@implementation MTRBaseClusterElectricalMeasurement - (chip::Controller::ClusterBase *)getCluster { @@ -71680,7 +71680,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su @end -@implementation MTRTestCluster +@implementation MTRBaseClusterTestCluster - (chip::Controller::ClusterBase *)getCluster { diff --git a/src/darwin/Framework/CHIPTests/MTRClustersTests.m b/src/darwin/Framework/CHIPTests/MTRClustersTests.m index f6aebf6b0e5bb0..8e2931f354f33f 100644 --- a/src/darwin/Framework/CHIPTests/MTRClustersTests.m +++ b/src/darwin/Framework/CHIPTests/MTRClustersTests.m @@ -141,7 +141,7 @@ - (void)testInitStack __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; [controller getDevice:nodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertEqual(error.code, 0); [connectionExpectation fulfill]; connectionExpectation = nil; @@ -166,11 +166,11 @@ - (void)testReuseChipClusterObject MTRDeviceController * controller = sController; XCTAssertNotNil(controller); - __block MTRDevice * device; + __block MTRBaseDevice * device; __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; [controller getDevice:nodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable retrievedDevice, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable retrievedDevice, NSError * _Nullable error) { XCTAssertEqual(error.code, 0); [connectionExpectation fulfill]; connectionExpectation = nil; diff --git a/src/darwin/Framework/CHIPTests/MTRControllerTests.m b/src/darwin/Framework/CHIPTests/MTRControllerTests.m index 9d3b3e462e5a9a..44d59459d2e04a 100644 --- a/src/darwin/Framework/CHIPTests/MTRControllerTests.m +++ b/src/darwin/Framework/CHIPTests/MTRControllerTests.m @@ -183,7 +183,7 @@ - (void)testControllerInvalidAccess XCTAssertFalse([controller isRunning]); XCTAssertFalse([controller getDevice:1234 queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable chipDevice, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable chipDevice, NSError * _Nullable error) { XCTAssertEqual(error.code, MTRErrorCodeInvalidState); }]); diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 5e781f83cadc06..da7d8d2d0fe908 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -20,8 +20,8 @@ // module headers #import -#import -#import +#import +#import #import #import "MTRErrorTestUtils.h" @@ -50,7 +50,7 @@ // This test suite reuses a device object to speed up the test process for CI. // The following global variable holds the reference to the device object. -static MTRDevice * mConnectedDevice; +static MTRBaseDevice * mConnectedDevice; // Singleton controller we use. static MTRDeviceController * sController = nil; @@ -62,21 +62,21 @@ static void WaitForCommissionee(XCTestExpectation * expectation, dispatch_queue_ [controller getDevice:kDeviceId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertEqual(error.code, 0); [expectation fulfill]; mConnectedDevice = device; }]; } -static MTRDevice * GetConnectedDevice(void) +static MTRBaseDevice * GetConnectedDevice(void) { XCTAssertNotNil(mConnectedDevice); return mConnectedDevice; } #ifdef DEBUG -@interface MTRDevice (Test) +@interface MTRBaseDevice (Test) - (void)failSubscribers:(dispatch_queue_t)clientQueue completion:(void (^)(void))completion; @end #endif @@ -179,7 +179,7 @@ - (void)initStack __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; [controller getDevice:kDeviceId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertEqual(error.code, 0); [connectionExpectation fulfill]; connectionExpectation = nil; @@ -224,7 +224,7 @@ - (void)test001_ReadAttribute XCTestExpectation * expectation = [self expectationWithDescription:@"read DeviceDescriptor DeviceType attribute for all endpoints"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); [device readAttributeWithEndpointId:nil @@ -264,7 +264,7 @@ - (void)test002_WriteAttribute #endif XCTestExpectation * expectation = [self expectationWithDescription:@"write LevelControl Brightness attribute"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); NSDictionary * writeValue = [NSDictionary @@ -307,7 +307,7 @@ - (void)test003_InvokeCommand #endif XCTestExpectation * expectation = [self expectationWithDescription:@"invoke MoveToLevelWithOnOff command"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); NSDictionary * fields = @{ @@ -355,7 +355,7 @@ - (void)test005_Subscribe [self initStack]; [self waitForCommissionee]; #endif - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); // Subscribe @@ -498,7 +498,7 @@ - (void)test006_ReadAttributeFailure #endif XCTestExpectation * expectation = [self expectationWithDescription:@"read failed"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); [device @@ -527,7 +527,7 @@ - (void)test007_WriteAttributeFailure #endif XCTestExpectation * expectation = [self expectationWithDescription:@"write failed"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); NSDictionary * writeValue = [NSDictionary @@ -560,7 +560,7 @@ - (void)test008_InvokeCommandFailure #endif XCTestExpectation * expectation = [self expectationWithDescription:@"invoke MoveToLevelWithOnOff command"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); NSDictionary * fields = @{ @@ -607,7 +607,7 @@ - (void)test009_SubscribeFailure [errorReportExpectation fulfill]; }; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); XCTestExpectation * cleanSubscriptionExpectation = [self expectationWithDescription:@"Previous subscriptions cleaned"]; @@ -653,7 +653,7 @@ - (void)test010_ReadAllAttribute XCTestExpectation * expectation = [self expectationWithDescription:@"read DeviceDescriptor DeviceType attribute for all endpoints"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); [device readAttributeWithEndpointId:@1 @@ -691,7 +691,7 @@ - (void)test011_ReadCachedAttribute [self waitForCommissionee]; #endif - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); XCTestExpectation * cleanSubscriptionExpectation = [self expectationWithDescription:@"Previous subscriptions cleaned"]; NSLog(@"Deregistering report handlers..."); @@ -738,7 +738,7 @@ - (void)test011_ReadCachedAttribute // Invoke command to set the attribute to a known state XCTestExpectation * commandExpectation = [self expectationWithDescription:@"Command invoked"]; - MTROnOff * cluster = [[MTROnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); NSLog(@"Invoking command..."); @@ -756,15 +756,15 @@ - (void)test011_ReadCachedAttribute // Read cache NSLog(@"Reading from cache..."); XCTestExpectation * cacheExpectation = [self expectationWithDescription:@"Attribute cache read"]; - [MTROnOff readAttributeOnOffWithAttributeCache:attributeCacheContainer - endpoint:@1 - queue:queue - completionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute cache value: %@, error: %@", value, err); - XCTAssertEqual([MTRErrorTestUtils errorToZCLErrorCode:err], 0); - XCTAssertTrue([value isEqualToNumber:[NSNumber numberWithBool:YES]]); - [cacheExpectation fulfill]; - }]; + [MTRBaseClusterOnOff readAttributeOnOffWithAttributeCache:attributeCacheContainer + endpoint:@1 + queue:queue + completionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute cache value: %@, error: %@", value, err); + XCTAssertEqual([MTRErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertTrue([value isEqualToNumber:[NSNumber numberWithBool:YES]]); + [cacheExpectation fulfill]; + }]; [self waitForExpectations:[NSArray arrayWithObject:cacheExpectation] timeout:kTimeoutInSeconds]; // Add another subscriber of the attribute to verify that attribute cache still works when there are other subscribers. @@ -944,7 +944,7 @@ - (void)test012_SubscriptionError [self initStack]; [self waitForCommissionee]; #endif - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); XCTestExpectation * deregisterExpectation = [self expectationWithDescription:@"Report handler deregistered"]; [device deregisterReportHandlersWithClientQueue:queue @@ -1052,7 +1052,7 @@ - (void)test900_SubscribeAllAttributes [self initStack]; [self waitForCommissionee]; #endif - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); XCTestExpectation * cleanSubscriptionExpectation = [self expectationWithDescription:@"Previous subscriptions cleaned"]; NSLog(@"Deregistering report handlers..."); @@ -1229,7 +1229,7 @@ - (void)test999_TearDown @end -@interface MTRDevice (Test) +@interface MTRBaseDevice (Test) // Test function for whitebox testing + (id)CHIPEncodeAndDecodeNSObject:(id)object; @end @@ -1243,7 +1243,7 @@ - (void)testSignedInteger { NSDictionary * input = [NSDictionary dictionaryWithObjectsAndKeys:@"SignedInteger", @"type", [NSNumber numberWithInteger:-713], @"value", nil]; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:input]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:input]; NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1254,7 +1254,7 @@ - (void)testSignedInteger64Bits { NSDictionary * input = [NSDictionary dictionaryWithObjectsAndKeys:@"SignedInteger", @"type", [NSNumber numberWithInteger:-0x7000111122223333ll], @"value", nil]; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:input]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:input]; NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1265,7 +1265,7 @@ - (void)testUnsignedInteger { NSDictionary * input = [NSDictionary dictionaryWithObjectsAndKeys:@"UnsignedInteger", @"type", [NSNumber numberWithInteger:1025], @"value", nil]; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:input]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:input]; NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1276,7 +1276,7 @@ - (void)testUnsignedInteger64Bits { NSDictionary * input = [NSDictionary dictionaryWithObjectsAndKeys:@"UnsignedInteger", @"type", [NSNumber numberWithUnsignedLongLong:0xCCCCDDDDEEEEFFFFull], @"value", nil]; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:input]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:input]; NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1287,7 +1287,7 @@ - (void)testBoolean { NSDictionary * input = [NSDictionary dictionaryWithObjectsAndKeys:@"Boolean", @"type", [NSNumber numberWithBool:YES], @"value", nil]; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:input]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:input]; NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1297,7 +1297,7 @@ - (void)testBoolean - (void)testUTF8String { NSDictionary * input = [NSDictionary dictionaryWithObjectsAndKeys:@"UTF8String", @"type", @"Hello World", @"value", nil]; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:input]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:input]; NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1309,7 +1309,7 @@ - (void)testOctetString const uint8_t data[] = { 0x00, 0xF2, 0x63 }; NSDictionary * input = [NSDictionary dictionaryWithObjectsAndKeys:@"OctetString", @"type", [NSData dataWithBytes:data length:sizeof(data)], @"value", nil]; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:input]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:input]; NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1320,7 +1320,7 @@ - (void)testFloat { NSDictionary * input = [NSDictionary dictionaryWithObjectsAndKeys:@"Float", @"type", [NSNumber numberWithFloat:0.1245], @"value", nil]; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:input]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:input]; NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1332,7 +1332,7 @@ - (void)testDouble { NSDictionary * input = [NSDictionary dictionaryWithObjectsAndKeys:@"Double", @"type", [NSNumber numberWithFloat:0.1245], @"value", nil]; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:input]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:input]; NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1343,7 +1343,7 @@ - (void)testDouble - (void)testNull { NSDictionary * input = [NSDictionary dictionaryWithObjectsAndKeys:@"Null", @"type", nil]; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:input]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:input]; NSLog(@"Conversion input: %@\nOutput: %@", input, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1364,7 +1364,7 @@ - (void)testStructure ]; NSDictionary * inputValue = @{ @"type" : @"Structure", @"value" : inputFields }; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:inputValue]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:inputValue]; NSLog(@"Conversion input: %@\nOutput: %@", inputValue, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); @@ -1379,7 +1379,7 @@ - (void)testArray ]; NSDictionary * inputValue = @{ @"type" : @"Array", @"value" : inputFields }; - id output = [MTRDevice CHIPEncodeAndDecodeNSObject:inputValue]; + id output = [MTRBaseDevice CHIPEncodeAndDecodeNSObject:inputValue]; NSLog(@"Conversion input: %@\nOutput: %@", inputValue, output); XCTAssertNotNil(output); XCTAssertTrue([output isKindOfClass:[NSDictionary class]]); diff --git a/src/darwin/Framework/CHIPTests/MTRXPCListenerSampleTests.m b/src/darwin/Framework/CHIPTests/MTRXPCListenerSampleTests.m index 3b3b3bc26ac38a..810788d6190ad1 100644 --- a/src/darwin/Framework/CHIPTests/MTRXPCListenerSampleTests.m +++ b/src/darwin/Framework/CHIPTests/MTRXPCListenerSampleTests.m @@ -19,7 +19,7 @@ */ // module headers -#import +#import #import #import "MTRErrorTestUtils.h" @@ -172,7 +172,7 @@ - (void)readAttributeWithController:(id)controller if (sharedController) { [sharedController getDevice:nodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { if (error) { NSLog(@"Failed to get connected device"); completion(nil, error); @@ -208,7 +208,7 @@ - (void)writeAttributeWithController:(id)controller if (sharedController) { [sharedController getDevice:nodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { if (error) { NSLog(@"Failed to get connected device"); completion(nil, error); @@ -245,7 +245,7 @@ - (void)invokeCommandWithController:(id)controller if (sharedController) { [sharedController getDevice:nodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { if (error) { NSLog(@"Failed to get connected device"); completion(nil, error); @@ -282,7 +282,7 @@ - (void)subscribeAttributeWithController:(id)controller if (sharedController) { [sharedController getDevice:nodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { if (error) { NSLog(@"Failed to get connected device"); establishedHandler(); @@ -332,7 +332,7 @@ - (void)stopReportsWithController:(id _Nullable)controller nodeId:(uint64_t)node if (sharedController) { [sharedController getDevice:nodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { if (error) { NSLog(@"Failed to get connected device"); } else { @@ -362,7 +362,7 @@ - (void)subscribeWithController:(id _Nullable)controller [sharedController getDevice:nodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { if (error) { NSLog(@"Error: Failed to get connected device (%llu) for attribute cache: %@", nodeId, error); completion(error); @@ -439,11 +439,11 @@ - (void)readAttributeCacheWithController:(id _Nullable)controller // This test suite reuses a device object to speed up the test process for CI. // The following global variable holds the reference to the device object. -static MTRDevice * mConnectedDevice; +static MTRBaseDevice * mConnectedDevice; static MTRDeviceController * mDeviceController; static MTRXPCListenerSample * mSampleListener; -static MTRDevice * GetConnectedDevice(void) +static MTRBaseDevice * GetConnectedDevice(void) { XCTAssertNotNil(mConnectedDevice); return mConnectedDevice; @@ -548,7 +548,7 @@ - (void)initStack __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; [controller getDevice:kDeviceId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertEqual(error.code, 0); [connectionExpectation fulfill]; connectionExpectation = nil; @@ -591,7 +591,7 @@ - (void)waitForCommissionee }]; [remoteController getDevice:kDeviceId queue:queue - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { mConnectedDevice = device; [expectation fulfill]; }]; @@ -616,7 +616,7 @@ - (void)test001_ReadAttribute XCTestExpectation * expectation = [self expectationWithDescription:@"read DeviceDescriptor DeviceType attribute for all endpoints"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); [device readAttributeWithEndpointId:nil @@ -656,7 +656,7 @@ - (void)test002_WriteAttribute #endif XCTestExpectation * expectation = [self expectationWithDescription:@"write LevelControl Brightness attribute"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); NSDictionary * writeValue = [NSDictionary @@ -699,7 +699,7 @@ - (void)test003_InvokeCommand #endif XCTestExpectation * expectation = [self expectationWithDescription:@"invoke MoveToLevelWithOnOff command"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); NSDictionary * fields = @{ @@ -749,7 +749,7 @@ - (void)test004_Subscribe #endif XCTestExpectation * expectation = [self expectationWithDescription:@"subscribe OnOff attribute"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); [device subscribeAttributeWithEndpointId:@1 @@ -840,7 +840,7 @@ - (void)test005_ReadAttributeFailure #endif XCTestExpectation * expectation = [self expectationWithDescription:@"read failed"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); [device readAttributeWithEndpointId:@0 @@ -871,7 +871,7 @@ - (void)test006_WriteAttributeFailure #endif XCTestExpectation * expectation = [self expectationWithDescription:@"write failed"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); NSDictionary * writeValue = [NSDictionary @@ -906,7 +906,7 @@ - (void)test007_InvokeCommandFailure #endif XCTestExpectation * expectation = [self expectationWithDescription:@"invoke MoveToLevelWithOnOff command"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); NSDictionary *fields = [NSDictionary dictionaryWithObjectsAndKeys: @@ -959,7 +959,7 @@ - (void)test008_SubscribeFailure [errorReportExpectation fulfill]; }; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); [device subscribeAttributeWithEndpointId:@10000 @@ -996,7 +996,7 @@ - (void)test009_ReadAttributeWithParams XCTestExpectation * expectation = [self expectationWithDescription:@"read DeviceDescriptor DeviceType attribute for all endpoints"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); MTRReadParams * readParams = [[MTRReadParams alloc] init]; @@ -1036,7 +1036,7 @@ - (void)test010_SubscribeWithNoParams [self initStack]; [self waitForCommissionee]; #endif - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); XCTestExpectation * clearExpectation = [self expectationWithDescription:@"report handlers deregistered"]; @@ -1215,7 +1215,7 @@ - (void)test011_SubscribeWithParams [self initStack]; [self waitForCommissionee]; #endif - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); XCTestExpectation * clearExpectation = [self expectationWithDescription:@"report handlers deregistered"]; @@ -1403,7 +1403,7 @@ - (void)test012_SubscribeKeepingPreviousSubscription [self initStack]; [self waitForCommissionee]; #endif - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); XCTestExpectation * clearExpectation = [self expectationWithDescription:@"report handlers deregistered"]; @@ -1582,7 +1582,7 @@ - (void)test013_TimedWriteAttribute [self initStack]; [self waitForCommissionee]; #endif - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); // Write an initial value @@ -1725,7 +1725,7 @@ - (void)test014_TimedInvokeCommand #endif XCTestExpectation * expectation = [self expectationWithDescription:@"invoke MoveToLevelWithOnOff command"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); NSDictionary * fields = @{ @@ -1774,7 +1774,7 @@ - (void)test900_SubscribeAttributeCache #endif XCTestExpectation * expectation = [self expectationWithDescription:@"subscribe attributes by cache"]; - MTRDevice * device = GetConnectedDevice(); + MTRBaseDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); MTRAttributeCacheContainer * attributeCacheContainer = [[MTRAttributeCacheContainer alloc] init]; diff --git a/src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m b/src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m index b01535c07ad3bf..2ebdeedec4f6e6 100644 --- a/src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m +++ b/src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m @@ -100,7 +100,7 @@ - (void)subscribeWithDeviceController:(MTRDeviceController *)deviceController }; [deviceController getDevice:deviceId queue:workQueue - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { if (error) { NSLog(@"Error: Failed to get connected device (%llu) for attribute cache: %@", deviceId, error); completionHandler(error); @@ -365,7 +365,7 @@ - (void)testReadAttributeSuccess [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Reading..."); @@ -427,7 +427,7 @@ - (void)testReadAttributeWithParamsSuccess [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Reading..."); @@ -480,7 +480,7 @@ - (void)testReadAttributeFailure [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Reading..."); @@ -539,7 +539,7 @@ - (void)testWriteAttributeSuccess [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Writing..."); @@ -602,7 +602,7 @@ - (void)testTimedWriteAttributeSuccess [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Writing..."); @@ -658,7 +658,7 @@ - (void)testWriteAttributeFailure [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Writing..."); @@ -718,7 +718,7 @@ - (void)testInvokeCommandSuccess [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Invoking command..."); @@ -781,7 +781,7 @@ - (void)testTimedInvokeCommandSuccess [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Invoking command..."); @@ -840,7 +840,7 @@ - (void)testInvokeCommandFailure [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Invoking command..."); @@ -906,7 +906,7 @@ - (void)testSubscribeAttributeSuccess [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -969,7 +969,7 @@ - (void)testSubscribeAttributeSuccess // Deregister report handler [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -1026,7 +1026,7 @@ - (void)testSubscribeAttributeWithParamsSuccess [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -1089,7 +1089,7 @@ - (void)testSubscribeAttributeWithParamsSuccess // Deregister report handler [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -1141,7 +1141,7 @@ - (void)testBadlyFormattedReport [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -1202,7 +1202,7 @@ - (void)testBadlyFormattedReport _xpcDisconnectExpectation.inverted = NO; [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -1255,7 +1255,7 @@ - (void)testReportWithUnrelatedEndpointId [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -1318,7 +1318,7 @@ - (void)testReportWithUnrelatedEndpointId // Deregister report handler [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -1371,7 +1371,7 @@ - (void)testReportWithUnrelatedClusterId [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -1434,7 +1434,7 @@ - (void)testReportWithUnrelatedClusterId // Deregister report handler [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -1487,7 +1487,7 @@ - (void)testReportWithUnrelatedAttributeId [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -1550,7 +1550,7 @@ - (void)testReportWithUnrelatedAttributeId // Deregister report handler [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -1603,7 +1603,7 @@ - (void)testReportWithUnrelatedNode [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -1666,7 +1666,7 @@ - (void)testReportWithUnrelatedNode // Deregister report handler [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -1718,7 +1718,7 @@ - (void)testSubscribeMultiEndpoints [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -1781,7 +1781,7 @@ - (void)testSubscribeMultiEndpoints // Deregister report handler [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -1833,7 +1833,7 @@ - (void)testSubscribeMultiClusters [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -1896,7 +1896,7 @@ - (void)testSubscribeMultiClusters // Deregister report handler [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -1948,7 +1948,7 @@ - (void)testSubscribeMultiAttributes [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -2011,7 +2011,7 @@ - (void)testSubscribeMultiAttributes // Deregister report handler [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -2074,7 +2074,7 @@ - (void)testMutiSubscriptions [_remoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Subscribing..."); @@ -2148,7 +2148,7 @@ - (void)testMutiSubscriptions __auto_type deregisterExpectation = [self expectationWithDescription:@"First subscriber deregistered"]; [_remoteDeviceController getDevice:nodeToStop queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -2206,7 +2206,7 @@ - (void)testMutiSubscriptions __auto_type secondDeregisterExpectation = [self expectationWithDescription:@"Second subscriber deregistered"]; [_remoteDeviceController getDevice:nodeToStop queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { NSLog(@"Device acquired. Deregistering..."); [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:^{ @@ -2276,7 +2276,7 @@ - (void)testAnySharedRemoteController __auto_type deviceAcquired = [self expectationWithDescription:@"Connected device was acquired"]; [unspecifiedRemoteDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); [deviceAcquired fulfill]; @@ -2536,7 +2536,7 @@ - (void)testXPCConnectionFailure [failingDeviceController getDevice:myNodeId queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { XCTAssertNotNil(device); XCTAssertNil(error); NSLog(@"Device acquired. Reading..."); diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 305a9f857e9937..688e7fa03bb1fc 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -10,8 +10,8 @@ 1E85730C265519AE0050A4D9 /* callback-stub.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E857307265519AE0050A4D9 /* callback-stub.cpp */; }; 1EB41B7B263C4CC60048E4C1 /* MTRClustersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EB41B7A263C4CC60048E4C1 /* MTRClustersTests.m */; }; 1EC3238D271999E2002A8BF0 /* cluster-objects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1EC3238C271999E2002A8BF0 /* cluster-objects.cpp */; }; - 1EC4CE5D25CC26E900D7304F /* MTRClustersObjc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1EC4CE5925CC26E900D7304F /* MTRClustersObjc.mm */; }; - 1EC4CE6425CC276600D7304F /* MTRClustersObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EC4CE6325CC276600D7304F /* MTRClustersObjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1EC4CE5D25CC26E900D7304F /* MTRBaseClusters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1EC4CE5925CC26E900D7304F /* MTRBaseClusters.mm */; }; + 1EC4CE6425CC276600D7304F /* MTRBaseClusters.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EC4CE6325CC276600D7304F /* MTRBaseClusters.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1ED276E026C57CF000547A89 /* MTRCallbackBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ED276DF26C57CF000547A89 /* MTRCallbackBridge.mm */; }; 1ED276E226C5812A00547A89 /* MTRCluster.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ED276E126C5812A00547A89 /* MTRCluster.mm */; }; 1ED276E426C5832500547A89 /* MTRCluster.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ED276E326C5832500547A89 /* MTRCluster.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -19,9 +19,9 @@ 27A53C1827FBC6920053F131 /* MTRAttestationTrustStoreBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 27A53C1627FBC6920053F131 /* MTRAttestationTrustStoreBridge.mm */; }; 2C1B027A2641DB4E00780EF1 /* MTROperationalCredentialsDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2C1B02782641DB4E00780EF1 /* MTROperationalCredentialsDelegate.mm */; }; 2C1B027B2641DB4E00780EF1 /* MTROperationalCredentialsDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C1B02792641DB4E00780EF1 /* MTROperationalCredentialsDelegate.h */; }; - 2C222AD0255C620600E446B9 /* MTRDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C222ACE255C620600E446B9 /* MTRDevice.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2C222AD1255C620600E446B9 /* MTRDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2C222ACF255C620600E446B9 /* MTRDevice.mm */; }; - 2C222ADF255C811800E446B9 /* MTRDevice_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C222ADE255C811800E446B9 /* MTRDevice_Internal.h */; }; + 2C222AD0255C620600E446B9 /* MTRBaseDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C222ACE255C620600E446B9 /* MTRBaseDevice.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2C222AD1255C620600E446B9 /* MTRBaseDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2C222ACF255C620600E446B9 /* MTRBaseDevice.mm */; }; + 2C222ADF255C811800E446B9 /* MTRBaseDevice_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C222ADE255C811800E446B9 /* MTRBaseDevice_Internal.h */; }; 2C4DF09E248B2C60009307CB /* libmbedtls.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C4DF09D248B2C60009307CB /* libmbedtls.a */; settings = {ATTRIBUTES = (Required, ); }; }; 2C5EEEF6268A85C400CAE3D3 /* MTRDeviceConnectionBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C5EEEF4268A85C400CAE3D3 /* MTRDeviceConnectionBridge.h */; }; 2C5EEEF7268A85C400CAE3D3 /* MTRDeviceConnectionBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2C5EEEF5268A85C400CAE3D3 /* MTRDeviceConnectionBridge.mm */; }; @@ -76,6 +76,7 @@ 5AE6D4E427A99041001F2493 /* MTRDeviceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AE6D4E327A99041001F2493 /* MTRDeviceTests.m */; }; 754F3DF427FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 754F3DF327FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h */; }; 7560FD1C27FBBD3F005E85B3 /* MTREventTLVValueDecoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7560FD1B27FBBD3F005E85B3 /* MTREventTLVValueDecoder.mm */; }; + 7596A83E28751220004DAE0E /* MTRBaseClusters_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7596A83D28751220004DAE0E /* MTRBaseClusters_internal.h */; }; 88EBF8CE27FABDD500686BC1 /* MTRDeviceAttestationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 88EBF8CB27FABDD500686BC1 /* MTRDeviceAttestationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 88EBF8CF27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 88EBF8CC27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.mm */; }; 88EBF8D027FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 88EBF8CD27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.h */; }; @@ -125,8 +126,8 @@ 1E857307265519AE0050A4D9 /* callback-stub.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "callback-stub.cpp"; path = "../../../../zzz_generated/controller-clusters/zap-generated/callback-stub.cpp"; sourceTree = ""; }; 1EB41B7A263C4CC60048E4C1 /* MTRClustersTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRClustersTests.m; sourceTree = ""; }; 1EC3238C271999E2002A8BF0 /* cluster-objects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "cluster-objects.cpp"; path = "../../../../zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp"; sourceTree = ""; }; - 1EC4CE5925CC26E900D7304F /* MTRClustersObjc.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MTRClustersObjc.mm; path = "zap-generated/MTRClustersObjc.mm"; sourceTree = ""; }; - 1EC4CE6325CC276600D7304F /* MTRClustersObjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTRClustersObjc.h; path = "zap-generated/MTRClustersObjc.h"; sourceTree = ""; }; + 1EC4CE5925CC26E900D7304F /* MTRBaseClusters.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MTRBaseClusters.mm; path = "zap-generated/MTRBaseClusters.mm"; sourceTree = ""; }; + 1EC4CE6325CC276600D7304F /* MTRBaseClusters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTRBaseClusters.h; path = "zap-generated/MTRBaseClusters.h"; sourceTree = ""; }; 1ED276DF26C57CF000547A89 /* MTRCallbackBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MTRCallbackBridge.mm; path = "zap-generated/MTRCallbackBridge.mm"; sourceTree = ""; }; 1ED276E126C5812A00547A89 /* MTRCluster.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCluster.mm; sourceTree = ""; }; 1ED276E326C5832500547A89 /* MTRCluster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRCluster.h; sourceTree = ""; }; @@ -134,9 +135,9 @@ 27A53C1627FBC6920053F131 /* MTRAttestationTrustStoreBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRAttestationTrustStoreBridge.mm; sourceTree = ""; }; 2C1B02782641DB4E00780EF1 /* MTROperationalCredentialsDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTROperationalCredentialsDelegate.mm; sourceTree = ""; }; 2C1B02792641DB4E00780EF1 /* MTROperationalCredentialsDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTROperationalCredentialsDelegate.h; sourceTree = ""; }; - 2C222ACE255C620600E446B9 /* MTRDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDevice.h; sourceTree = ""; }; - 2C222ACF255C620600E446B9 /* MTRDevice.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDevice.mm; sourceTree = ""; }; - 2C222ADE255C811800E446B9 /* MTRDevice_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDevice_Internal.h; sourceTree = ""; }; + 2C222ACE255C620600E446B9 /* MTRBaseDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRBaseDevice.h; sourceTree = ""; }; + 2C222ACF255C620600E446B9 /* MTRBaseDevice.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRBaseDevice.mm; sourceTree = ""; }; + 2C222ADE255C811800E446B9 /* MTRBaseDevice_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRBaseDevice_Internal.h; sourceTree = ""; }; 2C4DF09D248B2C60009307CB /* libmbedtls.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmbedtls.a; path = lib/libmbedtls.a; sourceTree = BUILT_PRODUCTS_DIR; }; 2C5EEEF4268A85C400CAE3D3 /* MTRDeviceConnectionBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceConnectionBridge.h; sourceTree = ""; }; 2C5EEEF5268A85C400CAE3D3 /* MTRDeviceConnectionBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceConnectionBridge.mm; sourceTree = ""; }; @@ -191,6 +192,7 @@ 5AE6D4E327A99041001F2493 /* MTRDeviceTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MTRDeviceTests.m; sourceTree = ""; }; 754F3DF327FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTREventTLVValueDecoder_Internal.h; sourceTree = ""; }; 7560FD1B27FBBD3F005E85B3 /* MTREventTLVValueDecoder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MTREventTLVValueDecoder.mm; path = "zap-generated/MTREventTLVValueDecoder.mm"; sourceTree = ""; }; + 7596A83D28751220004DAE0E /* MTRBaseClusters_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTRBaseClusters_internal.h; path = "zap-generated/MTRBaseClusters_internal.h"; sourceTree = ""; }; 88EBF8CB27FABDD500686BC1 /* MTRDeviceAttestationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationDelegate.h; sourceTree = ""; }; 88EBF8CC27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceAttestationDelegateBridge.mm; sourceTree = ""; }; 88EBF8CD27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationDelegateBridge.h; sourceTree = ""; }; @@ -275,8 +277,9 @@ 1EC3238C271999E2002A8BF0 /* cluster-objects.cpp */, 1ED276DF26C57CF000547A89 /* MTRCallbackBridge.mm */, 1E857307265519AE0050A4D9 /* callback-stub.cpp */, - 1EC4CE6325CC276600D7304F /* MTRClustersObjc.h */, - 1EC4CE5925CC26E900D7304F /* MTRClustersObjc.mm */, + 1EC4CE6325CC276600D7304F /* MTRBaseClusters.h */, + 1EC4CE5925CC26E900D7304F /* MTRBaseClusters.mm */, + 7596A83D28751220004DAE0E /* MTRBaseClusters_internal.h */, D4772A45285AE98300383630 /* MTRClusterConstants.h */, ); name = CHIPGeneratedFiles; @@ -323,9 +326,9 @@ 2C1B02792641DB4E00780EF1 /* MTROperationalCredentialsDelegate.h */, 2C1B02782641DB4E00780EF1 /* MTROperationalCredentialsDelegate.mm */, 1EC4CE5825CC26AB00D7304F /* CHIPGeneratedFiles */, - 2C222ADE255C811800E446B9 /* MTRDevice_Internal.h */, - 2C222ACE255C620600E446B9 /* MTRDevice.h */, - 2C222ACF255C620600E446B9 /* MTRDevice.mm */, + 2C222ADE255C811800E446B9 /* MTRBaseDevice_Internal.h */, + 2C222ACE255C620600E446B9 /* MTRBaseDevice.h */, + 2C222ACF255C620600E446B9 /* MTRBaseDevice.mm */, 2C8C8FBE253E0C2100797F05 /* MTRPersistentStorageDelegate.h */, 5ACDDD7927CD129700EFD68A /* MTRAttributeCacheContainer.h */, 5A60370727EA1FF60020DB79 /* MTRAttributeCacheContainer+XPC.h */, @@ -442,13 +445,14 @@ 513DDB862761F69300DAA01A /* MTRAttributeTLVValueDecoder_Internal.h in Headers */, 2CB7163F252F731E0026E2BB /* MTRDevicePairingDelegate.h in Headers */, 88EBF8CE27FABDD500686BC1 /* MTRDeviceAttestationDelegate.h in Headers */, - 2C222AD0255C620600E446B9 /* MTRDevice.h in Headers */, + 2C222AD0255C620600E446B9 /* MTRBaseDevice.h in Headers */, 991DC0842475F45400C13860 /* MTRDeviceController.h in Headers */, AF1CB86E2874B03B00865A96 /* MTROTAProviderDelegate.h in Headers */, 754F3DF427FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h in Headers */, B2E0D7B2245B0B5C003C5B48 /* MTRManualSetupPayloadParser.h in Headers */, B2E0D7B1245B0B5C003C5B48 /* Matter.h in Headers */, B2E0D7B8245B0B5C003C5B48 /* MTRSetupPayload.h in Headers */, + 7596A83E28751220004DAE0E /* MTRBaseClusters_internal.h in Headers */, 997DED182695344800975E97 /* MTRThreadOperationalDataset.h in Headers */, 9956064426420367000C28DE /* MTRSetupPayload_Internal.h in Headers */, 27A53C1727FBC6920053F131 /* MTRAttestationTrustStoreBridge.h in Headers */, @@ -464,12 +468,12 @@ 2C8C8FC1253E0C2100797F05 /* MTRPersistentStorageDelegate.h in Headers */, AF1CB8702874B04C00865A96 /* MTROTAProviderDelegateBridge.h in Headers */, B2E0D7B5245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.h in Headers */, - 1EC4CE6425CC276600D7304F /* MTRClustersObjc.h in Headers */, + 1EC4CE6425CC276600D7304F /* MTRBaseClusters.h in Headers */, 2C5EEEF6268A85C400CAE3D3 /* MTRDeviceConnectionBridge.h in Headers */, 2C8C8FC0253E0C2100797F05 /* MTRPersistentStorageDelegateBridge.h in Headers */, 51E51FC0282AD37A00FC978D /* MTRDeviceControllerStartupParams_Internal.h in Headers */, 998F286F26D55EC5001846C6 /* MTRP256KeypairBridge.h in Headers */, - 2C222ADF255C811800E446B9 /* MTRDevice_Internal.h in Headers */, + 2C222ADF255C811800E446B9 /* MTRBaseDevice_Internal.h in Headers */, 51E0310027EA20D20083DC9C /* MTRControllerAccessControl.h in Headers */, 991DC08B247704DC00C13860 /* MTRLogging.h in Headers */, 5A7947E527C0129F00434CF2 /* MTRDeviceController+XPC.h in Headers */, @@ -608,11 +612,11 @@ 51B22C2A2740CB47008D5055 /* MTRCommandPayloadsObjc.mm in Sources */, 2C5EEEF7268A85C400CAE3D3 /* MTRDeviceConnectionBridge.mm in Sources */, 51B22C262740CB32008D5055 /* MTRStructsObjc.mm in Sources */, - 2C222AD1255C620600E446B9 /* MTRDevice.mm in Sources */, + 2C222AD1255C620600E446B9 /* MTRBaseDevice.mm in Sources */, 1EC3238D271999E2002A8BF0 /* cluster-objects.cpp in Sources */, 991DC0892475F47D00C13860 /* MTRDeviceController.mm in Sources */, B2E0D7B7245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.mm in Sources */, - 1EC4CE5D25CC26E900D7304F /* MTRClustersObjc.mm in Sources */, + 1EC4CE5D25CC26E900D7304F /* MTRBaseClusters.mm in Sources */, 51E0310127EA20D20083DC9C /* MTRControllerAccessControl.mm in Sources */, 1ED276E226C5812A00547A89 /* MTRCluster.mm in Sources */, B2E0D7B3245B0B5C003C5B48 /* MTRError.mm in Sources */,