@@ -26,6 +26,7 @@ using namespace ::chip;
26
26
using namespace ::chip::app::Clusters;
27
27
28
28
#define ZCL_DESCRIPTOR_CLUSTER_REVISION (1u )
29
+ #define ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_REVISION (1u )
29
30
#define ZCL_BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER_REVISION (2u )
30
31
#define ZCL_BRIDGED_DEVICE_BASIC_INFORMATION_FEATURE_MAP (0u )
31
32
@@ -37,9 +38,13 @@ Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(Endpoin
37
38
AttributeId attributeId = attributeMetadata->attributeId ;
38
39
39
40
Device * dev = DeviceMgr ().GetDevice (endpoint);
40
- if (dev != nullptr && clusterId == app::Clusters::BridgedDeviceBasicInformation::Id)
41
+ if (dev == nullptr ) {
42
+ return Protocols::InteractionModel::Status::Failure;
43
+ }
44
+
45
+ if (clusterId == BridgedDeviceBasicInformation::Id)
41
46
{
42
- using namespace app ::Clusters:: BridgedDeviceBasicInformation::Attributes;
47
+ using namespace BridgedDeviceBasicInformation ::Attributes;
43
48
ChipLogProgress (NotSpecified, " HandleReadBridgedDeviceBasicAttribute: attrId=%d, maxReadLength=%d" , attributeId,
44
49
maxReadLength);
45
50
@@ -69,6 +74,20 @@ Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(Endpoin
69
74
return Protocols::InteractionModel::Status::Success;
70
75
}
71
76
77
+ if (clusterId == AdministratorCommissioning::Id)
78
+ {
79
+ // TODO(Add issue # here) This is a workaround to prevent crash. CADMIN is still reading incorrect
80
+ // Attribute values on dynamic endpoint as it only reads the root node and not the actual bridge
81
+ // device we are representing here.
82
+ if ((attributeId == AdministratorCommissioning::Attributes::ClusterRevision::Id) && (maxReadLength == 2 ))
83
+ {
84
+ uint16_t rev = ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_REVISION;
85
+ memcpy (buffer, &rev, sizeof (rev));
86
+ return Protocols::InteractionModel::Status::Success;
87
+ }
88
+ return Protocols::InteractionModel::Status::Failure;
89
+ }
90
+
72
91
return Protocols::InteractionModel::Status::Failure;
73
92
}
74
93
0 commit comments