@@ -27,13 +27,15 @@ namespace {
27
27
// / @param[in] clusterID Cluster ID
28
28
// / @param[in] attID Attribute ID
29
29
// / @return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if the attribute does not exist for a given cluster or is not scenable
30
+ // / @note This will allways fail for global list attributes. If we do want to make them scenable someday, we will need to
31
+ // / use a different validation method.
30
32
// TODO: Assess if we also want to throw an error if the attribute value is out of range
31
33
// TODO: Add check for "S" quality to determine if the attribute is scenable once suported :
32
34
// https://github.com/project-chip/connectedhomeip/issues/24177
33
- CHIP_ERROR ValideAttribute (EndpointId endpoint, ClusterId cluster, AttributeId attributeId)
35
+ CHIP_ERROR ValidateAttributePath (EndpointId endpoint, ClusterId cluster, AttributeId attributeId)
34
36
{
35
- uint16_t attIndex = emberAfGetServerAttributeIndexByAttributeId (endpoint, cluster, attributeId);
36
- if (attIndex == UINT16_MAX )
37
+ bool attIndex = emberAfContainsAttribute (endpoint, cluster, attributeId);
38
+ if (! attIndex)
37
39
{
38
40
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
39
41
}
@@ -79,7 +81,7 @@ DefaultSceneHandlerImpl::SerializeAdd(EndpointId endpoint, const ExtensionFieldS
79
81
auto pair_iterator = extensionFieldSet.attributeValueList .begin ();
80
82
while (pair_iterator.Next ())
81
83
{
82
- ReturnErrorOnFailure (ValideAttribute (endpoint, extensionFieldSet.clusterID , pair_iterator.GetValue ().attributeID ));
84
+ ReturnErrorOnFailure (ValidateAttributePath (endpoint, extensionFieldSet.clusterID , pair_iterator.GetValue ().attributeID ));
83
85
aVPairs[pairCount] = pair_iterator.GetValue ();
84
86
pairCount++;
85
87
}
0 commit comments