Skip to content

Commit 89249ee

Browse files
Improve logging around network technology detection in MTRDevice.
1. Log which values get filtered on reports, so we know what's in the cache. 2. Log some state around our network features after we load information from persistent storage.
1 parent ad19dee commit 89249ee

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/darwin/Framework/CHIP/MTRDevice_Concrete.mm

+18-2
Original file line numberDiff line numberDiff line change
@@ -4195,9 +4195,9 @@ - (NSArray *)_getAttributesToReportWithReportedValues:(NSArray<NSDictionary<NSSt
41954195
// When the expected value interval expires, the correct value will be reported,
41964196
// if needed.
41974197
if (expectedValue) {
4198-
MTR_LOG("%@ report %@ value filtered - expected value still present", self, attributePath);
4198+
MTR_LOG("%@ report %@ value %@ filtered - expected value still present", self, attributePath, attributeDataValue);
41994199
} else {
4200-
MTR_LOG("%@ report %@ value filtered - same as read cache", self, attributePath);
4200+
MTR_LOG("%@ report %@ value %@ filtered - same as read cache", self, attributePath, attributeDataValue);
42014201
}
42024202
}
42034203

@@ -4310,6 +4310,22 @@ - (void)_doSetPersistedClusterData:(NSDictionary<MTRClusterPath *, MTRDeviceClus
43104310

43114311
[self _updateAttributeDependentDescriptionData];
43124312

4313+
NSNumber * networkFeatures = nil;
4314+
{
4315+
std::lock_guard descriptionLock(_descriptionLock);
4316+
networkFeatures = _allNetworkFeatures;
4317+
}
4318+
4319+
if ((networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureWiFiNetworkInterface) == 0 && (networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureThreadNetworkInterface) == 0) {
4320+
// We had persisted data, but apparently this device does not have any
4321+
// known network technologies? Log some more information about what's
4322+
// going on.
4323+
auto * rootNetworkCommissioningPath = [MTRClusterPath clusterPathWithEndpointID:@(kRootEndpointId) clusterID:@(MTRClusterIDTypeNetworkCommissioningID)];
4324+
auto * networkCommisioningData = clusterData[rootNetworkCommissioningPath];
4325+
MTR_LOG("%@ after setting persisted data, network features: %@, root network commissioning featureMap: %@", self, networkFeatures,
4326+
networkCommisioningData.attributes[@(MTRClusterGlobalAttributeFeatureMapID)]);
4327+
}
4328+
43134329
// We have some stored data. Since we don't store data until the end of the
43144330
// initial priming report, our device cache must be primed.
43154331
_deviceCachePrimed = YES;

0 commit comments

Comments
 (0)