From d7382bb6cfd5bd115ff9d904a35f600efffe2141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Thu, 9 Jun 2022 08:54:17 +0200 Subject: [PATCH] [window-app] Set valid Type for Window Covering cluster (#19311) * [window-app] Set valid Type for Window Covering cluster If Feature Map of Window Covering cluster has both LF and TL bits set, Type should be either 6 or 8. Initialize the attribute to 8 in window-app and all-clusters-app so that they can pass certification tests. Signed-off-by: Damian Krolik * Fix tests --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../all-clusters-common/all-clusters-app.zap | 2 +- examples/window-app/common/window-app.matter | 4 ++-- examples/window-app/common/window-app.zap | 9 +++++---- src/app/tests/suites/certification/Test_TC_WNCV_2_4.yaml | 1 - .../all-clusters-app/zap-generated/endpoint_config.h | 2 +- zzz_generated/chip-tool/zap-generated/test/Commands.h | 1 - .../darwin-framework-tool/zap-generated/test/Commands.h | 5 ----- zzz_generated/window-app/zap-generated/endpoint_config.h | 4 ++-- 9 files changed, 12 insertions(+), 18 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 3554d1e36ead68..3a9b0d9f0c6c47 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4363,7 +4363,7 @@ endpoint 1 { } server cluster WindowCovering { - ram attribute type; + ram attribute type default = 0x08; ram attribute physicalClosedLimitLift default = 0xFFFF; ram attribute physicalClosedLimitTilt default = 0xFFFF; persist attribute currentPositionLift default = 0x7FFF; 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 86dae9e12b478b..afb5c494838a1b 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 @@ -13602,7 +13602,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x08", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index dbf89c3d999e7f..e60eb56acf245a 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1893,7 +1893,7 @@ endpoint 1 { } server cluster WindowCovering { - ram attribute type; + ram attribute type default = 0x08; ram attribute physicalClosedLimitLift default = 0xFFFF; ram attribute physicalClosedLimitTilt default = 0xFFFF; persist attribute currentPositionLift; @@ -1939,7 +1939,7 @@ endpoint 2 { } server cluster WindowCovering { - ram attribute type; + ram attribute type default = 0x08; ram attribute physicalClosedLimitLift default = 0xFFFF; ram attribute physicalClosedLimitTilt default = 0xFFFF; persist attribute currentPositionLift; diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 7b35e8a86d612f..adaaac10092916 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -8555,7 +8555,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x08", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10189,7 +10189,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x08", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10596,5 +10596,6 @@ "endpointVersion": 2, "deviceIdentifier": 514 } - ] -} + ], + "log": [] +} \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_2_4.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_2_4.yaml index 1b3bf1646e2073..8c999b3b5819dd 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_2_4.yaml @@ -34,7 +34,6 @@ tests: attribute: "Type" PICS: A_TYPE response: - value: 0 constraints: type: enum8 minValue: 0 diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index d35d116d70c4c0..075bc141e1382b 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -947,7 +947,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(6) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x08) }, /* Type */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* PhysicalClosedLimitLift */ \ { 0x00000002, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* PhysicalClosedLimitTilt */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 0fac39c6b39018..98d170a4be67ef 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -36281,7 +36281,6 @@ class Test_TC_WNCV_2_4Suite : public TestCommand { chip::app::Clusters::WindowCovering::Type value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("type", value, 0)); VerifyOrReturn(CheckConstraintType("value", "", "enum8")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 9)); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index dd7bff137d6365..e46614de0afb94 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -58767,11 +58767,6 @@ class Test_TC_WNCV_2_4 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Type", actualValue, 0)); - } - VerifyOrReturn(CheckConstraintType("type", "", "enum8")); if (value != nil) { VerifyOrReturn(CheckConstraintMinValue("type", [value unsignedCharValue], 0)); diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index 40ff9bfc8b4c4a..a877730d80c772 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -465,7 +465,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x08) }, /* Type */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* PhysicalClosedLimitLift */ \ { 0x00000002, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* PhysicalClosedLimitTilt */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -520,7 +520,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Window Covering (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x08) }, /* Type */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* PhysicalClosedLimitLift */ \ { 0x00000002, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* PhysicalClosedLimitTilt */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \