You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Darwin] MTRDevice delegate should be notified when cache is primed with basic info (project-chip#32251)
* [Darwin] MTRDevice delegate should be notified when cache is primed with basic info
* Changed logic to only report once, and also improve documentation in comments
* Update src/darwin/Framework/CHIP/MTRDevice.mm
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
---------
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
* Notifies delegate when the device attribute cache has been primed with initial configuration data of the device
386
+
*
387
+
* 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.
388
+
*
389
+
* 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.
// If cache is set from storage and is primed with initial configuration data, then assume the client had beeen informed in the past, and mark that the callback has been called
1999
+
if ([self_isCachePrimedWithInitialConfigurationData]) {
2000
+
_delegateDeviceCachePrimedCalled = YES;
2001
+
}
2002
+
2003
+
os_unfair_lock_unlock(&self->_lock);
1962
2004
}
1963
2005
1964
2006
// If value is non-nil, associate with expectedValueID
@@ -2135,6 +2177,42 @@ - (void)_removeExpectedValueForAttributePath:(MTRAttributePath *)attributePath e
2135
2177
}
2136
2178
}
2137
2179
2180
+
// This method checks if there is a need to inform delegate that the attribute cache has been "primed"
0 commit comments