Skip to content

Commit 0977039

Browse files
committed
renaming: MTRDevice -> MTRDeviceConcrete
does not include insertion of new superclass or any minor tweaks outside the main code body to make the rename work, so might be broken to tests
1 parent 2bd9d0b commit 0977039

30 files changed

+209
-209
lines changed

examples/darwin-framework-tool/commands/bdx/DownloadLogCommand.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
ChipLogProgress(chipTool, "Downloading logs from node 0x" ChipLogFormatX64, ChipLogValueX64(mNodeId));
2929

3030
MTRDeviceController * commissioner = CurrentCommissioner();
31-
auto * device = [MTRDevice deviceWithNodeID:@(mNodeId) controller:commissioner];
31+
auto * device = [MTRDeviceConcrete deviceWithNodeID:@(mNodeId) controller:commissioner];
3232

3333
auto logType = static_cast<MTRDiagnosticLogType>(mLogType);
3434
auto queue = dispatch_queue_create("com.chip.bdx.downloader", DISPATCH_QUEUE_SERIAL);

examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{
2626
mWorkQueue = dispatch_queue_create("com.chip.open_commissioning_window", DISPATCH_QUEUE_SERIAL);
2727
auto * controller = CurrentCommissioner();
28-
auto * device = [MTRDevice deviceWithNodeID:mNodeId deviceController:controller];
28+
auto * device = [MTRDeviceConcrete deviceWithNodeID:mNodeId deviceController:controller];
2929

3030
auto * self = this;
3131
if (mCommissioningWindowOption == 0) {

src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ static inline MTRTransportType MTRMakeTransportType(chip::Transport::Type type)
7474
@property (nonatomic, assign, readonly) BOOL isPASEDevice;
7575

7676
/**
77-
* Controller that that this MTRDevice was gotten from.
77+
* Controller that that this MTRDeviceConcrete was gotten from.
7878
*/
7979
@property (nonatomic, strong, readonly) MTRDeviceController * deviceController;
8080

8181
/**
82-
* Node id for this MTRDevice. If this device represents a CASE session, this
82+
* Node id for this MTRDeviceConcrete. If this device represents a CASE session, this
8383
* is set to the node ID of the target node. If this device represents a PASE
8484
* session, this is set to the device id of the PASE device.
8585
*/

src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535

3636
/**
3737
* This file defines a base class for subscription callbacks used by
38-
* MTRBaseDevice and MTRDevice. This base class handles everything except the
38+
* MTRBaseDevice and MTRDeviceConcrete. This base class handles everything except the
3939
* actual conversion from the incoming data to the desired data and the dispatch
4040
* of callbacks to the relevant client queues. Its callbacks are called on the
41-
* Matter queue. This allows MTRDevice and MTRBaseDevice to do any necessary
41+
* Matter queue. This allows MTRDeviceConcrete and MTRBaseDevice to do any necessary
4242
* sync cleanup work before dispatching to the client callbacks on the client
4343
* queue.
4444
*

src/darwin/Framework/CHIP/MTRCluster.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ typedef void (^MTRStatusCompletion)(NSError * _Nullable error);
2929
typedef void (^MTRSubscriptionEstablishedHandler)(void);
3030

3131
@class MTRBaseDevice;
32-
@class MTRDevice;
32+
@class MTRDeviceConcrete;
3333

3434
NS_ASSUME_NONNULL_BEGIN
3535

@@ -63,7 +63,7 @@ MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4))
6363
/**
6464
* The device this cluster object is associated with.
6565
*/
66-
@property (nonatomic, strong, readonly) MTRDevice * device;
66+
@property (nonatomic, strong, readonly) MTRDeviceConcrete * device;
6767
@end
6868

6969
/**
@@ -139,7 +139,7 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
139139
*
140140
* This setting is only relevant to some consumers of MTRReadParams. One of
141141
* those consumers is readAttributeWithEndpointID:clusterID:attributeID:params:
142-
* on MTRDevice.
142+
* on MTRDeviceConcrete.
143143
*/
144144
@property (nonatomic, assign, getter=shouldAssumeUnknownAttributesReportable) BOOL assumeUnknownAttributesReportable MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6));
145145

