From be5aedb755998e93512e44cd3816d02a9f8da3c7 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 24 Jul 2023 11:31:38 -0700 Subject: [PATCH 1/3] Enable missing attribute and events of Switch cluster in lightinhg app --- .../lighting-common/lighting-app.matter | 9 +++ .../lighting-common/lighting-app.zap | 67 +++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index ea56e7d7138aa4..d964e5e22ad83b 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1551,6 +1551,7 @@ server cluster Switch = 59 { readonly attribute int8u numberOfPositions = 0; readonly attribute int8u currentPosition = 1; + readonly attribute int8u multiPressMax = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2354,8 +2355,16 @@ endpoint 0 { } server cluster Switch { + emits event SwitchLatched; + emits event InitialPress; + emits event LongPress; + emits event ShortRelease; + emits event LongRelease; + emits event MultiPressOngoing; + emits event MultiPressComplete; ram attribute numberOfPositions default = 2; ram attribute currentPosition; + ram attribute multiPressMax default = 2; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; } diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 8ca915a66c1a70..3193cf4c48b1d7 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -3977,6 +3977,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "MultiPressMax", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -4009,6 +4025,57 @@ "maxInterval": 65534, "reportableChange": 0 } + ], + "events": [ + { + "name": "SwitchLatched", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "InitialPress", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "LongPress", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShortRelease", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "LongRelease", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "MultiPressOngoing", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "MultiPressComplete", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { From 73d885dea9a605a18585c2c4fa13d2f8e5183d0c Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 25 Jul 2023 11:18:08 -0700 Subject: [PATCH 2/3] Address review comments --- .../lighting-common/lighting-app.matter | 4 --- .../lighting-common/lighting-app.zap | 30 ------------------- 2 files changed, 34 deletions(-) diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index d964e5e22ad83b..4aa13e3667609a 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1551,7 +1551,6 @@ server cluster Switch = 59 { readonly attribute int8u numberOfPositions = 0; readonly attribute int8u currentPosition = 1; - readonly attribute int8u multiPressMax = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2360,11 +2359,8 @@ endpoint 0 { emits event LongPress; emits event ShortRelease; emits event LongRelease; - emits event MultiPressOngoing; - emits event MultiPressComplete; ram attribute numberOfPositions default = 2; ram attribute currentPosition; - ram attribute multiPressMax default = 2; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; } diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 3193cf4c48b1d7..af8f50496b26a5 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -3977,22 +3977,6 @@ "maxInterval": 65344, "reportableChange": 0 }, - { - "name": "MultiPressMax", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "FeatureMap", "code": 65532, @@ -4061,20 +4045,6 @@ "mfgCode": null, "side": "server", "included": 1 - }, - { - "name": "MultiPressOngoing", - "code": 5, - "mfgCode": null, - "side": "server", - "included": 1 - }, - { - "name": "MultiPressComplete", - "code": 6, - "mfgCode": null, - "side": "server", - "included": 1 } ] }, From c2f2a32c202024453f2469b9fa2b11c5b0eb25cb Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 27 Jul 2023 23:27:34 -0700 Subject: [PATCH 3/3] Remove all *Press events --- .../lighting-common/lighting-app.matter | 4 --- .../lighting-common/lighting-app.zap | 28 ------------------- 2 files changed, 32 deletions(-) diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 4aa13e3667609a..5899f6e6658f79 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -2355,10 +2355,6 @@ endpoint 0 { server cluster Switch { emits event SwitchLatched; - emits event InitialPress; - emits event LongPress; - emits event ShortRelease; - emits event LongRelease; ram attribute numberOfPositions default = 2; ram attribute currentPosition; ram attribute featureMap default = 0; diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index af8f50496b26a5..59133c8e15269e 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -4017,34 +4017,6 @@ "mfgCode": null, "side": "server", "included": 1 - }, - { - "name": "InitialPress", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1 - }, - { - "name": "LongPress", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1 - }, - { - "name": "ShortRelease", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1 - }, - { - "name": "LongRelease", - "code": 4, - "mfgCode": null, - "side": "server", - "included": 1 } ] },