Skip to content

Commit

Permalink
Mismatch Basic Information and Bridged Device Basic Information Clust…
Browse files Browse the repository at this point in the history
…ers in SDK vs spec (Issue 10908) (#12094)

* Update Basic Information cluster

* Update Bridged Device Basic Information cluster

* Process review comments

* Fix wrong naming of attribute UniqueID
  • Loading branch information
pjzander-signify authored and pull[bot] committed Jan 19, 2024
1 parent 6474a1f commit 1339520
Show file tree
Hide file tree
Showing 67 changed files with 1,000 additions and 509 deletions.
23 changes: 19 additions & 4 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -1209,6 +1209,21 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "UniqueID",
"code": 18,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 1,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
Expand Down Expand Up @@ -8281,7 +8296,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -9147,7 +9162,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -17396,7 +17411,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
4 changes: 2 additions & 2 deletions examples/bridge-app/bridge-common/bridge-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -3905,7 +3905,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
12 changes: 6 additions & 6 deletions examples/bridge-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ using namespace ::chip::Platform;

static DeviceCallbacks AppCallback;

static const int kUserLabelSize = 32;
static const int kNodeLabelSize = 32;
// Current ZCL implementation of Struct uses a max-size array of 254 bytes
static const int kDescriptorAttributeArraySize = 254;
static const int kFixedLabelAttributeArraySize = 254;
Expand Down Expand Up @@ -87,7 +87,7 @@ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_DEVICE_LIST_ATTRIBUTE_ID, ARRAY, kDescriptorAttrib

// Declare Bridged Device Basic information cluster attributes
DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(bridgedDeviceBasicAttrs)
DECLARE_DYNAMIC_ATTRIBUTE(ZCL_USER_LABEL_ATTRIBUTE_ID, CHAR_STRING, kUserLabelSize, 0), /* UserLabel */
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_LIST_END();

Expand Down Expand Up @@ -195,7 +195,7 @@ EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::Attribut
{
*buffer = dev->IsReachable() ? 1 : 0;
}
else if ((attributeId == ZCL_USER_LABEL_ATTRIBUTE_ID) && (maxReadLength == 32))
else if ((attributeId == ZCL_NODE_LABEL_ATTRIBUTE_ID) && (maxReadLength == 32))
{
ToZclCharString(buffer, dev->GetName(), static_cast<uint8_t>(maxReadLength - 1));
}
Expand Down Expand Up @@ -323,10 +323,10 @@ void HandleDeviceStatusChanged(Device * dev, Device::Changed_t itemChangedMask)

if (itemChangedMask & Device::kChanged_Name)
{
uint8_t zclName[kUserLabelSize];
ToZclCharString(zclName, dev->GetName(), kUserLabelSize - 1);
uint8_t zclName[kNodeLabelSize + 1];
ToZclCharString(zclName, dev->GetName(), kNodeLabelSize);
MatterReportingAttributeChangeCallback(dev->GetEndpointId(), ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID,
ZCL_USER_LABEL_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, 0, ZCL_CHAR_STRING_ATTRIBUTE_TYPE,
ZCL_NODE_LABEL_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, 0, ZCL_CHAR_STRING_ATTRIBUTE_TYPE,
zclName);
}
if (itemChangedMask & Device::kChanged_Location)
Expand Down
12 changes: 6 additions & 6 deletions examples/bridge-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ using namespace chip::Inet;
using namespace chip::Transport;
using namespace chip::DeviceLayer;

static const int kUserLabelSize = 32;
static const int kNodeLabelSize = 32;
// Current ZCL implementation of Struct uses a max-size array of 254 bytes
static const int kDescriptorAttributeArraySize = 254;
static const int kFixedLabelAttributeArraySize = 254;
Expand Down Expand Up @@ -107,7 +107,7 @@ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_DEVICE_LIST_ATTRIBUTE_ID, ARRAY, kDescriptorAttrib

// Declare Bridged Device Basic information cluster attributes
DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(bridgedDeviceBasicAttrs)
DECLARE_DYNAMIC_ATTRIBUTE(ZCL_USER_LABEL_ATTRIBUTE_ID, CHAR_STRING, kUserLabelSize, 0), /* UserLabel */
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_LIST_END();

Expand Down Expand Up @@ -151,7 +151,7 @@ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_DEVICE_LIST_ATTRIBUTE_ID, ARRAY, kDescriptorAttrib

// Declare Bridged Device Basic information cluster attributes
DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(switchBridgedDeviceBasicAttrs)
DECLARE_DYNAMIC_ATTRIBUTE(ZCL_USER_LABEL_ATTRIBUTE_ID, CHAR_STRING, kUserLabelSize, 0), /* UserLabel */
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_LIST_END();

Expand Down Expand Up @@ -267,11 +267,11 @@ void HandleDeviceStatusChanged(Device * dev, Device::Changed_t itemChangedMask)

if (itemChangedMask & Device::kChanged_Name)
{
uint8_t zclName[kUserLabelSize];
uint8_t zclName[kNodeLabelSize];
MutableByteSpan zclNameSpan(zclName);
MakeZclCharString(zclNameSpan, dev->GetName());
MatterReportingAttributeChangeCallback(dev->GetEndpointId(), ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID,
ZCL_USER_LABEL_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, 0, ZCL_CHAR_STRING_ATTRIBUTE_TYPE,
ZCL_NODE_LABEL_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, 0, ZCL_CHAR_STRING_ATTRIBUTE_TYPE,
zclNameSpan.data());
}

Expand Down Expand Up @@ -342,7 +342,7 @@ EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::Attribut
{
*buffer = dev->IsReachable() ? 1 : 0;
}
else if ((attributeId == ZCL_USER_LABEL_ATTRIBUTE_ID) && (maxReadLength == 32))
else if ((attributeId == ZCL_NODE_LABEL_ATTRIBUTE_ID) && (maxReadLength == 32))
{
uint8_t bufferMemory[254];
MutableByteSpan zclString(bufferMemory);
Expand Down
21 changes: 18 additions & 3 deletions examples/lighting-app/lighting-common/lighting-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -1259,6 +1259,21 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "UniqueID",
"code": 18,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 1,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
Expand Down Expand Up @@ -5059,7 +5074,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -6249,7 +6264,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
4 changes: 2 additions & 2 deletions examples/lock-app/lock-common/lock-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -4879,7 +4879,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
4 changes: 2 additions & 2 deletions examples/placeholder/linux/apps/app1/config.zap
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -1597,7 +1597,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
4 changes: 2 additions & 2 deletions examples/placeholder/linux/apps/app2/config.zap
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -1597,7 +1597,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
4 changes: 2 additions & 2 deletions examples/pump-app/pump-common/pump-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -5000,7 +5000,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -5000,7 +5000,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -2834,7 +2834,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
21 changes: 18 additions & 3 deletions examples/thermostat/thermostat-common/thermostat.zap
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -1186,6 +1186,21 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "UniqueID",
"code": 18,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 1,
"bounded": 0,
"defaultValue": "",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
Expand Down Expand Up @@ -7722,7 +7737,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down Expand Up @@ -8386,7 +8401,7 @@
"reportableChange": 0
},
{
"name": "UserLabel",
"name": "NodeLabel",
"code": 5,
"mfgCode": null,
"side": "server",
Expand Down
Loading

0 comments on commit 1339520

Please sign in to comment.