@@ -500,42 +500,8 @@ @implementation MTRDevice {
500
500
501
501
- (instancetype )initWithNodeID : (NSNumber *)nodeID controller : (MTRDeviceController *)controller
502
502
{
503
- if (self = [super init]) {
504
- _lock = OS_UNFAIR_LOCK_INIT;
505
- _timeSyncLock = OS_UNFAIR_LOCK_INIT;
506
- _nodeID = [nodeID copy];
507
- _fabricIndex = controller.fabricIndex;
508
- _deviceController = controller;
509
- _queue
510
- = dispatch_queue_create("org.csa-iot.matter.framework.device.workqueue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL);
511
- _expectedValueCache = [NSMutableDictionary dictionary];
512
- _asyncWorkQueue = [[MTRAsyncWorkQueue alloc] initWithContext:self];
513
- _state = MTRDeviceStateUnknown;
514
- _internalDeviceState = MTRInternalDeviceStateUnsubscribed;
515
- if (controller.controllerDataStore) {
516
- _persistedClusterData = [[NSCache alloc] init];
517
- } else {
518
- _persistedClusterData = nil;
519
- }
520
- _clusterDataToPersist = nil;
521
- _persistedClusters = [NSMutableSet set];
522
-
523
- // If there is a data store, make sure we have an observer to monitor system clock changes, so
524
- // NSDate-based write coalescing could be reset and not get into a bad state.
525
- if (_persistedClusterData) {
526
- mtr_weakify(self);
527
- _systemTimeChangeObserverToken = [[NSNotificationCenter defaultCenter] addObserverForName:NSSystemClockDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull notification) {
528
- mtr_strongify(self);
529
- std::lock_guard lock(self->_lock);
530
- [self _resetStorageBehaviorState];
531
- }];
532
- }
533
-
534
- _delegates = [NSMutableSet set];
535
-
536
- MTR_LOG_DEBUG("%@ init with hex nodeID 0x%016llX", self, _nodeID.unsignedLongLongValue);
537
- }
538
- return self;
503
+ MTR_LOG_ERROR (" do not call %s on base class" , __func__);
504
+ return nil ;
539
505
}
540
506
541
507
- (void )dealloc
@@ -554,7 +520,8 @@ - (NSString *)description
554
520
555
521
+ (MTRDevice *)deviceWithNodeID : (NSNumber *)nodeID controller : (MTRDeviceController *)controller
556
522
{
557
- return [controller deviceForNodeID:nodeID];
523
+ MTR_LOG_ERROR (" do not call %s on base class" , __func__);
524
+ return nil ;
558
525
}
559
526
560
527
#pragma mark - Time Synchronization
0 commit comments