diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index b8ef8694825e1f..9b0a4708e0ed6c 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -500,42 +500,8 @@ @implementation MTRDevice { - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller { - if (self = [super init]) { - _lock = OS_UNFAIR_LOCK_INIT; - _timeSyncLock = OS_UNFAIR_LOCK_INIT; - _nodeID = [nodeID copy]; - _fabricIndex = controller.fabricIndex; - _deviceController = controller; - _queue - = dispatch_queue_create("org.csa-iot.matter.framework.device.workqueue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - _expectedValueCache = [NSMutableDictionary dictionary]; - _asyncWorkQueue = [[MTRAsyncWorkQueue alloc] initWithContext:self]; - _state = MTRDeviceStateUnknown; - _internalDeviceState = MTRInternalDeviceStateUnsubscribed; - if (controller.controllerDataStore) { - _persistedClusterData = [[NSCache alloc] init]; - } else { - _persistedClusterData = nil; - } - _clusterDataToPersist = nil; - _persistedClusters = [NSMutableSet set]; - - // If there is a data store, make sure we have an observer to monitor system clock changes, so - // NSDate-based write coalescing could be reset and not get into a bad state. - if (_persistedClusterData) { - mtr_weakify(self); - _systemTimeChangeObserverToken = [[NSNotificationCenter defaultCenter] addObserverForName:NSSystemClockDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull notification) { - mtr_strongify(self); - std::lock_guard lock(self->_lock); - [self _resetStorageBehaviorState]; - }]; - } - - _delegates = [NSMutableSet set]; - - MTR_LOG_DEBUG("%@ init with hex nodeID 0x%016llX", self, _nodeID.unsignedLongLongValue); - } - return self; + MTR_LOG_ERROR("do not call %s on base class", __func__); + return nil; } - (void)dealloc @@ -554,7 +520,8 @@ - (NSString *)description + (MTRDevice *)deviceWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller { - return [controller deviceForNodeID:nodeID]; + MTR_LOG_ERROR("do not call %s on base class", __func__); + return nil; } #pragma mark - Time Synchronization