From ae2913fc75e177367ed4f960751ed4e95f85ed5b Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Wed, 6 Jul 2022 19:02:55 -0700 Subject: [PATCH] Issue 20336 - Darwin: rename MTRDevice and MTRClsutersObjc files and classes (#20345) * Issue 20336 - Darwin: rename MTRDevice and MTRClsutersObjc files and classes * Restyled by astyle * Restyled by clang-format * Restyled by jq * Restyled by prettier-json * uncommited zap generated file MTRBaseClusters.mm * Restyled by astyle * Restyled by clang-format * Restyled by jq * Restyled by prettier-json Co-authored-by: Restyled.io --- .restyled.yaml | 2 +- .../Framework Helpers/DefaultsUtils.h | 2 +- .../Framework Helpers/DefaultsUtils.m | 15 +- .../Bindings/BindingsViewController.m | 4 +- .../Enumeration/EnumerateViewController.m | 15 +- .../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 | 2 +- src/darwin/Framework/CHIP/MTRCluster.mm | 2 +- .../Framework/CHIP/MTRCluster_internal.h | 6 +- .../CHIP/MTRDeviceConnectionBridge.mm | 4 +- .../Framework/CHIP/MTRDeviceController+XPC.m | 2 +- .../Framework/CHIP/MTRDeviceController.h | 10 +- .../Framework/CHIP/MTRDeviceController.mm | 12 +- .../CHIP/MTRDeviceControllerOverXPC.m | 6 +- src/darwin/Framework/CHIP/MTRDeviceOverXPC.h | 4 +- src/darwin/Framework/CHIP/Matter.h | 4 +- ...Objc-src.zapt => MTRBaseClusters-src.zapt} | 14 +- ...ClustersObjc.zapt => MTRBaseClusters.zapt} | 4 +- ...nal.zapt => MTRBaseClusters_internal.zapt} | 7 +- .../Framework/CHIP/templates/templates.json | 12 +- .../{MTRClustersObjc.h => MTRBaseClusters.h} | 256 +++--- ...{MTRClustersObjc.mm => MTRBaseClusters.mm} | 262 +++--- .../zap-generated/MTRBaseClusters_internal.h | 409 ++++++++++ .../Framework/CHIPTests/MTRClustersTests.m | 34 +- .../Framework/CHIPTests/MTRControllerTests.m | 10 +- .../Framework/CHIPTests/MTRDeviceTests.m | 166 ++-- .../CHIPTests/MTRXPCListenerSampleTests.m | 396 ++++----- .../Framework/CHIPTests/MTRXPCProtocolTests.m | 760 +++++++++--------- .../Matter.xcodeproj/project.pbxproj | 44 +- 38 files changed, 1499 insertions(+), 1069 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} (97%) rename src/darwin/Framework/CHIP/templates/{MTRClustersObjc.zapt => MTRBaseClusters.zapt} (96%) rename src/darwin/Framework/CHIP/templates/{MTRClustersObjc_internal.zapt => MTRBaseClusters_internal.zapt} (66%) rename src/darwin/Framework/CHIP/zap-generated/{MTRClustersObjc.h => MTRBaseClusters.h} (99%) rename src/darwin/Framework/CHIP/zap-generated/{MTRClustersObjc.mm => MTRBaseClusters.mm} (99%) create mode 100644 src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h diff --git a/.restyled.yaml b/.restyled.yaml index 95780a56920d35..c45fe98588b7ec 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -72,7 +72,7 @@ exclude: - "scripts/idl/tests/outputs/**/*" # Matches generated output 1:1 - "examples/chef/sample_app_util/test_files/*.yaml" - "examples/chef/zzz_generated/**/*" - - "src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc.mm" # https://github.com/project-chip/connectedhomeip/issues/20236 + - "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm" # https://github.com/project-chip/connectedhomeip/issues/20236 changed_paths: 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..3440a251b98bbe 100644 --- a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m +++ b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m @@ -135,14 +135,14 @@ BOOL MTRGetConnectedDevice(MTRDeviceConnectionCallback completionHandler) // Let's use the last device that was paired uint64_t deviceId = MTRGetLastPairedDeviceId(); - return [controller getDevice:deviceId queue:dispatch_get_main_queue() completionHandler:completionHandler]; + return [controller getBaseDevice: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; @@ -154,7 +154,7 @@ BOOL MTRGetConnectedDeviceWithID(uint64_t deviceId, MTRDeviceConnectionCallback { MTRDeviceController * controller = InitializeMTR(); - return [controller getDevice:deviceId queue:dispatch_get_main_queue() completionHandler:completionHandler]; + return [controller getBaseDevice:deviceId queue:dispatch_get_main_queue() completionHandler:completionHandler]; } BOOL MTRIsDevicePaired(uint64_t deviceId) @@ -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..8d6441fc078488 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Enumeration/EnumerateViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Enumeration/EnumerateViewController.m @@ -108,16 +108,16 @@ - (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 - endpoint:0 - queue:dispatch_get_main_queue()]; + MTRBaseClusterDescriptor * descriptorCluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:dispatch_get_main_queue()]; NSLog(@"Reading parts list to get list of endpoints in use..."); [descriptorCluster readAttributePartsListWithCompletionHandler:^( NSArray * _Nullable endpointsInUse, NSError * _Nullable error) { @@ -131,9 +131,10 @@ - (void)enumerate [self updateResult:resultLog]; for (NSNumber * endpoint in endpointsInUse) { - MTRDescriptor * descriptorCluster = [[MTRDescriptor alloc] initWithDevice:device - endpoint:[endpoint unsignedShortValue] - queue:dispatch_get_main_queue()]; + MTRBaseClusterDescriptor * descriptorCluster = + [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:[endpoint unsignedShortValue] + queue:dispatch_get_main_queue()]; [descriptorCluster readAttributeDeviceListWithCompletionHandler:^( NSArray * _Nullable value, NSError * _Nullable error) { if (error) { 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 d7cc4e1c810af5..3517772447353e 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 diff --git a/src/darwin/Framework/CHIP/MTRCluster.mm b/src/darwin/Framework/CHIP/MTRCluster.mm index 384c509565420d..17d943996bdba8 100644 --- a/src/darwin/Framework/CHIP/MTRCluster.mm +++ b/src/darwin/Framework/CHIP/MTRCluster.mm @@ -15,8 +15,8 @@ * limitations under the License. */ +#import "MTRBaseDevice.h" #import "MTRCluster_internal.h" -#import "MTRDevice.h" #import "NSDataSpanConversion.h" using namespace ::chip; diff --git a/src/darwin/Framework/CHIP/MTRCluster_internal.h b/src/darwin/Framework/CHIP/MTRCluster_internal.h index 2ef58581c9e6f8..615b8eb732b48d 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" NS_ASSUME_NONNULL_BEGIN 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 c05e442328ea8c..61db4061896d10 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,8 +92,10 @@ 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; -- (BOOL)getDevice:(uint64_t)deviceID queue:(dispatch_queue_t)queue completionHandler:(MTRDeviceConnectionCallback)completionHandler; +- (nullable MTRBaseDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError * __autoreleasing *)error; +- (BOOL)getBaseDevice:(uint64_t)deviceID + queue:(dispatch_queue_t)queue + completionHandler:(MTRDeviceConnectionCallback)completionHandler; - (BOOL)openPairingWindow:(uint64_t)deviceID duration:(NSUInteger)duration error:(NSError * __autoreleasing *)error; - (nullable NSString *)openPairingWindowWithPIN:(uint64_t)deviceID diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 86e8b66aa0e771..987166a6fc4abf 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,10 +514,12 @@ - (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 +- (BOOL)getBaseDevice:(uint64_t)deviceID + queue:(dispatch_queue_t)queue + completionHandler:(MTRDeviceConnectionCallback)completionHandler { __block CHIP_ERROR errorCode = CHIP_ERROR_INCORRECT_STATE; if (![self isRunning]) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m index a96c3ab65a9bbc..54463a59f99a65 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m @@ -91,13 +91,15 @@ - (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; } -- (BOOL)getDevice:(uint64_t)deviceID queue:(dispatch_queue_t)queue completionHandler:(MTRDeviceConnectionCallback)completionHandler +- (BOOL)getBaseDevice:(uint64_t)deviceID + queue:(dispatch_queue_t)queue + completionHandler:(MTRDeviceConnectionCallback)completionHandler { dispatch_async(_workQueue, ^{ dispatch_group_t group = dispatch_group_create(); 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 97% rename from src/darwin/Framework/CHIP/templates/MTRClustersObjc-src.zapt rename to src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt index 7e8152218b09a2..a120d05653a190 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" @@ -20,9 +20,9 @@ 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}} -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -148,7 +148,7 @@ using namespace chip::app::Clusters; timedWriteTimeout.SetValue(10000); } {{/if}} - + new MTR{{>callbackName}}CallbackBridge(self.callbackQueue, {{! For now, don't change the bridge API; instead just use an adapter to invoke our completion handler. This is not great from a @@ -165,7 +165,7 @@ using namespace chip::app::Clusters; auto failureFn = Callback::FromCancelable(failure); return self.cppCluster->WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); }); - + } {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClustersObjc.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt similarity index 96% rename from src/darwin/Framework/CHIP/templates/MTRClustersObjc.zapt rename to src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index e1fcaee949a99d..98adfc639f4bf0 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClustersObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -20,9 +20,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster {{name}} * {{description}} */ -@interface MTR{{asUpperCamelCase name}} : MTRCluster +@interface MTRBaseCluster{{asUpperCamelCase name}} : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; diff --git a/src/darwin/Framework/CHIP/templates/MTRClustersObjc_internal.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters_internal.zapt similarity index 66% rename from src/darwin/Framework/CHIP/templates/MTRClustersObjc_internal.zapt rename to src/darwin/Framework/CHIP/templates/MTRBaseClusters_internal.zapt index 134372f0d366a3..a86993b5977210 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}} () // Must only touch cppCluster on the Matter queue. @property (readonly) chip::Controller::{{asUpperCamelCase name}}Cluster * cppCluster; - (chip::Controller::{{asUpperCamelCase name}}Cluster **) cppClusterSlot; 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 9aba082e93ca66..43ed2183d0a4f6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -34,9 +34,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Identify * */ -@interface MTRIdentify : MTRCluster +@interface MTRBaseClusterIdentify : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -184,9 +184,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Groups * */ -@interface MTRGroups : MTRCluster +@interface MTRBaseClusterGroups : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -325,9 +325,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Scenes * */ -@interface MTRScenes : MTRCluster +@interface MTRBaseClusterScenes : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -565,9 +565,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster On/Off * */ -@interface MTROnOff : MTRCluster +@interface MTRBaseClusterOnOff : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -779,9 +779,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster On/off Switch Configuration * */ -@interface MTROnOffSwitchConfiguration : MTRCluster +@interface MTRBaseClusterOnOffSwitchConfiguration : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -924,9 +924,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Level Control * */ -@interface MTRLevelControl : MTRCluster +@interface MTRBaseClusterLevelControl : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -1322,9 +1322,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Binary Input (Basic) * */ -@interface MTRBinaryInputBasic : MTRCluster +@interface MTRBaseClusterBinaryInputBasic : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -1608,9 +1608,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Descriptor * */ -@interface MTRDescriptor : MTRCluster +@interface MTRBaseClusterDescriptor : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -1778,9 +1778,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Binding * */ -@interface MTRBinding : MTRCluster +@interface MTRBaseClusterBinding : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -1904,9 +1904,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Access Control * */ -@interface MTRAccessControl : MTRCluster +@interface MTRBaseClusterAccessControl : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -2107,9 +2107,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Bridged Actions * */ -@interface MTRBridgedActions : MTRCluster +@interface MTRBaseClusterBridgedActions : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -2287,9 +2287,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Basic * */ -@interface MTRBasic : MTRCluster +@interface MTRBaseClusterBasic : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -2756,9 +2756,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster OTA Software Update Provider * */ -@interface MTROtaSoftwareUpdateProvider : MTRCluster +@interface MTRBaseClusterOtaSoftwareUpdateProvider : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -2871,9 +2871,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster OTA Software Update Requestor * */ -@interface MTROtaSoftwareUpdateRequestor : MTRCluster +@interface MTRBaseClusterOtaSoftwareUpdateRequestor : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -3058,9 +3058,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Localization Configuration * */ -@interface MTRLocalizationConfiguration : MTRCluster +@interface MTRBaseClusterLocalizationConfiguration : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -3204,9 +3204,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Time Format Localization * */ -@interface MTRTimeFormatLocalization : MTRCluster +@interface MTRBaseClusterTimeFormatLocalization : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -3372,9 +3372,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Unit Localization * */ -@interface MTRUnitLocalization : MTRCluster +@interface MTRBaseClusterUnitLocalization : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -3500,9 +3500,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Power Source Configuration * */ -@interface MTRPowerSourceConfiguration : MTRCluster +@interface MTRBaseClusterPowerSourceConfiguration : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -3621,9 +3621,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Power Source * */ -@interface MTRPowerSource : MTRCluster +@interface MTRBaseClusterPowerSource : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -4297,9 +4297,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster General Commissioning * */ -@interface MTRGeneralCommissioning : MTRCluster +@interface MTRBaseClusterGeneralCommissioning : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -4514,9 +4514,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Network Commissioning * */ -@interface MTRNetworkCommissioning : MTRCluster +@interface MTRBaseClusterNetworkCommissioning : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -4786,9 +4786,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Diagnostic Logs * */ -@interface MTRDiagnosticLogs : MTRCluster +@interface MTRBaseClusterDiagnosticLogs : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -4896,9 +4896,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster General Diagnostics * */ -@interface MTRGeneralDiagnostics : MTRCluster +@interface MTRBaseClusterGeneralDiagnostics : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -5166,9 +5166,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Software Diagnostics * */ -@interface MTRSoftwareDiagnostics : MTRCluster +@interface MTRBaseClusterSoftwareDiagnostics : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -5349,9 +5349,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Thread Network Diagnostics * */ -@interface MTRThreadNetworkDiagnostics : MTRCluster +@interface MTRBaseClusterThreadNetworkDiagnostics : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -6598,9 +6598,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster WiFi Network Diagnostics * */ -@interface MTRWiFiNetworkDiagnostics : MTRCluster +@interface MTRBaseClusterWiFiNetworkDiagnostics : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -6939,9 +6939,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Ethernet Network Diagnostics * */ -@interface MTREthernetNetworkDiagnostics : MTRCluster +@interface MTRBaseClusterEthernetNetworkDiagnostics : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -7207,9 +7207,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Bridged Device Basic * */ -@interface MTRBridgedDeviceBasic : MTRCluster +@interface MTRBaseClusterBridgedDeviceBasic : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -7577,9 +7577,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Switch * */ -@interface MTRSwitch : MTRCluster +@interface MTRBaseClusterSwitch : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -7737,9 +7737,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster AdministratorCommissioning * */ -@interface MTRAdministratorCommissioning : MTRCluster +@interface MTRBaseClusterAdministratorCommissioning : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -7905,9 +7905,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Operational Credentials * */ -@interface MTROperationalCredentials : MTRCluster +@interface MTRBaseClusterOperationalCredentials : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -8141,9 +8141,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Group Key Management * */ -@interface MTRGroupKeyManagement : MTRCluster +@interface MTRBaseClusterGroupKeyManagement : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -8332,9 +8332,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Fixed Label * */ -@interface MTRFixedLabel : MTRCluster +@interface MTRBaseClusterFixedLabel : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -8454,9 +8454,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster User Label * */ -@interface MTRUserLabel : MTRCluster +@interface MTRBaseClusterUserLabel : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -8580,9 +8580,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Boolean State * */ -@interface MTRBooleanState : MTRCluster +@interface MTRBaseClusterBooleanState : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -8703,9 +8703,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Mode Select * */ -@interface MTRModeSelect : MTRCluster +@interface MTRBaseClusterModeSelect : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -8922,9 +8922,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Door Lock * */ -@interface MTRDoorLock : MTRCluster +@interface MTRBaseClusterDoorLock : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -9806,9 +9806,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Window Covering * */ -@interface MTRWindowCovering : MTRCluster +@interface MTRBaseClusterWindowCovering : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -10340,9 +10340,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Barrier Control * */ -@interface MTRBarrierControl : MTRCluster +@interface MTRBaseClusterBarrierControl : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -10662,9 +10662,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Pump Configuration and Control * */ -@interface MTRPumpConfigurationAndControl : MTRCluster +@interface MTRBaseClusterPumpConfigurationAndControl : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -11189,9 +11189,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Thermostat * */ -@interface MTRThermostat : MTRCluster +@interface MTRBaseClusterThermostat : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -12329,9 +12329,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Fan Control * */ -@interface MTRFanControl : MTRCluster +@interface MTRBaseClusterFanControl : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -12649,9 +12649,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Thermostat User Interface Configuration * */ -@interface MTRThermostatUserInterfaceConfiguration : MTRCluster +@interface MTRBaseClusterThermostatUserInterfaceConfiguration : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -12825,9 +12825,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Color Control * */ -@interface MTRColorControl : MTRCluster +@interface MTRBaseClusterColorControl : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -13931,9 +13931,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Illuminance Measurement * */ -@interface MTRIlluminanceMeasurement : MTRCluster +@interface MTRBaseClusterIlluminanceMeasurement : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -14125,9 +14125,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Temperature Measurement * */ -@interface MTRTemperatureMeasurement : MTRCluster +@interface MTRBaseClusterTemperatureMeasurement : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -14301,9 +14301,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Pressure Measurement * */ -@interface MTRPressureMeasurement : MTRCluster +@interface MTRBaseClusterPressureMeasurement : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -14563,9 +14563,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Flow Measurement * */ -@interface MTRFlowMeasurement : MTRCluster +@interface MTRBaseClusterFlowMeasurement : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -14739,9 +14739,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Relative Humidity Measurement * */ -@interface MTRRelativeHumidityMeasurement : MTRCluster +@interface MTRBaseClusterRelativeHumidityMeasurement : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -14915,9 +14915,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Occupancy Sensing * */ -@interface MTROccupancySensing : MTRCluster +@interface MTRBaseClusterOccupancySensing : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -15295,9 +15295,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Wake on LAN * */ -@interface MTRWakeOnLan : MTRCluster +@interface MTRBaseClusterWakeOnLan : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -15418,9 +15418,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Channel * */ -@interface MTRChannel : MTRCluster +@interface MTRBaseClusterChannel : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -15584,9 +15584,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Target Navigator * */ -@interface MTRTargetNavigator : MTRCluster +@interface MTRBaseClusterTargetNavigator : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -15728,9 +15728,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Media Playback * */ -@interface MTRMediaPlayback : MTRCluster +@interface MTRBaseClusterMediaPlayback : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -16006,9 +16006,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Media Input * */ -@interface MTRMediaInput : MTRCluster +@interface MTRBaseClusterMediaInput : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -16155,9 +16155,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Low Power * */ -@interface MTRLowPower : MTRCluster +@interface MTRBaseClusterLowPower : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -16264,9 +16264,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Keypad Input * */ -@interface MTRKeypadInput : MTRCluster +@interface MTRBaseClusterKeypadInput : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -16374,9 +16374,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Content Launcher * */ -@interface MTRContentLauncher : MTRCluster +@interface MTRBaseClusterContentLauncher : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -16528,9 +16528,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Audio Output * */ -@interface MTRAudioOutput : MTRCluster +@interface MTRBaseClusterAudioOutput : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -16673,9 +16673,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Application Launcher * */ -@interface MTRApplicationLauncher : MTRCluster +@interface MTRBaseClusterApplicationLauncher : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -16829,9 +16829,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Application Basic * */ -@interface MTRApplicationBasic : MTRCluster +@interface MTRBaseClusterApplicationBasic : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -17073,9 +17073,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Account Login * */ -@interface MTRAccountLogin : MTRCluster +@interface MTRBaseClusterAccountLogin : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -17187,9 +17187,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Electrical Measurement * */ -@interface MTRElectricalMeasurement : MTRCluster +@interface MTRBaseClusterElectricalMeasurement : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; @@ -19700,9 +19700,9 @@ NS_ASSUME_NONNULL_BEGIN * Cluster Test Cluster * */ -@interface MTRTestCluster : MTRCluster +@interface MTRBaseClusterTestCluster : MTRCluster -- (nullable instancetype)initWithDevice:(MTRDevice *)device +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; 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 518abbae399411..45b77617ef60bc 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 @@ -36,9 +36,9 @@ 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 -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -597,9 +597,9 @@ - (void)dealloc @end -@implementation MTRGroups +@implementation MTRBaseClusterGroups -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -1180,9 +1180,9 @@ - (void)dealloc @end -@implementation MTRScenes +@implementation MTRBaseClusterScenes -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -2296,9 +2296,9 @@ - (void)dealloc @end -@implementation MTROnOff +@implementation MTRBaseClusterOnOff -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -3221,9 +3221,9 @@ - (void)dealloc @end -@implementation MTROnOffSwitchConfiguration +@implementation MTRBaseClusterOnOffSwitchConfiguration -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -3730,9 +3730,9 @@ - (void)dealloc @end -@implementation MTRLevelControl +@implementation MTRBaseClusterLevelControl -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -5443,9 +5443,9 @@ - (void)dealloc @end -@implementation MTRBinaryInputBasic +@implementation MTRBaseClusterBinaryInputBasic -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -6536,9 +6536,9 @@ - (void)dealloc @end -@implementation MTRDescriptor +@implementation MTRBaseClusterDescriptor -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -7133,9 +7133,9 @@ - (void)dealloc @end -@implementation MTRBinding +@implementation MTRBaseClusterBinding -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -7616,9 +7616,9 @@ - (void)dealloc @end -@implementation MTRAccessControl +@implementation MTRBaseClusterAccessControl -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -8467,9 +8467,9 @@ - (void)dealloc @end -@implementation MTRBridgedActions +@implementation MTRBaseClusterBridgedActions -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -9370,9 +9370,9 @@ - (void)dealloc @end -@implementation MTRBasic +@implementation MTRBaseClusterBasic -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -11071,9 +11071,9 @@ - (void)dealloc @end -@implementation MTROtaSoftwareUpdateProvider +@implementation MTRBaseClusterOtaSoftwareUpdateProvider -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -11541,9 +11541,9 @@ - (void)dealloc @end -@implementation MTROtaSoftwareUpdateRequestor +@implementation MTRBaseClusterOtaSoftwareUpdateRequestor -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -12245,9 +12245,9 @@ - (void)dealloc @end -@implementation MTRLocalizationConfiguration +@implementation MTRBaseClusterLocalizationConfiguration -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -12757,9 +12757,9 @@ - (void)dealloc @end -@implementation MTRTimeFormatLocalization +@implementation MTRBaseClusterTimeFormatLocalization -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -13366,9 +13366,9 @@ - (void)dealloc @end -@implementation MTRUnitLocalization +@implementation MTRBaseClusterUnitLocalization -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -13815,9 +13815,9 @@ - (void)dealloc @end -@implementation MTRPowerSourceConfiguration +@implementation MTRBaseClusterPowerSourceConfiguration -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -14231,9 +14231,9 @@ - (void)dealloc @end -@implementation MTRPowerSource +@implementation MTRBaseClusterPowerSource -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -16523,9 +16523,9 @@ - (void)dealloc @end -@implementation MTRGeneralCommissioning +@implementation MTRBaseClusterGeneralCommissioning -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -17309,9 +17309,9 @@ - (void)dealloc @end -@implementation MTRNetworkCommissioning +@implementation MTRBaseClusterNetworkCommissioning -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -18373,9 +18373,9 @@ - (void)dealloc @end -@implementation MTRDiagnosticLogs +@implementation MTRBaseClusterDiagnosticLogs -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -18752,9 +18752,9 @@ - (void)dealloc @end -@implementation MTRGeneralDiagnostics +@implementation MTRBaseClusterGeneralDiagnostics -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -19697,9 +19697,9 @@ - (void)dealloc @end -@implementation MTRSoftwareDiagnostics +@implementation MTRBaseClusterSoftwareDiagnostics -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -20329,9 +20329,9 @@ - (void)dealloc @end -@implementation MTRThreadNetworkDiagnostics +@implementation MTRBaseClusterThreadNetworkDiagnostics -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -24652,9 +24652,9 @@ - (void)dealloc @end -@implementation MTRWiFiNetworkDiagnostics +@implementation MTRBaseClusterWiFiNetworkDiagnostics -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -25847,9 +25847,9 @@ - (void)dealloc @end -@implementation MTREthernetNetworkDiagnostics +@implementation MTRBaseClusterEthernetNetworkDiagnostics -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -26789,9 +26789,9 @@ - (void)dealloc @end -@implementation MTRBridgedDeviceBasic +@implementation MTRBaseClusterBridgedDeviceBasic -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -28089,9 +28089,9 @@ - (void)dealloc @end -@implementation MTRSwitch +@implementation MTRBaseClusterSwitch -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -28627,9 +28627,9 @@ - (void)dealloc @end -@implementation MTRAdministratorCommissioning +@implementation MTRBaseClusterAdministratorCommissioning -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -29261,9 +29261,9 @@ - (void)dealloc @end -@implementation MTROperationalCredentials +@implementation MTRBaseClusterOperationalCredentials -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -30196,9 +30196,9 @@ - (void)dealloc @end -@implementation MTRGroupKeyManagement +@implementation MTRBaseClusterGroupKeyManagement -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -31013,9 +31013,9 @@ - (void)dealloc @end -@implementation MTRFixedLabel +@implementation MTRBaseClusterFixedLabel -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -31427,9 +31427,9 @@ - (void)dealloc @end -@implementation MTRUserLabel +@implementation MTRBaseClusterUserLabel -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -31895,9 +31895,9 @@ - (void)dealloc @end -@implementation MTRBooleanState +@implementation MTRBaseClusterBooleanState -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -32308,9 +32308,9 @@ - (void)dealloc @end -@implementation MTRModeSelect +@implementation MTRBaseClusterModeSelect -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -33132,9 +33132,9 @@ - (void)dealloc @end -@implementation MTRDoorLock +@implementation MTRBaseClusterDoorLock -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -36897,9 +36897,9 @@ - (void)dealloc @end -@implementation MTRWindowCovering +@implementation MTRBaseClusterWindowCovering -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -38864,9 +38864,9 @@ - (void)dealloc @end -@implementation MTRBarrierControl +@implementation MTRBaseClusterBarrierControl -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -40094,9 +40094,9 @@ - (void)dealloc @end -@implementation MTRPumpConfigurationAndControl +@implementation MTRBaseClusterPumpConfigurationAndControl -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -42041,9 +42041,9 @@ - (void)dealloc @end -@implementation MTRThermostat +@implementation MTRBaseClusterThermostat -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -46517,9 +46517,9 @@ - (void)dealloc @end -@implementation MTRFanControl +@implementation MTRBaseClusterFanControl -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -47749,9 +47749,9 @@ - (void)dealloc @end -@implementation MTRThermostatUserInterfaceConfiguration +@implementation MTRBaseClusterThermostatUserInterfaceConfiguration -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -48404,9 +48404,9 @@ - (void)dealloc @end -@implementation MTRColorControl +@implementation MTRBaseClusterColorControl -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -52955,9 +52955,9 @@ - (void)dealloc @end -@implementation MTRIlluminanceMeasurement +@implementation MTRBaseClusterIlluminanceMeasurement -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -53620,9 +53620,9 @@ - (void)dealloc @end -@implementation MTRTemperatureMeasurement +@implementation MTRBaseClusterTemperatureMeasurement -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -54222,9 +54222,9 @@ - (void)dealloc @end -@implementation MTRPressureMeasurement +@implementation MTRBaseClusterPressureMeasurement -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -55133,9 +55133,9 @@ - (void)dealloc @end -@implementation MTRFlowMeasurement +@implementation MTRBaseClusterFlowMeasurement -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -55735,9 +55735,9 @@ - (void)dealloc @end -@implementation MTRRelativeHumidityMeasurement +@implementation MTRBaseClusterRelativeHumidityMeasurement -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -56342,9 +56342,9 @@ - (void)dealloc @end -@implementation MTROccupancySensing +@implementation MTRBaseClusterOccupancySensing -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -57766,9 +57766,9 @@ - (void)dealloc @end -@implementation MTRWakeOnLan +@implementation MTRBaseClusterWakeOnLan -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -58179,9 +58179,9 @@ - (void)dealloc @end -@implementation MTRChannel +@implementation MTRBaseClusterChannel -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -58794,9 +58794,9 @@ - (void)dealloc @end -@implementation MTRTargetNavigator +@implementation MTRBaseClusterTargetNavigator -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -59298,9 +59298,9 @@ - (void)dealloc @end -@implementation MTRMediaPlayback +@implementation MTRBaseClusterMediaPlayback -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -60372,9 +60372,9 @@ - (void)dealloc @end -@implementation MTRMediaInput +@implementation MTRBaseClusterMediaInput -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -60956,9 +60956,9 @@ - (void)dealloc @end -@implementation MTRLowPower +@implementation MTRBaseClusterLowPower -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -61337,9 +61337,9 @@ - (void)dealloc @end -@implementation MTRKeypadInput +@implementation MTRBaseClusterKeypadInput -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -61713,9 +61713,9 @@ - (void)dealloc @end -@implementation MTRContentLauncher +@implementation MTRBaseClusterContentLauncher -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -62426,9 +62426,9 @@ - (void)dealloc @end -@implementation MTRAudioOutput +@implementation MTRBaseClusterAudioOutput -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -62956,9 +62956,9 @@ - (void)dealloc @end -@implementation MTRApplicationLauncher +@implementation MTRBaseClusterApplicationLauncher -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -63556,9 +63556,9 @@ - (void)dealloc @end -@implementation MTRApplicationBasic +@implementation MTRBaseClusterApplicationBasic -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -64404,9 +64404,9 @@ - (void)dealloc @end -@implementation MTRAccountLogin +@implementation MTRBaseClusterAccountLogin -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -64844,9 +64844,9 @@ - (void)dealloc @end -@implementation MTRElectricalMeasurement +@implementation MTRBaseClusterElectricalMeasurement -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { @@ -73508,9 +73508,9 @@ - (void)dealloc @end -@implementation MTRTestCluster +@implementation MTRBaseClusterTestCluster -- (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue { if (self = [super initWithQueue:queue]) { if (device == nil) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h new file mode 100644 index 00000000000000..d918ac6284b7ef --- /dev/null +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h @@ -0,0 +1,409 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +#import + +#import "MTRBaseClusters.h" +#import "MTRBaseDevice.h" + +#include + +@interface MTRBaseClusterIdentify () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::IdentifyCluster * cppCluster; +- (chip::Controller::IdentifyCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterGroups () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::GroupsCluster * cppCluster; +- (chip::Controller::GroupsCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterScenes () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ScenesCluster * cppCluster; +- (chip::Controller::ScenesCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterOnOff () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::OnOffCluster * cppCluster; +- (chip::Controller::OnOffCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterOnOffSwitchConfiguration () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::OnOffSwitchConfigurationCluster * cppCluster; +- (chip::Controller::OnOffSwitchConfigurationCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterLevelControl () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::LevelControlCluster * cppCluster; +- (chip::Controller::LevelControlCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterBinaryInputBasic () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::BinaryInputBasicCluster * cppCluster; +- (chip::Controller::BinaryInputBasicCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterDescriptor () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::DescriptorCluster * cppCluster; +- (chip::Controller::DescriptorCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterBinding () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::BindingCluster * cppCluster; +- (chip::Controller::BindingCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterAccessControl () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::AccessControlCluster * cppCluster; +- (chip::Controller::AccessControlCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterBridgedActions () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::BridgedActionsCluster * cppCluster; +- (chip::Controller::BridgedActionsCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterBasic () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::BasicCluster * cppCluster; +- (chip::Controller::BasicCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterOtaSoftwareUpdateProvider () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::OtaSoftwareUpdateProviderCluster * cppCluster; +- (chip::Controller::OtaSoftwareUpdateProviderCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterOtaSoftwareUpdateRequestor () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::OtaSoftwareUpdateRequestorCluster * cppCluster; +- (chip::Controller::OtaSoftwareUpdateRequestorCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterLocalizationConfiguration () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::LocalizationConfigurationCluster * cppCluster; +- (chip::Controller::LocalizationConfigurationCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterTimeFormatLocalization () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::TimeFormatLocalizationCluster * cppCluster; +- (chip::Controller::TimeFormatLocalizationCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterUnitLocalization () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::UnitLocalizationCluster * cppCluster; +- (chip::Controller::UnitLocalizationCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterPowerSourceConfiguration () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::PowerSourceConfigurationCluster * cppCluster; +- (chip::Controller::PowerSourceConfigurationCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterPowerSource () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::PowerSourceCluster * cppCluster; +- (chip::Controller::PowerSourceCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterGeneralCommissioning () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::GeneralCommissioningCluster * cppCluster; +- (chip::Controller::GeneralCommissioningCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterNetworkCommissioning () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::NetworkCommissioningCluster * cppCluster; +- (chip::Controller::NetworkCommissioningCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterDiagnosticLogs () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::DiagnosticLogsCluster * cppCluster; +- (chip::Controller::DiagnosticLogsCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterGeneralDiagnostics () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::GeneralDiagnosticsCluster * cppCluster; +- (chip::Controller::GeneralDiagnosticsCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterSoftwareDiagnostics () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::SoftwareDiagnosticsCluster * cppCluster; +- (chip::Controller::SoftwareDiagnosticsCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterThreadNetworkDiagnostics () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster; +- (chip::Controller::ThreadNetworkDiagnosticsCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterWiFiNetworkDiagnostics () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster; +- (chip::Controller::WiFiNetworkDiagnosticsCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterEthernetNetworkDiagnostics () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster; +- (chip::Controller::EthernetNetworkDiagnosticsCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterBridgedDeviceBasic () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::BridgedDeviceBasicCluster * cppCluster; +- (chip::Controller::BridgedDeviceBasicCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterSwitch () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::SwitchCluster * cppCluster; +- (chip::Controller::SwitchCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterAdministratorCommissioning () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::AdministratorCommissioningCluster * cppCluster; +- (chip::Controller::AdministratorCommissioningCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterOperationalCredentials () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::OperationalCredentialsCluster * cppCluster; +- (chip::Controller::OperationalCredentialsCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterGroupKeyManagement () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::GroupKeyManagementCluster * cppCluster; +- (chip::Controller::GroupKeyManagementCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterFixedLabel () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::FixedLabelCluster * cppCluster; +- (chip::Controller::FixedLabelCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterUserLabel () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::UserLabelCluster * cppCluster; +- (chip::Controller::UserLabelCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterBooleanState () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::BooleanStateCluster * cppCluster; +- (chip::Controller::BooleanStateCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterModeSelect () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ModeSelectCluster * cppCluster; +- (chip::Controller::ModeSelectCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterDoorLock () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::DoorLockCluster * cppCluster; +- (chip::Controller::DoorLockCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterWindowCovering () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::WindowCoveringCluster * cppCluster; +- (chip::Controller::WindowCoveringCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterBarrierControl () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::BarrierControlCluster * cppCluster; +- (chip::Controller::BarrierControlCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterPumpConfigurationAndControl () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::PumpConfigurationAndControlCluster * cppCluster; +- (chip::Controller::PumpConfigurationAndControlCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterThermostat () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ThermostatCluster * cppCluster; +- (chip::Controller::ThermostatCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterFanControl () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::FanControlCluster * cppCluster; +- (chip::Controller::FanControlCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterThermostatUserInterfaceConfiguration () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ThermostatUserInterfaceConfigurationCluster * cppCluster; +- (chip::Controller::ThermostatUserInterfaceConfigurationCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterColorControl () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ColorControlCluster * cppCluster; +- (chip::Controller::ColorControlCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterIlluminanceMeasurement () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::IlluminanceMeasurementCluster * cppCluster; +- (chip::Controller::IlluminanceMeasurementCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterTemperatureMeasurement () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::TemperatureMeasurementCluster * cppCluster; +- (chip::Controller::TemperatureMeasurementCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterPressureMeasurement () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::PressureMeasurementCluster * cppCluster; +- (chip::Controller::PressureMeasurementCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterFlowMeasurement () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::FlowMeasurementCluster * cppCluster; +- (chip::Controller::FlowMeasurementCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterRelativeHumidityMeasurement () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::RelativeHumidityMeasurementCluster * cppCluster; +- (chip::Controller::RelativeHumidityMeasurementCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterOccupancySensing () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::OccupancySensingCluster * cppCluster; +- (chip::Controller::OccupancySensingCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterWakeOnLan () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::WakeOnLanCluster * cppCluster; +- (chip::Controller::WakeOnLanCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterChannel () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ChannelCluster * cppCluster; +- (chip::Controller::ChannelCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterTargetNavigator () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::TargetNavigatorCluster * cppCluster; +- (chip::Controller::TargetNavigatorCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterMediaPlayback () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::MediaPlaybackCluster * cppCluster; +- (chip::Controller::MediaPlaybackCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterMediaInput () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::MediaInputCluster * cppCluster; +- (chip::Controller::MediaInputCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterLowPower () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::LowPowerCluster * cppCluster; +- (chip::Controller::LowPowerCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterKeypadInput () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::KeypadInputCluster * cppCluster; +- (chip::Controller::KeypadInputCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterContentLauncher () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ContentLauncherCluster * cppCluster; +- (chip::Controller::ContentLauncherCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterAudioOutput () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::AudioOutputCluster * cppCluster; +- (chip::Controller::AudioOutputCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterApplicationLauncher () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ApplicationLauncherCluster * cppCluster; +- (chip::Controller::ApplicationLauncherCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterApplicationBasic () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ApplicationBasicCluster * cppCluster; +- (chip::Controller::ApplicationBasicCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterAccountLogin () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::AccountLoginCluster * cppCluster; +- (chip::Controller::AccountLoginCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterElectricalMeasurement () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::ElectricalMeasurementCluster * cppCluster; +- (chip::Controller::ElectricalMeasurementCluster **)cppClusterSlot; +@end + +@interface MTRBaseClusterTestCluster () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::TestClusterCluster * cppCluster; +- (chip::Controller::TestClusterCluster **)cppClusterSlot; +@end diff --git a/src/darwin/Framework/CHIPTests/MTRClustersTests.m b/src/darwin/Framework/CHIPTests/MTRClustersTests.m index f6aebf6b0e5bb0..bdab9a531ea21e 100644 --- a/src/darwin/Framework/CHIPTests/MTRClustersTests.m +++ b/src/darwin/Framework/CHIPTests/MTRClustersTests.m @@ -139,13 +139,13 @@ - (void)testInitStack [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; - [controller getDevice:nodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertEqual(error.code, 0); - [connectionExpectation fulfill]; - connectionExpectation = nil; - }]; + [controller getBaseDevice:nodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertEqual(error.code, 0); + [connectionExpectation fulfill]; + connectionExpectation = nil; + }]; [self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler:nil]; } @@ -166,22 +166,22 @@ - (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) { - XCTAssertEqual(error.code, 0); - [connectionExpectation fulfill]; - connectionExpectation = nil; - device = retrievedDevice; - }]; + [controller getBaseDevice:nodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable retrievedDevice, NSError * _Nullable error) { + XCTAssertEqual(error.code, 0); + [connectionExpectation fulfill]; + connectionExpectation = nil; + device = retrievedDevice; + }]; [self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler:nil]; XCTestExpectation * expectation = [self expectationWithDescription:@"ReuseMTRClusterObjectFirstCall"]; dispatch_queue_t queue = dispatch_get_main_queue(); - MTRTestCluster * cluster = [[MTRTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + MTRBaseClusterTestCluster * cluster = [[MTRBaseClusterTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); [cluster testWithCompletionHandler:^(NSError * err) { diff --git a/src/darwin/Framework/CHIPTests/MTRControllerTests.m b/src/darwin/Framework/CHIPTests/MTRControllerTests.m index 9d3b3e462e5a9a..c4e7955c6890c1 100644 --- a/src/darwin/Framework/CHIPTests/MTRControllerTests.m +++ b/src/darwin/Framework/CHIPTests/MTRControllerTests.m @@ -181,11 +181,11 @@ - (void)testControllerInvalidAccess [controller shutdown]; XCTAssertFalse([controller isRunning]); - XCTAssertFalse([controller getDevice:1234 - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable chipDevice, NSError * _Nullable error) { - XCTAssertEqual(error.code, MTRErrorCodeInvalidState); - }]); + XCTAssertFalse([controller getBaseDevice:1234 + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable chipDevice, NSError * _Nullable error) { + XCTAssertEqual(error.code, MTRErrorCodeInvalidState); + }]); [factory shutdown]; XCTAssertFalse([factory isRunning]); diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 5e781f83cadc06..676fb31eba184f 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; @@ -60,23 +60,23 @@ static void WaitForCommissionee(XCTestExpectation * expectation, dispatch_queue_ MTRDeviceController * controller = sController; XCTAssertNotNil(controller); - [controller getDevice:kDeviceId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertEqual(error.code, 0); - [expectation fulfill]; - mConnectedDevice = device; - }]; + [controller getBaseDevice:kDeviceId + queue:dispatch_get_main_queue() + 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 @@ -177,13 +177,13 @@ - (void)initStack [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; - [controller getDevice:kDeviceId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertEqual(error.code, 0); - [connectionExpectation fulfill]; - connectionExpectation = nil; - }]; + [controller getBaseDevice:kDeviceId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertEqual(error.code, 0); + [connectionExpectation fulfill]; + connectionExpectation = nil; + }]; [self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler: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,31 +560,33 @@ - (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 = @{ - @"type" : @"Structure", - @"value" : @[ - @{ @"contextTag" : @0, @"data" : @ { @"type" : @"UnsignedInteger", @"value" : @0 } }, - @{ @"contextTag" : @1, @"data" : @ { @"type" : @"UnsignedInteger", @"value" : @10 } } + NSDictionary * fields = @ { +@"type" : + @"Structure", +@"value" : + @[ +@{ @"contextTag" : @0, @"data" : @ { @"type" : @"UnsignedInteger", @"value" : @0 } }, +@{ @"contextTag" : @1, @"data" : @ { @"type" : @"UnsignedInteger", @"value" : @10 } } ] }; [device - invokeCommandWithEndpointId:@1 - clusterId:@8 - commandId:@40000 - commandFields:fields - timedInvokeTimeout:nil - clientQueue:queue - completion:^(id _Nullable values, NSError * _Nullable error) { - NSLog(@"invoke command: MoveToLevelWithOnOff values: %@, error: %@", values, error); - - XCTAssertNil(values); - XCTAssertEqual([MTRErrorTestUtils errorToZCLErrorCode:error], EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND); - - [expectation fulfill]; - }]; + invokeCommandWithEndpointId:@1 + clusterId:@8 + commandId:@40000 + commandFields:fields + timedInvokeTimeout:nil + clientQueue:queue + completion:^(id _Nullable values, NSError * _Nullable error) { + NSLog(@"invoke command: MoveToLevelWithOnOff values: %@, error: %@", values, error); + + XCTAssertNil(values); + XCTAssertEqual([MTRErrorTestUtils errorToZCLErrorCode:error], EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND); + + [expectation fulfill]; + }]; [self waitForExpectations:[NSArray arrayWithObject:expectation] timeout:kTimeoutInSeconds]; } @@ -607,7 +609,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 +655,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 +693,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 +740,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 +758,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. @@ -821,15 +823,15 @@ - (void)test011_ReadCachedAttribute // Read cache NSLog(@"Reading from cache..."); 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:NO]]); - [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:NO]]); + [cacheExpectation fulfill]; + }]; [self waitForExpectations:[NSArray arrayWithObject:cacheExpectation] timeout:kTimeoutInSeconds]; // Read from cache using generic path @@ -944,7 +946,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 +1054,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 +1231,7 @@ - (void)test999_TearDown @end -@interface MTRDevice (Test) +@interface MTRBaseDevice (Test) // Test function for whitebox testing + (id)CHIPEncodeAndDecodeNSObject:(id)object; @end @@ -1243,7 +1245,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 +1256,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 +1267,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 +1278,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 +1289,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 +1299,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 +1311,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 +1322,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 +1334,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 +1345,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 +1366,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 +1381,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..6536ed5bf7b772 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" @@ -170,24 +170,24 @@ - (void)readAttributeWithController:(id)controller (void) controller; __auto_type sharedController = sController; if (sharedController) { - [sharedController getDevice:nodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - if (error) { - NSLog(@"Failed to get connected device"); - completion(nil, error); - } else { - [device readAttributeWithEndpointId:endpointId - clusterId:clusterId - attributeId:attributeId - params:[MTRDeviceController decodeXPCReadParams:params] - clientQueue:dispatch_get_main_queue() - completion:^(NSArray *> * _Nullable values, - NSError * _Nullable error) { - completion([MTRDeviceController encodeXPCResponseValues:values], error); - }]; - } - }]; + [sharedController getBaseDevice:nodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + if (error) { + NSLog(@"Failed to get connected device"); + completion(nil, error); + } else { + [device readAttributeWithEndpointId:endpointId + clusterId:clusterId + attributeId:attributeId + params:[MTRDeviceController decodeXPCReadParams:params] + clientQueue:dispatch_get_main_queue() + completion:^(NSArray *> * _Nullable values, + NSError * _Nullable error) { + completion([MTRDeviceController encodeXPCResponseValues:values], error); + }]; + } + }]; } else { NSLog(@"Failed to get shared controller"); completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); @@ -206,25 +206,25 @@ - (void)writeAttributeWithController:(id)controller (void) controller; __auto_type sharedController = sController; if (sharedController) { - [sharedController getDevice:nodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - if (error) { - NSLog(@"Failed to get connected device"); - completion(nil, error); - } else { - [device writeAttributeWithEndpointId:endpointId - clusterId:clusterId - attributeId:attributeId - value:value - timedWriteTimeout:timeoutMs - clientQueue:dispatch_get_main_queue() - completion:^(NSArray *> * _Nullable values, - NSError * _Nullable error) { - completion([MTRDeviceController encodeXPCResponseValues:values], error); - }]; - } - }]; + [sharedController getBaseDevice:nodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + if (error) { + NSLog(@"Failed to get connected device"); + completion(nil, error); + } else { + [device writeAttributeWithEndpointId:endpointId + clusterId:clusterId + attributeId:attributeId + value:value + timedWriteTimeout:timeoutMs + clientQueue:dispatch_get_main_queue() + completion:^(NSArray *> * _Nullable values, + NSError * _Nullable error) { + completion([MTRDeviceController encodeXPCResponseValues:values], error); + }]; + } + }]; } else { NSLog(@"Failed to get shared controller"); completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); @@ -243,25 +243,25 @@ - (void)invokeCommandWithController:(id)controller (void) controller; __auto_type sharedController = sController; if (sharedController) { - [sharedController getDevice:nodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - if (error) { - NSLog(@"Failed to get connected device"); - completion(nil, error); - } else { - [device invokeCommandWithEndpointId:endpointId - clusterId:clusterId - commandId:commandId - commandFields:fields - timedInvokeTimeout:nil - clientQueue:dispatch_get_main_queue() - completion:^(NSArray *> * _Nullable values, - NSError * _Nullable error) { - completion([MTRDeviceController encodeXPCResponseValues:values], error); - }]; - } - }]; + [sharedController getBaseDevice:nodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + if (error) { + NSLog(@"Failed to get connected device"); + completion(nil, error); + } else { + [device invokeCommandWithEndpointId:endpointId + clusterId:clusterId + commandId:commandId + commandFields:fields + timedInvokeTimeout:nil + clientQueue:dispatch_get_main_queue() + completion:^(NSArray *> * _Nullable values, + NSError * _Nullable error) { + completion([MTRDeviceController encodeXPCResponseValues:values], error); + }]; + } + }]; } else { NSLog(@"Failed to get shared controller"); completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); @@ -280,39 +280,39 @@ - (void)subscribeAttributeWithController:(id)controller { __auto_type sharedController = sController; if (sharedController) { - [sharedController getDevice:nodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - if (error) { - NSLog(@"Failed to get connected device"); - establishedHandler(); - // Send an error report so that the client knows of the failure - [self.clientProxy handleReportWithController:controller - nodeId:nodeId - values:nil - error:[NSError errorWithDomain:MTRErrorDomain - code:MTRErrorCodeGeneralError - userInfo:nil]]; - } else { - [device subscribeAttributeWithEndpointId:endpointId - clusterId:clusterId - attributeId:attributeId - minInterval:minInterval - maxInterval:maxInterval - params:[MTRDeviceController decodeXPCSubscribeParams:params] - clientQueue:dispatch_get_main_queue() - reportHandler:^(NSArray *> * _Nullable values, - NSError * _Nullable error) { - [self.clientProxy - handleReportWithController:controller - nodeId:nodeId - values:[MTRDeviceController - encodeXPCResponseValues:values] - error:error]; - } - subscriptionEstablished:establishedHandler]; - } - }]; + [sharedController getBaseDevice:nodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + if (error) { + NSLog(@"Failed to get connected device"); + establishedHandler(); + // Send an error report so that the client knows of the failure + [self.clientProxy handleReportWithController:controller + nodeId:nodeId + values:nil + error:[NSError errorWithDomain:MTRErrorDomain + code:MTRErrorCodeGeneralError + userInfo:nil]]; + } else { + [device subscribeAttributeWithEndpointId:endpointId + clusterId:clusterId + attributeId:attributeId + minInterval:minInterval + maxInterval:maxInterval + params:[MTRDeviceController decodeXPCSubscribeParams:params] + clientQueue:dispatch_get_main_queue() + reportHandler:^(NSArray *> * _Nullable values, + NSError * _Nullable error) { + [self.clientProxy + handleReportWithController:controller + nodeId:nodeId + values:[MTRDeviceController + encodeXPCResponseValues:values] + error:error]; + } + subscriptionEstablished:establishedHandler]; + } + }]; } else { NSLog(@"Failed to get shared controller"); establishedHandler(); @@ -330,15 +330,15 @@ - (void)stopReportsWithController:(id _Nullable)controller nodeId:(uint64_t)node { __auto_type sharedController = sController; if (sharedController) { - [sharedController getDevice:nodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - if (error) { - NSLog(@"Failed to get connected device"); - } else { - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:completion]; - } - }]; + [sharedController getBaseDevice:nodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + if (error) { + NSLog(@"Failed to get connected device"); + } else { + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() completion:completion]; + } + }]; } else { NSLog(@"Failed to get shared controller"); completion(); @@ -360,43 +360,43 @@ - (void)subscribeWithController:(id _Nullable)controller attributeCacheContainer = [[MTRAttributeCacheContainer alloc] init]; } - [sharedController getDevice:nodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - if (error) { - NSLog(@"Error: Failed to get connected device (%llu) for attribute cache: %@", nodeId, error); - completion(error); - return; - } - NSMutableArray * established = [NSMutableArray arrayWithCapacity:1]; - [established addObject:@NO]; - [device subscribeWithQueue:dispatch_get_main_queue() - minInterval:[minInterval unsignedShortValue] - maxInterval:[maxInterval unsignedShortValue] - params:[MTRDeviceController decodeXPCSubscribeParams:params] - cacheContainer:attributeCacheContainer - attributeReportHandler:^(NSArray * value) { - NSLog(@"Received report: %@", value); + [sharedController getBaseDevice:nodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + if (error) { + NSLog(@"Error: Failed to get connected device (%llu) for attribute cache: %@", nodeId, error); + completion(error); + return; } - eventReportHandler:nil - errorHandler:^(NSError * error) { - NSLog(@"Received report error: %@", error); - if (![established[0] boolValue]) { - established[0] = @YES; - completion(error); + NSMutableArray * established = [NSMutableArray arrayWithCapacity:1]; + [established addObject:@NO]; + [device subscribeWithQueue:dispatch_get_main_queue() + minInterval:[minInterval unsignedShortValue] + maxInterval:[maxInterval unsignedShortValue] + params:[MTRDeviceController decodeXPCSubscribeParams:params] + cacheContainer:attributeCacheContainer + attributeReportHandler:^(NSArray * value) { + NSLog(@"Received report: %@", value); } - } - subscriptionEstablished:^() { - NSLog(@"Attribute cache subscription succeeded for device %llu", nodeId); - if (attributeCacheContainer) { - [self.attributeCacheDictionary setObject:attributeCacheContainer forKey:@(nodeId)]; - } - if (![established[0] boolValue]) { - established[0] = @YES; - completion(nil); + eventReportHandler:nil + errorHandler:^(NSError * error) { + NSLog(@"Received report error: %@", error); + if (![established[0] boolValue]) { + established[0] = @YES; + completion(error); + } } - }]; - }]; + subscriptionEstablished:^() { + NSLog(@"Attribute cache subscription succeeded for device %llu", nodeId); + if (attributeCacheContainer) { + [self.attributeCacheDictionary setObject:attributeCacheContainer forKey:@(nodeId)]; + } + if (![established[0] boolValue]) { + established[0] = @YES; + completion(nil); + } + }]; + }]; } else { NSLog(@"Failed to get shared controller"); completion([NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); @@ -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; @@ -546,13 +546,13 @@ - (void)initStack [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; __block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"]; - [controller getDevice:kDeviceId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertEqual(error.code, 0); - [connectionExpectation fulfill]; - connectionExpectation = nil; - }]; + [controller getBaseDevice:kDeviceId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertEqual(error.code, 0); + [connectionExpectation fulfill]; + connectionExpectation = nil; + }]; [self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler:nil]; mSampleListener = [[MTRXPCListenerSample alloc] init]; @@ -589,12 +589,12 @@ - (void)waitForCommissionee NSLog(@"Listener is not active"); return nil; }]; - [remoteController getDevice:kDeviceId - queue:queue - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - mConnectedDevice = device; - [expectation fulfill]; - }]; + [remoteController getBaseDevice:kDeviceId + queue:queue + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + mConnectedDevice = device; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; mDeviceController = remoteController; } @@ -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,29 +906,29 @@ - (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: - @"Structure", @"type", - [NSArray arrayWithObjects: - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithUnsignedInteger:0], @"tag", - [NSDictionary dictionaryWithObjectsAndKeys: - @"UnsignedInteger", @"type", - [NSNumber numberWithUnsignedInteger:0], @"value", nil], @"value", nil], - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithUnsignedInteger:1], @"tag", - [NSDictionary dictionaryWithObjectsAndKeys: - @"UnsignedInteger", @"type", - [NSNumber numberWithUnsignedInteger:10], @"value", nil], @"value", nil], - nil], @"value", nil]; + @"Structure", @"type", + [NSArray arrayWithObjects: + [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithUnsignedInteger:0], @"tag", + [NSDictionary dictionaryWithObjectsAndKeys: + @"UnsignedInteger", @"type", + [NSNumber numberWithUnsignedInteger:0], @"value", nil], @"value", nil], + [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithUnsignedInteger:1], @"tag", + [NSDictionary dictionaryWithObjectsAndKeys: + @"UnsignedInteger", @"type", + [NSNumber numberWithUnsignedInteger:10], @"value", nil], @"value", nil], + nil], @"value", nil]; [device invokeCommandWithEndpointId:@1 clusterId:@8 commandId:@40000 commandFields:fields clientQueue:queue - timedInvokeTimeout:nil - completion:^(id _Nullable values, NSError * _Nullable error) { - NSLog(@"invoke command: MoveToLevelWithOnOff values: %@, error: %@", values, error); + timedInvokeTimeout:nil + completion:^(id _Nullable values, NSError * _Nullable error) { + NSLog(@"invoke command: MoveToLevelWithOnOff values: %@, error: %@", values, error); - XCTAssertNil(values); + XCTAssertNil(values); // Error is copied over XPC and hence cannot use MTRErrorTestUtils utility which checks against a local domain string object. XCTAssertTrue([error.domain isEqualToString:MTRInteractionErrorDomain]); XCTAssertEqual(error.code, EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND); @@ -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 @@ -1654,25 +1654,25 @@ - (void)test013_TimedWriteAttribute expectation = [self expectationWithDescription:@"Subscribed"]; __block void (^reportHandler)(id _Nullable values, NSError * _Nullable error); [device subscribeAttributeWithEndpointId:@1 - clusterId:@8 - attributeId:@17 - minInterval:@2 - maxInterval:@10 - params:nil - clientQueue:queue - reportHandler:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"report attribute: Brightness values: %@, error: %@", value, error); - - if (reportHandler) { - __auto_type callback = reportHandler; - callback = nil; - callback(value, error); - } + clusterId:@8 + attributeId:@17 + minInterval:@2 + maxInterval:@10 + params:nil + clientQueue:queue + reportHandler:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"report attribute: Brightness values: %@, error: %@", value, error); + + if (reportHandler) { + __auto_type callback = reportHandler; + callback = nil; + callback(value, error); } - subscriptionEstablished:^{ - NSLog(@"subscribe attribute: Brightness established"); - [expectation fulfill]; - }]; + } + subscriptionEstablished:^ { + NSLog(@"subscribe attribute: Brightness established"); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; // Setup report expectation @@ -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..017313aad905fd 100644 --- a/src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m +++ b/src/darwin/Framework/CHIPTests/MTRXPCProtocolTests.m @@ -98,40 +98,40 @@ - (void)subscribeWithDeviceController:(MTRDeviceController *)deviceController completion(error); }); }; - [deviceController getDevice:deviceId - queue:workQueue - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - if (error) { - NSLog(@"Error: Failed to get connected device (%llu) for attribute cache: %@", deviceId, error); - completionHandler(error); - return; - } - __auto_type established = [NSMutableArray arrayWithCapacity:1]; - [established addObject:@NO]; - [device subscribeWithQueue:clientQueue - minInterval:1 - maxInterval:43200 - params:params - cacheContainer:self - attributeReportHandler:^(NSArray * value) { - NSLog(@"Report received for attribute cache: %@", value); + [deviceController getBaseDevice:deviceId + queue:workQueue + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + if (error) { + NSLog(@"Error: Failed to get connected device (%llu) for attribute cache: %@", deviceId, error); + completionHandler(error); + return; } - eventReportHandler:nil - errorHandler:^(NSError * error) { - NSLog(@"Report error received for attribute cache: %@", error); - if (![established[0] boolValue]) { - established[0] = @YES; - completionHandler(error); + __auto_type established = [NSMutableArray arrayWithCapacity:1]; + [established addObject:@NO]; + [device subscribeWithQueue:clientQueue + minInterval:1 + maxInterval:43200 + params:params + cacheContainer:self + attributeReportHandler:^(NSArray * value) { + NSLog(@"Report received for attribute cache: %@", value); } - } - subscriptionEstablished:^() { - NSLog(@"Attribute cache subscription succeeded for device %llu", deviceId); - if (![established[0] boolValue]) { - established[0] = @YES; - completionHandler(nil); + eventReportHandler:nil + errorHandler:^(NSError * error) { + NSLog(@"Report error received for attribute cache: %@", error); + if (![established[0] boolValue]) { + established[0] = @YES; + completionHandler(error); + } } - }]; - }]; + subscriptionEstablished:^() { + NSLog(@"Attribute cache subscription succeeded for device %llu", deviceId); + if (![established[0] boolValue]) { + established[0] = @YES; + completionHandler(nil); + } + }]; + }]; } @end @@ -363,27 +363,27 @@ - (void)testReadAttributeSuccess completion([MTRDeviceController encodeXPCResponseValues:myValues], nil); }; - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertNotNil(device); - XCTAssertNil(error); - NSLog(@"Device acquired. Reading..."); - [device readAttributeWithEndpointId:myEndpointId - clusterId:myClusterId - attributeId:myAttributeId - params:nil - clientQueue:dispatch_get_main_queue() - completion:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"Read value: %@", value); - XCTAssertNotNil(value); - XCTAssertNil(error); - XCTAssertTrue([myValues isEqualTo:value]); - [responseExpectation fulfill]; - self.xpcDisconnectExpectation = - [self expectationWithDescription:@"XPC Disconnected"]; - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + NSLog(@"Device acquired. Reading..."); + [device readAttributeWithEndpointId:myEndpointId + clusterId:myClusterId + attributeId:myAttributeId + params:nil + clientQueue:dispatch_get_main_queue() + completion:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"Read value: %@", value); + XCTAssertNotNil(value); + XCTAssertNil(error); + XCTAssertTrue([myValues isEqualTo:value]); + [responseExpectation fulfill]; + self.xpcDisconnectExpectation = + [self expectationWithDescription:@"XPC Disconnected"]; + }]; + }]; [self waitForExpectations:[NSArray arrayWithObjects:callExpectation, responseExpectation, nil] timeout:kTimeoutInSeconds]; @@ -425,27 +425,27 @@ - (void)testReadAttributeWithParamsSuccess completion([MTRDeviceController encodeXPCResponseValues:myValues], nil); }; - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertNotNil(device); - XCTAssertNil(error); - NSLog(@"Device acquired. Reading..."); - [device readAttributeWithEndpointId:myEndpointId - clusterId:myClusterId - attributeId:myAttributeId - params:myParams - clientQueue:dispatch_get_main_queue() - completion:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"Read value: %@", value); - XCTAssertNotNil(value); - XCTAssertNil(error); - XCTAssertTrue([myValues isEqualTo:value]); - [responseExpectation fulfill]; - self.xpcDisconnectExpectation = - [self expectationWithDescription:@"XPC Disconnected"]; - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + NSLog(@"Device acquired. Reading..."); + [device readAttributeWithEndpointId:myEndpointId + clusterId:myClusterId + attributeId:myAttributeId + params:myParams + clientQueue:dispatch_get_main_queue() + completion:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"Read value: %@", value); + XCTAssertNotNil(value); + XCTAssertNil(error); + XCTAssertTrue([myValues isEqualTo:value]); + [responseExpectation fulfill]; + self.xpcDisconnectExpectation = + [self expectationWithDescription:@"XPC Disconnected"]; + }]; + }]; [self waitForExpectations:[NSArray arrayWithObjects:callExpectation, responseExpectation, nil] timeout:kTimeoutInSeconds]; @@ -478,26 +478,26 @@ - (void)testReadAttributeFailure completion(nil, myError); }; - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertNotNil(device); - XCTAssertNil(error); - NSLog(@"Device acquired. Reading..."); - [device readAttributeWithEndpointId:myEndpointId - clusterId:myClusterId - attributeId:myAttributeId - params:nil - clientQueue:dispatch_get_main_queue() - completion:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"Read value: %@", value); - XCTAssertNil(value); - XCTAssertNotNil(error); - [responseExpectation fulfill]; - self.xpcDisconnectExpectation = - [self expectationWithDescription:@"XPC Disconnected"]; - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + NSLog(@"Device acquired. Reading..."); + [device readAttributeWithEndpointId:myEndpointId + clusterId:myClusterId + attributeId:myAttributeId + params:nil + clientQueue:dispatch_get_main_queue() + completion:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"Read value: %@", value); + XCTAssertNil(value); + XCTAssertNotNil(error); + [responseExpectation fulfill]; + self.xpcDisconnectExpectation = + [self expectationWithDescription:@"XPC Disconnected"]; + }]; + }]; [self waitForExpectations:[NSArray arrayWithObjects:callExpectation, responseExpectation, nil] timeout:kTimeoutInSeconds]; @@ -537,28 +537,28 @@ - (void)testWriteAttributeSuccess completion([MTRDeviceController encodeXPCResponseValues:myResults], nil); }; - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertNotNil(device); - XCTAssertNil(error); - NSLog(@"Device acquired. Writing..."); - [device writeAttributeWithEndpointId:myEndpointId - clusterId:myClusterId - attributeId:myAttributeId - value:myValue - timedWriteTimeout:nil - clientQueue:dispatch_get_main_queue() - completion:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"Write response: %@", value); - XCTAssertNotNil(value); - XCTAssertNil(error); - XCTAssertTrue([myResults isEqualTo:value]); - [responseExpectation fulfill]; - self.xpcDisconnectExpectation = - [self expectationWithDescription:@"XPC Disconnected"]; - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + NSLog(@"Device acquired. Writing..."); + [device writeAttributeWithEndpointId:myEndpointId + clusterId:myClusterId + attributeId:myAttributeId + value:myValue + timedWriteTimeout:nil + clientQueue:dispatch_get_main_queue() + completion:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"Write response: %@", value); + XCTAssertNotNil(value); + XCTAssertNil(error); + XCTAssertTrue([myResults isEqualTo:value]); + [responseExpectation fulfill]; + self.xpcDisconnectExpectation = + [self expectationWithDescription:@"XPC Disconnected"]; + }]; + }]; [self waitForExpectations:[NSArray arrayWithObjects:callExpectation, responseExpectation, nil] timeout:kTimeoutInSeconds]; @@ -600,28 +600,28 @@ - (void)testTimedWriteAttributeSuccess completion([MTRDeviceController encodeXPCResponseValues:myResults], nil); }; - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertNotNil(device); - XCTAssertNil(error); - NSLog(@"Device acquired. Writing..."); - [device writeAttributeWithEndpointId:myEndpointId - clusterId:myClusterId - attributeId:myAttributeId - value:myValue - timedWriteTimeout:myTimedWriteTimeout - clientQueue:dispatch_get_main_queue() - completion:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"Write response: %@", value); - XCTAssertNotNil(value); - XCTAssertNil(error); - XCTAssertTrue([myResults isEqualTo:value]); - [responseExpectation fulfill]; - self.xpcDisconnectExpectation = - [self expectationWithDescription:@"XPC Disconnected"]; - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + NSLog(@"Device acquired. Writing..."); + [device writeAttributeWithEndpointId:myEndpointId + clusterId:myClusterId + attributeId:myAttributeId + value:myValue + timedWriteTimeout:myTimedWriteTimeout + clientQueue:dispatch_get_main_queue() + completion:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"Write response: %@", value); + XCTAssertNotNil(value); + XCTAssertNil(error); + XCTAssertTrue([myResults isEqualTo:value]); + [responseExpectation fulfill]; + self.xpcDisconnectExpectation = + [self expectationWithDescription:@"XPC Disconnected"]; + }]; + }]; [self waitForExpectations:[NSArray arrayWithObjects:callExpectation, responseExpectation, nil] timeout:kTimeoutInSeconds]; @@ -656,27 +656,27 @@ - (void)testWriteAttributeFailure completion(nil, myError); }; - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertNotNil(device); - XCTAssertNil(error); - NSLog(@"Device acquired. Writing..."); - [device writeAttributeWithEndpointId:myEndpointId - clusterId:myClusterId - attributeId:myAttributeId - value:myValue - timedWriteTimeout:nil - clientQueue:dispatch_get_main_queue() - completion:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"Write response: %@", value); - XCTAssertNil(value); - XCTAssertNotNil(error); - [responseExpectation fulfill]; - self.xpcDisconnectExpectation = - [self expectationWithDescription:@"XPC Disconnected"]; - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + NSLog(@"Device acquired. Writing..."); + [device writeAttributeWithEndpointId:myEndpointId + clusterId:myClusterId + attributeId:myAttributeId + value:myValue + timedWriteTimeout:nil + clientQueue:dispatch_get_main_queue() + completion:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"Write response: %@", value); + XCTAssertNil(value); + XCTAssertNotNil(error); + [responseExpectation fulfill]; + self.xpcDisconnectExpectation = + [self expectationWithDescription:@"XPC Disconnected"]; + }]; + }]; [self waitForExpectations:[NSArray arrayWithObjects:callExpectation, responseExpectation, nil] timeout:kTimeoutInSeconds]; @@ -716,28 +716,28 @@ - (void)testInvokeCommandSuccess completion([MTRDeviceController encodeXPCResponseValues:myResults], nil); }; - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertNotNil(device); - XCTAssertNil(error); - NSLog(@"Device acquired. Invoking command..."); - [device invokeCommandWithEndpointId:myEndpointId - clusterId:myClusterId - commandId:myCommandId - commandFields:myFields - timedInvokeTimeout:nil - clientQueue:dispatch_get_main_queue() - completion:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"Command response: %@", value); - XCTAssertNotNil(value); - XCTAssertNil(error); - XCTAssertTrue([myResults isEqualTo:value]); - [responseExpectation fulfill]; - self.xpcDisconnectExpectation = - [self expectationWithDescription:@"XPC Disconnected"]; - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + NSLog(@"Device acquired. Invoking command..."); + [device invokeCommandWithEndpointId:myEndpointId + clusterId:myClusterId + commandId:myCommandId + commandFields:myFields + timedInvokeTimeout:nil + clientQueue:dispatch_get_main_queue() + completion:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"Command response: %@", value); + XCTAssertNotNil(value); + XCTAssertNil(error); + XCTAssertTrue([myResults isEqualTo:value]); + [responseExpectation fulfill]; + self.xpcDisconnectExpectation = + [self expectationWithDescription:@"XPC Disconnected"]; + }]; + }]; [self waitForExpectations:[NSArray arrayWithObjects:callExpectation, responseExpectation, nil] timeout:kTimeoutInSeconds]; @@ -779,28 +779,28 @@ - (void)testTimedInvokeCommandSuccess completion([MTRDeviceController encodeXPCResponseValues:myResults], nil); }; - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertNotNil(device); - XCTAssertNil(error); - NSLog(@"Device acquired. Invoking command..."); - [device invokeCommandWithEndpointId:myEndpointId - clusterId:myClusterId - commandId:myCommandId - commandFields:myFields - timedInvokeTimeout:myTimedInvokeTimeout - clientQueue:dispatch_get_main_queue() - completion:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"Command response: %@", value); - XCTAssertNotNil(value); - XCTAssertNil(error); - XCTAssertTrue([myResults isEqualTo:value]); - [responseExpectation fulfill]; - self.xpcDisconnectExpectation = - [self expectationWithDescription:@"XPC Disconnected"]; - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + NSLog(@"Device acquired. Invoking command..."); + [device invokeCommandWithEndpointId:myEndpointId + clusterId:myClusterId + commandId:myCommandId + commandFields:myFields + timedInvokeTimeout:myTimedInvokeTimeout + clientQueue:dispatch_get_main_queue() + completion:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"Command response: %@", value); + XCTAssertNotNil(value); + XCTAssertNil(error); + XCTAssertTrue([myResults isEqualTo:value]); + [responseExpectation fulfill]; + self.xpcDisconnectExpectation = + [self expectationWithDescription:@"XPC Disconnected"]; + }]; + }]; [self waitForExpectations:[NSArray arrayWithObjects:callExpectation, responseExpectation, nil] timeout:kTimeoutInSeconds]; @@ -838,27 +838,27 @@ - (void)testInvokeCommandFailure completion(nil, myError); }; - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertNotNil(device); - XCTAssertNil(error); - NSLog(@"Device acquired. Invoking command..."); - [device invokeCommandWithEndpointId:myEndpointId - clusterId:myClusterId - commandId:myCommandId - commandFields:myFields - timedInvokeTimeout:nil - clientQueue:dispatch_get_main_queue() - completion:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"Command response: %@", value); - XCTAssertNil(value); - XCTAssertNotNil(error); - [responseExpectation fulfill]; - self.xpcDisconnectExpectation = - [self expectationWithDescription:@"XPC Disconnected"]; - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + NSLog(@"Device acquired. Invoking command..."); + [device invokeCommandWithEndpointId:myEndpointId + clusterId:myClusterId + commandId:myCommandId + commandFields:myFields + timedInvokeTimeout:nil + clientQueue:dispatch_get_main_queue() + completion:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"Command response: %@", value); + XCTAssertNil(value); + XCTAssertNotNil(error); + [responseExpectation fulfill]; + self.xpcDisconnectExpectation = + [self expectationWithDescription:@"XPC Disconnected"]; + }]; + }]; [self waitForExpectations:[NSArray arrayWithObjects:callExpectation, responseExpectation, nil] timeout:kTimeoutInSeconds]; @@ -904,9 +904,9 @@ - (void)testSubscribeAttributeSuccess _xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -967,15 +967,15 @@ - (void)testSubscribeAttributeSuccess }; // Deregister report handler - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + }]; + }]; // Wait for disconnection [self waitForExpectations:@[ _xpcDisconnectExpectation, stopExpectation ] timeout:kTimeoutInSeconds]; @@ -1024,9 +1024,9 @@ - (void)testSubscribeAttributeWithParamsSuccess _xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -1087,15 +1087,15 @@ - (void)testSubscribeAttributeWithParamsSuccess }; // Deregister report handler - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + }]; + }]; // Wait for disconnection [self waitForExpectations:@[ _xpcDisconnectExpectation, stopExpectation ] timeout:kTimeoutInSeconds]; @@ -1139,9 +1139,9 @@ - (void)testBadlyFormattedReport _xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -1200,15 +1200,15 @@ - (void)testBadlyFormattedReport // Deregister report handler _xpcDisconnectExpectation.inverted = NO; - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + }]; + }]; // Wait for disconnection [self waitForExpectations:@[ _xpcDisconnectExpectation, stopExpectation ] timeout:kTimeoutInSeconds]; @@ -1253,9 +1253,9 @@ - (void)testReportWithUnrelatedEndpointId _xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -1316,15 +1316,15 @@ - (void)testReportWithUnrelatedEndpointId }; // Deregister report handler - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + }]; + }]; // Wait for disconnection [self waitForExpectations:@[ _xpcDisconnectExpectation, stopExpectation ] timeout:kTimeoutInSeconds]; @@ -1369,9 +1369,9 @@ - (void)testReportWithUnrelatedClusterId _xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -1432,15 +1432,15 @@ - (void)testReportWithUnrelatedClusterId }; // Deregister report handler - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + }]; + }]; // Wait for disconnection [self waitForExpectations:@[ _xpcDisconnectExpectation, stopExpectation ] timeout:kTimeoutInSeconds]; @@ -1485,9 +1485,9 @@ - (void)testReportWithUnrelatedAttributeId _xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -1548,15 +1548,15 @@ - (void)testReportWithUnrelatedAttributeId }; // Deregister report handler - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + }]; + }]; // Wait for disconnection [self waitForExpectations:@[ _xpcDisconnectExpectation, stopExpectation ] timeout:kTimeoutInSeconds]; @@ -1601,9 +1601,9 @@ - (void)testReportWithUnrelatedNode _xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -1664,15 +1664,15 @@ - (void)testReportWithUnrelatedNode }; // Deregister report handler - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + }]; + }]; // Wait for disconnection [self waitForExpectations:@[ _xpcDisconnectExpectation, stopExpectation ] timeout:kTimeoutInSeconds]; @@ -1716,9 +1716,9 @@ - (void)testSubscribeMultiEndpoints _xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -1779,15 +1779,15 @@ - (void)testSubscribeMultiEndpoints }; // Deregister report handler - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + }]; + }]; // Wait for disconnection [self waitForExpectations:@[ _xpcDisconnectExpectation, stopExpectation ] timeout:kTimeoutInSeconds]; @@ -1831,9 +1831,9 @@ - (void)testSubscribeMultiClusters _xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -1894,15 +1894,15 @@ - (void)testSubscribeMultiClusters }; // Deregister report handler - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + }]; + }]; // Wait for disconnection [self waitForExpectations:@[ _xpcDisconnectExpectation, stopExpectation ] timeout:kTimeoutInSeconds]; @@ -1946,9 +1946,9 @@ - (void)testSubscribeMultiAttributes _xpcDisconnectExpectation = [self expectationWithDescription:@"XPC Disconnected"]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -2009,15 +2009,15 @@ - (void)testSubscribeMultiAttributes }; // Deregister report handler - [_remoteDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - }]; - }]; + [_remoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + }]; + }]; // Wait for disconnection [self waitForExpectations:@[ _xpcDisconnectExpectation, stopExpectation ] timeout:kTimeoutInSeconds]; @@ -2072,9 +2072,9 @@ - (void)testMutiSubscriptions callExpectation = [self expectationWithDescription:[NSString stringWithFormat:@"XPC call (%d) received", i]]; establishExpectation = [self expectationWithDescription:[NSString stringWithFormat:@"Established (%d) called", i]]; [_remoteDeviceController - getDevice:myNodeId + getBaseDevice: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..."); @@ -2146,16 +2146,16 @@ - (void)testMutiSubscriptions // Deregister report handler for first subscriber __auto_type deregisterExpectation = [self expectationWithDescription:@"First subscriber deregistered"]; - [_remoteDeviceController getDevice:nodeToStop - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - [deregisterExpectation fulfill]; - }]; - }]; + [_remoteDeviceController getBaseDevice:nodeToStop + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + [deregisterExpectation fulfill]; + }]; + }]; [self waitForExpectations:@[ stopExpectation, deregisterExpectation ] timeout:kTimeoutInSeconds]; @@ -2204,16 +2204,16 @@ - (void)testMutiSubscriptions // Deregister report handler for second subscriber __auto_type secondDeregisterExpectation = [self expectationWithDescription:@"Second subscriber deregistered"]; - [_remoteDeviceController getDevice:nodeToStop - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - NSLog(@"Device acquired. Deregistering..."); - [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() - completion:^{ - NSLog(@"Deregistered"); - [secondDeregisterExpectation fulfill]; - }]; - }]; + [_remoteDeviceController getBaseDevice:nodeToStop + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + NSLog(@"Device acquired. Deregistering..."); + [device deregisterReportHandlersWithClientQueue:dispatch_get_main_queue() + completion:^{ + NSLog(@"Deregistered"); + [secondDeregisterExpectation fulfill]; + }]; + }]; // Wait for deregistration and disconnection [self waitForExpectations:@[ secondDeregisterExpectation, _xpcDisconnectExpectation, stopExpectation ] @@ -2274,13 +2274,13 @@ - (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) { - XCTAssertNotNil(device); - XCTAssertNil(error); - [deviceAcquired fulfill]; - }]; + [unspecifiedRemoteDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + [deviceAcquired fulfill]; + }]; [self waitForExpectations:[NSArray arrayWithObjects:anySharedRemoteControllerCallExpectation, deviceAcquired, nil] timeout:kTimeoutInSeconds]; @@ -2534,24 +2534,24 @@ - (void)testXPCConnectionFailure return nil; }]; - [failingDeviceController getDevice:myNodeId - queue:dispatch_get_main_queue() - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - XCTAssertNotNil(device); - XCTAssertNil(error); - NSLog(@"Device acquired. Reading..."); - [device readAttributeWithEndpointId:myEndpointId - clusterId:myClusterId - attributeId:myAttributeId - params:nil - clientQueue:dispatch_get_main_queue() - completion:^(id _Nullable value, NSError * _Nullable error) { - NSLog(@"Read value: %@", value); - XCTAssertNil(value); - XCTAssertNotNil(error); - [responseExpectation fulfill]; - }]; - }]; + [failingDeviceController getBaseDevice:myNodeId + queue:dispatch_get_main_queue() + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + XCTAssertNotNil(device); + XCTAssertNil(error); + NSLog(@"Device acquired. Reading..."); + [device readAttributeWithEndpointId:myEndpointId + clusterId:myClusterId + attributeId:myAttributeId + params:nil + clientQueue:dispatch_get_main_queue() + completion:^(id _Nullable value, NSError * _Nullable error) { + NSLog(@"Read value: %@", value); + XCTAssertNil(value); + XCTAssertNotNil(error); + [responseExpectation fulfill]; + }]; + }]; [self waitForExpectations:@[ responseExpectation ] timeout:kTimeoutInSeconds]; } 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 */,