Skip to content

Commit

Permalink
Merge branch 'master' into feature/app-install-flow-public
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov authored Jul 17, 2024
2 parents 00f7412 + 6cde0eb commit 1359eb7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 34 deletions.
37 changes: 8 additions & 29 deletions src/darwin/Framework/CHIP/MTRBaseDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2290,12 +2290,8 @@ + (MTRAttributeRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)end

- (BOOL)isEqualToAttributeRequestPath:(MTRAttributeRequestPath *)path
{
if (!path)
return NO;

return (path.endpoint && [_endpoint isEqualToNumber:path.endpoint])
&& (path.cluster && [_cluster isEqualToNumber:path.cluster])
&& (path.attribute && [_attribute isEqualToNumber:path.attribute]);
return [_endpoint isEqualToNumber:path.endpoint] && [_cluster isEqualToNumber:path.cluster] &&
[_attribute isEqualToNumber:path.attribute];
}

- (BOOL)isEqual:(id)object
Expand Down Expand Up @@ -2366,12 +2362,8 @@ + (MTREventRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpoin

- (BOOL)isEqualToEventRequestPath:(MTREventRequestPath *)path
{
if (!path)
return NO;

return (path.endpoint && [_endpoint isEqualToNumber:path.endpoint])
&& (path.cluster && [_cluster isEqualToNumber:path.cluster])
&& (path.event && [_event isEqualToNumber:path.event]);
return
[_endpoint isEqualToNumber:path.endpoint] && [_cluster isEqualToNumber:path.cluster] && [_event isEqualToNumber:path.event];
}

- (BOOL)isEqual:(id)object
Expand Down Expand Up @@ -2440,11 +2432,7 @@ ConcreteClusterPath path(static_cast<chip::EndpointId>([endpointID unsignedShort

- (BOOL)isEqualToClusterPath:(MTRClusterPath *)clusterPath
{
if (!clusterPath)
return NO;

return (clusterPath.endpoint && [_endpoint isEqualToNumber:clusterPath.endpoint])
&& (clusterPath.cluster && [_cluster isEqualToNumber:clusterPath.cluster]);
return [_endpoint isEqualToNumber:clusterPath.endpoint] && [_cluster isEqualToNumber:clusterPath.cluster];
}

- (BOOL)isEqual:(id)object
Expand Down Expand Up @@ -2532,10 +2520,7 @@ ConcreteDataAttributePath path(static_cast<chip::EndpointId>([endpointID unsigne

- (BOOL)isEqualToAttributePath:(MTRAttributePath *)attributePath
{
if (!attributePath)
return NO;

return [self isEqualToClusterPath:attributePath] && attributePath.attribute && [_attribute isEqualToNumber:attributePath.attribute];
return [self isEqualToClusterPath:attributePath] && [_attribute isEqualToNumber:attributePath.attribute];
}

- (BOOL)isEqual:(id)object
Expand Down Expand Up @@ -2628,10 +2613,7 @@ ConcreteEventPath path(static_cast<chip::EndpointId>([endpointID unsignedShortVa

- (BOOL)isEqualToEventPath:(MTREventPath *)eventPath
{
if (!eventPath)
return NO;

return [self isEqualToClusterPath:eventPath] && eventPath.event && [_event isEqualToNumber:eventPath.event];
return [self isEqualToClusterPath:eventPath] && [_event isEqualToNumber:eventPath.event];
}

- (BOOL)isEqual:(id)object
Expand Down Expand Up @@ -2721,10 +2703,7 @@ ConcreteCommandPath path(static_cast<chip::EndpointId>([endpointID unsignedShort

- (BOOL)isEqualToCommandPath:(MTRCommandPath *)commandPath
{
if (!commandPath)
return NO;

return [self isEqualToClusterPath:commandPath] && commandPath.command && [_command isEqualToNumber:commandPath.command];
return [self isEqualToClusterPath:commandPath] && [_command isEqualToNumber:commandPath.command];
}

- (BOOL)isEqual:(id)object
Expand Down
8 changes: 8 additions & 0 deletions src/darwin/Framework/CHIP/MTRDemuxingStorage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ static bool IsMemoryOnlyGlobalKey(NSString * key)

// We do not expect to see the "g/a/*" keys for attribute values.

// We do not expect to see the "g/sa/*" keys for attribute values.

// We do not expect to see the "g/bt" and "g/bt/*" keys for the binding
// table.

Expand All @@ -162,6 +164,9 @@ static bool IsMemoryOnlyGlobalKey(NSString * key)
// We do not expect to see the "g/icd/cic" key; that's only used for an ICD
// that sends check-in messages.

// We do not expect to see the "g/icdfl" key; that's only used by
// DefaultICDClientStorage, which Matter.framework does not use.

return false;
}

Expand Down Expand Up @@ -215,6 +220,9 @@ static bool IsMemoryOnlyIndexSpecificKey(NSString * key)

// We do not expect to see the "e/*" scenes keys.

// We do not epect to see the "icdc" or "icdk" keys, since those are only
// used by DefaultICDClientStorage, which Matter.framework does not use.

return false;
}

Expand Down
6 changes: 1 addition & 5 deletions src/darwin/Framework/CHIP/MTRDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,7 @@ - (id)copyWithZone:(NSZone *)zone

- (BOOL)isEqualToClusterData:(MTRDeviceClusterData *)otherClusterData
{
if (!otherClusterData)
return NO;

return (otherClusterData.dataVersion && [_dataVersion isEqual:otherClusterData.dataVersion])
&& (otherClusterData.attributes && [_attributes isEqual:otherClusterData.attributes]);
return [_dataVersion isEqual:otherClusterData.dataVersion] && [_attributes isEqual:otherClusterData.attributes];
}

- (BOOL)isEqual:(id)object
Expand Down

0 comments on commit 1359eb7

Please sign in to comment.