From 1339520a46ac69b89b9d9db250cdd17053c8cc7b Mon Sep 17 00:00:00 2001 From: Paul Zander <69502639+pjzander-signify@users.noreply.github.com> Date: Tue, 23 Nov 2021 14:34:22 +0100 Subject: [PATCH] Mismatch Basic Information and Bridged Device Basic Information Clusters 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 --- .../all-clusters-common/all-clusters-app.zap | 23 ++- .../bridge-app/bridge-common/bridge-app.zap | 4 +- examples/bridge-app/esp32/main/main.cpp | 12 +- examples/bridge-app/linux/main.cpp | 12 +- .../lighting-common/lighting-app.zap | 21 ++- examples/lock-app/lock-common/lock-app.zap | 4 +- .../ota-provider-common/ota-provider-app.zap | 2 +- .../ota-requestor-app.zap | 2 +- .../placeholder/linux/apps/app1/config.zap | 4 +- .../placeholder/linux/apps/app2/config.zap | 4 +- examples/pump-app/pump-common/pump-app.zap | 4 +- .../pump-controller-app.zap | 4 +- .../esp32/main/temperature-measurement.zap | 4 +- .../thermostat-common/thermostat.zap | 21 ++- examples/tv-app/tv-common/tv-app.zap | 17 +- .../tv-casting-common/tv-casting-app.zap | 23 ++- examples/window-app/common/window-app.zap | 6 +- .../clusterclient/BasicClientFragment.kt | 38 ++--- .../main/res/layout/basic_client_fragment.xml | 12 +- .../app/src/main/res/values/strings.xml | 2 +- .../suites/certification/Test_TC_DM_1_1.yaml | 13 +- .../Test_TC_DM_1_3_Simulated.yaml | 8 +- .../chip/basic-information-cluster.xml | 4 +- .../data-model/chip/bridged-device-basic.xml | 33 ++-- .../data_model/controller-clusters.zap | 19 ++- .../java/zap-generated/CHIPClusters-JNI.cpp | 12 +- .../zap-generated/CHIPClustersRead-JNI.cpp | 35 ++++- .../chip/devicecontroller/ChipClusters.java | 31 ++-- .../devicecontroller/ClusterReadMapping.java | 22 ++- .../devicecontroller/ClusterWriteMapping.java | 14 +- .../python/chip/clusters/CHIPClusters.cpp | 17 +- .../python/chip/clusters/CHIPClusters.py | 34 ++-- .../python/chip/clusters/Objects.py | 36 ++++- .../python/test/test_scripts/base.py | 4 +- .../test/test_scripts/cluster_objects.py | 4 +- .../CHIP/zap-generated/CHIPClustersObjc.h | 10 +- .../CHIP/zap-generated/CHIPClustersObjc.mm | 23 ++- .../CHIP/zap-generated/CHIPTestClustersObjc.h | 1 + .../zap-generated/CHIPTestClustersObjc.mm | 13 ++ .../Framework/CHIPTests/CHIPClustersTests.m | 32 +++- .../zap-generated/endpoint_config.h | 145 +++++++++--------- .../app-common/zap-generated/attribute-id.h | 6 +- .../zap-generated/attributes/Accessors.cpp | 103 ++++++++++--- .../zap-generated/attributes/Accessors.h | 20 ++- .../zap-generated/cluster-objects.h | 34 +++- .../app-common/zap-generated/ids/Attributes.h | 16 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/cluster/Commands.h | 78 +++++++--- .../zap-generated/reporting/Commands.h | 6 +- .../chip-tool/zap-generated/test/Commands.h | 56 +++++-- .../zap-generated/CHIPClusters.cpp | 24 ++- .../zap-generated/CHIPClusters.h | 9 +- .../zap-generated/tests/CHIPClustersTest.cpp | 10 ++ .../zap-generated/tests/CHIPClustersTest.h | 2 + .../zap-generated/endpoint_config.h | 59 +++---- .../lock-app/zap-generated/endpoint_config.h | 2 +- .../app1/zap-generated/endpoint_config.h | 4 +- .../app1/zap-generated/test/Commands.h | 27 +++- .../app2/zap-generated/endpoint_config.h | 4 +- .../app2/zap-generated/test/Commands.h | 27 +++- .../pump-app/zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 61 ++++---- .../tv-app/zap-generated/endpoint_config.h | 101 ++++++------ .../zap-generated/endpoint_config.h | 121 +++++++-------- .../zap-generated/endpoint_config.h | 2 +- 67 files changed, 1000 insertions(+), 509 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index b0cae7778e022d..aa7de84bf23ce3 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -1015,7 +1015,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -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, @@ -8281,7 +8296,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -9147,7 +9162,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -17396,7 +17411,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 78330a70bd0690..b4b3219c82600f 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -284,7 +284,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -3905,7 +3905,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/bridge-app/esp32/main/main.cpp b/examples/bridge-app/esp32/main/main.cpp index c83caa07ebcb5b..81f195230085cd 100644 --- a/examples/bridge-app/esp32/main/main.cpp +++ b/examples/bridge-app/esp32/main/main.cpp @@ -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; @@ -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(); @@ -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(maxReadLength - 1)); } @@ -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) diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 2339e88e2ba376..3f8ca3fceb3398 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -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; @@ -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(); @@ -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(); @@ -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()); } @@ -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); diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 9f2bb1b57128c3..216bd550e3e032 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -1065,7 +1065,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -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, @@ -5059,7 +5074,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -6249,7 +6264,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 7e56b63e5792fe..55c5cb698e9c2a 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -1078,7 +1078,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -4879,7 +4879,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap index 0b71a6a9ee227d..e659bf498b068c 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap @@ -880,7 +880,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap index ea836ba2888185..c49ec04e1b4f58 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap @@ -880,7 +880,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index f11cef71e2b8b8..2b6fdfb3150d9c 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -284,7 +284,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -1597,7 +1597,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 2d968de21f67d3..ec1a2cb4bf1e96 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -284,7 +284,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -1597,7 +1597,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 296153e326f25e..9b43d961102020 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -992,7 +992,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -5000,7 +5000,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index 6b15b519c14dd0..348583d9d65462 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -992,7 +992,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -5000,7 +5000,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap b/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap index 4ac628cdbe06f8..7f94045b1a9b81 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap @@ -686,7 +686,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -2834,7 +2834,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index 8919f9048423f9..6420220a1f5ea7 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -992,7 +992,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -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, @@ -7722,7 +7737,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -8386,7 +8401,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 79b05f8ef8bb86..1c771734db40fb 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -992,7 +992,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -1171,6 +1171,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, diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index 35504c270207fe..8c693d0fe5aa79 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -992,7 +992,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -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, @@ -7722,7 +7737,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -8386,7 +8401,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -14570,7 +14585,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 0394b9cccac22e..ed4b90da2f4d95 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -759,7 +759,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -4173,7 +4173,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", @@ -6553,7 +6553,7 @@ "reportableChange": 0 }, { - "name": "UserLabel", + "name": "NodeLabel", "code": 5, "mfgCode": null, "side": "server", diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/BasicClientFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/BasicClientFragment.kt index 50d591a5e8f850..1be86202170969 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/BasicClientFragment.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/BasicClientFragment.kt @@ -18,12 +18,12 @@ import com.google.chip.chiptool.R import kotlinx.android.synthetic.main.basic_client_fragment.attributeNameSpinner import kotlinx.android.synthetic.main.basic_client_fragment.basicClusterCommandStatus import kotlinx.android.synthetic.main.basic_client_fragment.locationEd -import kotlinx.android.synthetic.main.basic_client_fragment.userLabelEd +import kotlinx.android.synthetic.main.basic_client_fragment.nodeLabelEd import kotlinx.android.synthetic.main.basic_client_fragment.view.attributeNameSpinner import kotlinx.android.synthetic.main.basic_client_fragment.view.readAttributeBtn import kotlinx.android.synthetic.main.basic_client_fragment.view.writeLocalConfigDisabledSwitch import kotlinx.android.synthetic.main.basic_client_fragment.view.writeLocationBtn -import kotlinx.android.synthetic.main.basic_client_fragment.view.writeUserLabelBtn +import kotlinx.android.synthetic.main.basic_client_fragment.view.writeNodeLabelBtn import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch @@ -48,9 +48,9 @@ class BasicClientFragment : Fragment() { addressUpdateFragment = childFragmentManager.findFragmentById(R.id.addressUpdateFragment) as AddressUpdateFragment - writeUserLabelBtn.setOnClickListener { scope.launch { - sendWriteUserLabelAttribute() - userLabelEd.onEditorAction(EditorInfo.IME_ACTION_DONE) + writeNodeLabelBtn.setOnClickListener { scope.launch { + sendWriteNodeLabelAttribute() + nodeLabelEd.onEditorAction(EditorInfo.IME_ACTION_DONE) }} writeLocationBtn.setOnClickListener { scope.launch { sendWriteLocationAttribute() @@ -111,7 +111,7 @@ class BasicClientFragment : Fragment() { getString(R.string.basic_cluster_vendor_id_text) -> sendReadVendorIDAttribute() getString(R.string.basic_cluster_product_name_text) -> sendReadProductNameAttribute() getString(R.string.basic_cluster_product_id_text) -> sendReadProductIDAttribute() - getString(R.string.basic_cluster_user_label_text) -> sendReadUserLabelAttribute() + getString(R.string.basic_cluster_node_label_text) -> sendReadNodeLabelAttribute() getString(R.string.basic_cluster_location_text) -> sendReadLocationAttribute() getString(R.string.basic_cluster_hardware_version_text) -> sendReadHardwareVersionAttribute() getString(R.string.basic_cluster_hardware_version_string_text) -> sendReadHardwareVersionStringAttribute() @@ -134,7 +134,7 @@ class BasicClientFragment : Fragment() { ATTRIBUTES.add(getString(R.string.basic_cluster_vendor_id_text)) ATTRIBUTES.add(getString(R.string.basic_cluster_product_name_text)) ATTRIBUTES.add(getString(R.string.basic_cluster_product_id_text)) - ATTRIBUTES.add(getString(R.string.basic_cluster_user_label_text)) + ATTRIBUTES.add(getString(R.string.basic_cluster_node_label_text)) ATTRIBUTES.add(getString(R.string.basic_cluster_location_text)) ATTRIBUTES.add(getString(R.string.basic_cluster_hardware_version_text)) ATTRIBUTES.add(getString(R.string.basic_cluster_hardware_version_string_text)) @@ -220,31 +220,31 @@ class BasicClientFragment : Fragment() { }) } - private suspend fun sendReadUserLabelAttribute() { - getBasicClusterForDevice().readUserLabelAttribute(object : ChipClusters.CharStringAttributeCallback { + private suspend fun sendReadNodeLabelAttribute() { + getBasicClusterForDevice().readNodeLabelAttribute(object : ChipClusters.CharStringAttributeCallback { override fun onSuccess(value: String) { - Log.i(TAG,"[Read Success] UserLabel: $value") - showMessage("[Read Success] UserLabel: $value") + Log.i(TAG,"[Read Success] NodeLabel: $value") + showMessage("[Read Success] NodeLabel: $value") } override fun onError(ex: Exception) { - showMessage("Read UserLabel failure $ex") - Log.e(TAG, "Read UserLabel failure", ex) + showMessage("Read NodeLabel failure $ex") + Log.e(TAG, "Read NodeLabel failure", ex) } }) } - private suspend fun sendWriteUserLabelAttribute() { - getBasicClusterForDevice().writeUserLabelAttribute(object : ChipClusters.DefaultClusterCallback { + private suspend fun sendWriteNodeLabelAttribute() { + getBasicClusterForDevice().writeNodeLabelAttribute(object : ChipClusters.DefaultClusterCallback { override fun onSuccess() { - showMessage("Write UserLabel success") + showMessage("Write NodeLabel success") } override fun onError(ex: Exception) { - showMessage("Write UserLabel failure $ex") - Log.e(TAG, "Write UserLabel failure", ex) + showMessage("Write NodeLabel failure $ex") + Log.e(TAG, "Write NodeLabel failure", ex) } - }, userLabelEd.text.toString()) + }, nodeLabelEd.text.toString()) } private suspend fun sendReadLocationAttribute() { diff --git a/src/android/CHIPTool/app/src/main/res/layout/basic_client_fragment.xml b/src/android/CHIPTool/app/src/main/res/layout/basic_client_fragment.xml index faec00244b3be0..a0c9b7919cad22 100644 --- a/src/android/CHIPTool/app/src/main/res/layout/basic_client_fragment.xml +++ b/src/android/CHIPTool/app/src/main/res/layout/basic_client_fragment.xml @@ -12,7 +12,7 @@ android:layout_alignParentTop="true" />