@@ -61,14 +61,19 @@ FindAttributeMetadata(const ConcreteAttributePath & aPath)
61
61
{
62
62
for (auto & attr : GlobalAttributesNotInMetadata)
63
63
{
64
+
64
65
if (attr == aPath.mAttributeId )
65
66
{
66
67
const EmberAfCluster * cluster = emberAfFindServerCluster (aPath.mEndpointId , aPath.mClusterId );
67
- ReturnErrorCodeIf (cluster == nullptr , CHIP_IM_GLOBAL_STATUS (UnsupportedAttribute));
68
+ if (cluster == nullptr )
69
+ {
70
+ return (emberAfFindEndpointType (aPath.mEndpointId ) == nullptr ) ? CHIP_IM_GLOBAL_STATUS (UnsupportedEndpoint)
71
+ : CHIP_IM_GLOBAL_STATUS (UnsupportedCluster);
72
+ }
73
+
68
74
return cluster;
69
75
}
70
76
}
71
-
72
77
const EmberAfAttributeMetadata * metadata =
73
78
emberAfLocateAttributeMetadata (aPath.mEndpointId , aPath.mClusterId , aPath.mAttributeId );
74
79
@@ -123,7 +128,7 @@ std::optional<CHIP_ERROR> TryReadViaAccessInterface(const ConcreteAttributePath
123
128
}
124
129
125
130
// If the encoder tried to encode, then a value should have been written.
126
- // - if encode, assueme DONE (i.e. FINAL CHIP_NO_ERROR)
131
+ // - if encode, assume DONE (i.e. FINAL CHIP_NO_ERROR)
127
132
// - if no encode, say that processing must continue
128
133
return encoder.TriedEncode () ? std::make_optional (CHIP_NO_ERROR) : std::nullopt;
129
134
}
@@ -290,7 +295,7 @@ CHIP_ERROR EncodeEmberValue(ByteSpan data, const EmberAfAttributeMetadata * meta
290
295
CHIP_ERROR CodegenDataModel::ReadAttribute (const InteractionModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder)
291
296
{
292
297
ChipLogDetail (DataManagement,
293
- " Reading attribute: Cluster=" ChipLogFormatMEI " Endpoint=%x AttributeId=" ChipLogFormatMEI " (expanded=%d)" ,
298
+ " Reading attribute: Cluster=" ChipLogFormatMEI " Endpoint=0x %x AttributeId=" ChipLogFormatMEI " (expanded=%d)" ,
294
299
ChipLogValueMEI (request.path .mClusterId ), request.path .mEndpointId , ChipLogValueMEI (request.path .mAttributeId ),
295
300
request.path .mExpanded );
296
301
@@ -340,8 +345,7 @@ CHIP_ERROR CodegenDataModel::ReadAttribute(const InteractionModel::ReadAttribute
340
345
{
341
346
// if we only got a cluster, this was for a global attribute. We cannot read ember attributes
342
347
// at this point, so give up (although GlobalAttributeReader should have returned something here).
343
- // Return a permanent failure...
344
- return CHIP_IM_GLOBAL_STATUS (UnsupportedAttribute);
348
+ chipDie ();
345
349
}
346
350
const EmberAfAttributeMetadata * attributeMetadata = std::get<const EmberAfAttributeMetadata *>(metadata);
347
351
0 commit comments