From 8996a993098f20c5346127b30d387920efd6c6ed Mon Sep 17 00:00:00 2001 From: John Winder Date: Thu, 21 Jul 2022 11:02:20 -0600 Subject: [PATCH 1/2] Added support for the bridged device basic feature-map attribute. --- examples/bridge-app/linux/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index db5eafb1bf5544..8b383720bae5b5 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -120,6 +120,7 @@ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_DEVICE_LIST_ATTRIBUTE_ID, ARRAY, kDescriptorAttrib DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(bridgedDeviceBasicAttrs) DECLARE_DYNAMIC_ATTRIBUTE(ZCL_NODE_LABEL_ATTRIBUTE_ID, CHAR_STRING, kNodeLabelSize, 0), /* NodeLabel */ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_REACHABLE_ATTRIBUTE_ID, BOOLEAN, 1, 0), /* Reachable */ + DECLARE_DYNAMIC_ATTRIBUTE(ZCL_FEATURE_MAP_SERVER_ATTRIBUTE_ID, BITMAP32, 4, 0), /* feature map */ DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); // Declare Cluster List for Bridged Light endpoint @@ -204,6 +205,7 @@ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_DEVICE_LIST_ATTRIBUTE_ID, ARRAY, kDescriptorAttrib DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(switchBridgedDeviceBasicAttrs) DECLARE_DYNAMIC_ATTRIBUTE(ZCL_NODE_LABEL_ATTRIBUTE_ID, CHAR_STRING, kNodeLabelSize, 0), /* NodeLabel */ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_REACHABLE_ATTRIBUTE_ID, BOOLEAN, 1, 0), /* Reachable */ + DECLARE_DYNAMIC_ATTRIBUTE(ZCL_FEATURE_MAP_SERVER_ATTRIBUTE_ID, BITMAP32, 4, 0), /* feature map */ DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); // Declare Cluster List for Bridged Switch endpoint @@ -263,6 +265,7 @@ DataVersion gComposedPowerSourceDataVersions[ArraySize(bridgedPowerSourceCluster #define ZCL_DESCRIPTOR_CLUSTER_REVISION (1u) #define ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_REVISION (1u) +#define ZCL_BRIDGED_DEVICE_BASIC_FEATURE_MAP (0u) #define ZCL_FIXED_LABEL_CLUSTER_REVISION (1u) #define ZCL_ON_OFF_CLUSTER_REVISION (4u) #define ZCL_SWITCH_CLUSTER_REVISION (1u) @@ -477,6 +480,10 @@ EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::Attribut { *buffer = (uint16_t) ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_REVISION; } + else if ((attributeId == ZCL_FEATURE_MAP_SERVER_ATTRIBUTE_ID) && (maxReadLength == 4)) + { + *buffer =(uint32_t) ZCL_BRIDGED_DEVICE_BASIC_FEATURE_MAP; + } else { return EMBER_ZCL_STATUS_FAILURE; From 99f15749667697e293d59f517964edbae83904a7 Mon Sep 17 00:00:00 2001 From: John Winder Date: Thu, 21 Jul 2022 11:59:22 -0600 Subject: [PATCH 2/2] Fixes for Restyled. --- examples/bridge-app/linux/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 8b383720bae5b5..71486c8fc392bd 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -482,7 +482,7 @@ EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::Attribut } else if ((attributeId == ZCL_FEATURE_MAP_SERVER_ATTRIBUTE_ID) && (maxReadLength == 4)) { - *buffer =(uint32_t) ZCL_BRIDGED_DEVICE_BASIC_FEATURE_MAP; + *buffer = (uint32_t) ZCL_BRIDGED_DEVICE_BASIC_FEATURE_MAP; } else {