src/darwin/Framework/CHIP/MTRCluster.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en
5050

5151
@implementation MTRGenericCluster
5252

53-
- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue
53+
- (instancetype)initWithDevice:(MTRDeviceConcrete *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue
5454
{
5555
if (self = [super initWithEndpointID:endpointID queue:queue]) {
5656
_device = device;

src/darwin/Framework/CHIP/MTRCluster_Internal.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#import <Matter/MTRBaseDevice.h>
2121
#import <Matter/MTRCluster.h>
22-
#import <Matter/MTRDevice.h>
22+
#import <Matter/MTRDeviceConcrete.h>
2323

2424
#import "MTRBaseDevice_Internal.h"
2525

@@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
4343
@end
4444

4545
@interface MTRGenericCluster ()
46-
- (instancetype)initWithDevice:(MTRDevice *)device
46+
- (instancetype)initWithDevice:(MTRDeviceConcrete *)device
4747
endpointID:(NSNumber *)endpointID
4848
queue:(dispatch_queue_t)queue;
4949
@end

src/darwin/Framework/CHIP/MTRDevice.h src/darwin/Framework/CHIP/MTRDeviceConcrete.h

+18-18
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {
3232
@protocol MTRDeviceDelegate;
3333

3434
MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
35-
@interface MTRDevice : NSObject
35+
@interface MTRDeviceConcrete : NSObject
3636
- (instancetype)init NS_UNAVAILABLE;
3737
+ (instancetype)new NS_UNAVAILABLE;
3838

3939
/**
4040
* TODO: Document usage better
4141
*
42-
* Directly instantiate a MTRDevice with a MTRDeviceController as a shim.
42+
* Directly instantiate a MTRDeviceConcrete with a MTRDeviceController as a shim.
4343
*
4444
* All device-specific information would be stored on the device controller, and
4545
* retrieved when performing actions using a combination of MTRBaseDevice
4646
* and MTRAsyncCallbackQueue.
4747
*/
48-
+ (MTRDevice *)deviceWithNodeID:(NSNumber *)nodeID
48+
+ (MTRDeviceConcrete *)deviceWithNodeID:(NSNumber *)nodeID
4949
controller:(MTRDeviceController *)controller MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
5050

5151
/**
@@ -121,7 +121,7 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
121121
*
122122
* The delegate will be called on the provided queue, for attribute reports, event reports, and device state changes.
123123
*
124-
* MTRDevice holds a weak reference to the delegate object.
124+
* MTRDeviceConcrete holds a weak reference to the delegate object.
125125
*/
126126
- (void)addDelegate:(id<MTRDeviceDelegate>)delegate queue:(dispatch_queue_t)queue MTR_AVAILABLE(ios(18.0), macos(15.0), watchos(11.0), tvos(18.0));
127127

@@ -136,7 +136,7 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
136136
*
137137
* Calling addDelegate: again with the same delegate object will update the interested paths for attributes and events for this delegate.
138138
*
139-
* MTRDevice holds a weak reference to the delegate object.
139+
* MTRDeviceConcrete holds a weak reference to the delegate object.
140140
*/
141141
- (void)addDelegate:(id<MTRDeviceDelegate>)delegate queue:(dispatch_queue_t)queue interestedPathsForAttributes:(NSArray * _Nullable)interestedPathsForAttributes interestedPathsForEvents:(NSArray * _Nullable)interestedPathsForEvents MTR_AVAILABLE(ios(18.0), macos(15.0), watchos(11.0), tvos(18.0));
142142

@@ -405,10 +405,10 @@ MTR_EXTERN NSString * const MTRDataVersionKey MTR_AVAILABLE(ios(17.6), macos(14.
405405
/**
406406
* @param state The current state of the device
407407
*/
408-
- (void)device:(MTRDevice *)device stateChanged:(MTRDeviceState)state;
408+
- (void)device:(MTRDeviceConcrete *)device stateChanged:(MTRDeviceState)state;
409409

410410
/**
411-
* Notifies delegate of attribute reports from the MTRDevice
411+
* Notifies delegate of attribute reports from the MTRDeviceConcrete
412412
*
413413
* @param attributeReport An array of response-value objects as described in MTRDeviceResponseHandler
414414
*
@@ -420,10 +420,10 @@ MTR_EXTERN NSString * const MTRDataVersionKey MTR_AVAILABLE(ios(17.6), macos(14.
420420
*
421421
* MTRDataVersionKey : NSNumber-wrapped uin32_t.
422422
*/
423-
- (void)device:(MTRDevice *)device receivedAttributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport;
423+
- (void)device:(MTRDeviceConcrete *)device receivedAttributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport;
424424

425425
/**
426-
* Notifies delegate of event reports from the MTRDevice
426+
* Notifies delegate of event reports from the MTRDeviceConcrete
427427
*
428428
* @param eventReport An array of response-value objects as described in MTRDeviceResponseHandler
429429
*
@@ -440,7 +440,7 @@ MTR_EXTERN NSString * const MTRDataVersionKey MTR_AVAILABLE(ios(17.6), macos(14.
440440
* Only one of MTREventTimestampDateKey and MTREventSystemUpTimeKey will be present, depending on the value for
441441
* MTREventTimeTypeKey.
442442
*/
443-
- (void)device:(MTRDevice *)device receivedEventReport:(NSArray<NSDictionary<NSString *, id> *> *)eventReport;
443+
- (void)device:(MTRDeviceConcrete *)device receivedEventReport:(NSArray<NSDictionary<NSString *, id> *> *)eventReport;
444444

445445
@optional
446446
/**
@@ -449,33 +449,33 @@ MTR_EXTERN NSString * const MTRDataVersionKey MTR_AVAILABLE(ios(17.6), macos(14.
449449
* This can be used as a hint that now is a good time to send commands to the
450450
* device, especially if the device is sleepy and might not be active very often.
451451
*/
452-
- (void)deviceBecameActive:(MTRDevice *)device MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
452+
- (void)deviceBecameActive:(MTRDeviceConcrete *)device MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
453453

454454
/**
455455
* Notifies delegate when the device attribute cache has been primed with initial configuration data of the device
456456
*
457-
* This is called when the MTRDevice object goes from not knowing the device to having cached the first attribute reports that include basic mandatory information, e.g. Descriptor clusters.
457+
* This is called when the MTRDeviceConcrete object goes from not knowing the device to having cached the first attribute reports that include basic mandatory information, e.g. Descriptor clusters.
458458
*
459459
* The intention is that after this is called, the client should be able to call read for mandatory attributes and likely expect non-nil values.
460460
*/
461-
- (void)deviceCachePrimed:(MTRDevice *)device MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6));
461+
- (void)deviceCachePrimed:(MTRDeviceConcrete *)device MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6));
462462

463463
/**
464-
* This is called when the MTRDevice object detects a change in the device configuration.
464+
* This is called when the MTRDeviceConcrete object detects a change in the device configuration.
465465
*
466466
* Device configuration is the set of functionality implemented by the device.
467467
*
468468
*/
469-
- (void)deviceConfigurationChanged:(MTRDevice *)device MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6));
469+
- (void)deviceConfigurationChanged:(MTRDeviceConcrete *)device MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6));
470470

471471
@end
472472

473-
@interface MTRDevice (Deprecated)
473+
@interface MTRDeviceConcrete (Deprecated)
474474

475475
/**
476-
* Deprecated MTRDevice APIs.
476+
* Deprecated MTRDeviceConcrete APIs.
477477
*/
478-
+ (MTRDevice *)deviceWithNodeID:(uint64_t)nodeID
478+
+ (MTRDeviceConcrete *)deviceWithNodeID:(uint64_t)nodeID
479479
deviceController:(MTRDeviceController *)deviceController
480480
MTR_DEPRECATED(
481481
"Please use deviceWithNodeID:controller:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4));

0 commit comments

Comments
 (0)