diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index f33d1f1fc5a575..09b20337e280c8 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -468,62 +468,9 @@ - (oneway void)controller:(NSUUID *)controller controllerConfigurationUpdated:(N for (NSDictionary * deviceInfo in deviceInfoList) { if (!MTR_SAFE_CAST(deviceInfo, NSDictionary)) { MTR_LOG_ERROR(" - Missing or malformed device Info"); - } - - NSNumber * nodeID = MTR_SAFE_CAST(deviceInfo[MTRDeviceControllerRegistrationNodeIDKey], NSNumber); - if (!nodeID) { - MTR_LOG_ERROR(" - Missing or malformed nodeID"); continue; } - NSDictionary * deviceInternalState = MTR_SAFE_CAST(deviceInfo[MTRDeviceControllerRegistrationDeviceInternalStateKey], NSDictionary); - if (!deviceInternalState) { - MTR_LOG_ERROR(" - Missing or malformed deviceInternalState"); - continue; - } - - auto * device = static_cast([self deviceForNodeID:nodeID]); - [device device:nodeID internalStateUpdated:deviceInternalState]; - } -} - -// TODO: Create DeviceControllerRunningState that is a tri-state with "unknown", "not running", and "running" states -- (BOOL)isRunning -{ - // For XPC controller, always return yes - return YES; -} - -- (oneway void)controller:(NSUUID *)controller controllerConfigurationUpdated:(NSDictionary *)configuration -{ - // Reuse the same format as config dictionary, and add values for internal states - // @{ - // MTRDeviceControllerRegistrationControllerContextKey: @{ - // MTRDeviceControllerRegistrationControllerNodeIDKey: controllerNodeID - // } - // MTRDeviceControllerRegistrationNodeIDsKey: @[ - // @{ - // MTRDeviceControllerRegistrationNodeIDKey: nodeID, - // MTRDeviceControllerRegistrationDeviceInternalStateKey: deviceInternalStateDictionary - // } - // ] - // } - - NSDictionary * controllerContext = MTR_SAFE_CAST(configuration[MTRDeviceControllerRegistrationControllerContextKey], NSDictionary); - NSNumber * controllerNodeID = MTR_SAFE_CAST(controllerContext[MTRDeviceControllerRegistrationControllerNodeIDKey], NSNumber); - if (controllerNodeID && controllerNodeID) { - _controllerNodeID = controllerContext[MTRDeviceControllerRegistrationControllerNodeIDKey]; - } - - NSArray * deviceInfoList = MTR_SAFE_CAST(configuration[MTRDeviceControllerRegistrationNodeIDsKey], NSArray); - - MTR_LOG("Received controllerConfigurationUpdated: controllerNode ID %@ deviceInfoList %@", self.controllerNodeID, deviceInfoList); - - for (NSDictionary * deviceInfo in deviceInfoList) { - if (!MTR_SAFE_CAST(deviceInfo, NSDictionary)) { - MTR_LOG_ERROR(" - Missing or malformed device Info"); - } - NSNumber * nodeID = MTR_SAFE_CAST(deviceInfo[MTRDeviceControllerRegistrationNodeIDKey], NSNumber); if (!nodeID) { MTR_LOG_ERROR(" - Missing or malformed nodeID"); @@ -541,7 +488,6 @@ - (oneway void)controller:(NSUUID *)controller controllerConfigurationUpdated:(N } } -// TODO: Create DeviceControllerRunningState that is a tri-state with "unknown", "not running", and "running" states - (BOOL)isRunning { // For XPC controller, always return yes diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index ed7c2cbda847bb..01d345582d9fae 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -1074,15 +1074,6 @@ - (void)_updateEstimatedSubscriptionLatency:(NSNumber *)estimatedSubscriptionLat _estimatedSubscriptionLatencyForDescription = estimatedSubscriptionLatency; } -- (void)_updateEstimatedSubscriptionLatency:(NSNumber *)estimatedSubscriptionLatency -{ - os_unfair_lock_assert_owner(&_lock); - _estimatedSubscriptionLatency = estimatedSubscriptionLatency; - - std::lock_guard lock(_descriptionLock); - _estimatedSubscriptionLatencyForDescription = estimatedSubscriptionLatency; -} - // First Time Sync happens 2 minutes after reachability (this can be changed in the future) #define MTR_DEVICE_TIME_UPDATE_INITIAL_WAIT_TIME_SEC (60 * 2) - (void)_handleSubscriptionEstablished @@ -1814,15 +1805,6 @@ - (void)_updateDeviceCachePrimed:(BOOL)deviceCachePrimed _deviceCachePrimedForDescription = deviceCachePrimed; } -- (void)_updateDeviceCachePrimed:(BOOL)deviceCachePrimed -{ - os_unfair_lock_assert_owner(&_lock); - _deviceCachePrimed = deviceCachePrimed; - - std::lock_guard lock(_descriptionLock); - _deviceCachePrimedForDescription = deviceCachePrimed; -} - - (void)_handleReportEnd { MTR_LOG("%@ handling report end", self); @@ -2063,15 +2045,6 @@ - (void)_updateEstimatedStartTime:(NSDate *)estimatedStartTime _estimatedStartTimeForDescription = _estimatedStartTime; } -- (void)_updateEstimatedStartTime:(NSDate *)estimatedStartTime -{ - os_unfair_lock_assert_owner(&_lock); - _estimatedStartTime = estimatedStartTime; - - std::lock_guard lock(_descriptionLock); - _estimatedStartTimeForDescription = _estimatedStartTime; -} - - (void)_handleEventReport:(NSArray *> *)eventReport { std::lock_guard lock(_lock);