Skip to content

Commit

Permalink
[LVL control] Return invalid command on move when rate is 0 or rate i…
Browse files Browse the repository at this point in the history
…s null and de… (#33204)

* Return invalid command on move when rate is 0 or rate is null  and defaultRate is 0

* Update src/app/clusters/level-control/level-control.cpp

Co-authored-by: mkardous-silabs <[email protected]>

* Add check for stepSize and stepMode and move the parameters validation at function entry

* Update level-control-cluster.xml to bump revision to 6 and set the min value of default move rate to 1 per spec

* Update level control cluster revision from 5 to 6 in all zap files using it with update_cluster_revisions.py and regen

* bump expected cluster revision in test TC_LVL_1_1 and min default Move Rate in TC_LVL_2_1

* rebase and regen all

* Zap regen post rebase

* address comments

---------

Co-authored-by: mkardous-silabs <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Oct 2, 2024
1 parent e1308fe commit 638cebd
Show file tree
Hide file tree
Showing 70 changed files with 258 additions and 239 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ deprecated cluster OnOffSwitchConfiguration = 7 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -7847,7 +7847,7 @@ endpoint 1 {
ram attribute defaultMoveRate default = 50;
persist attribute startUpCurrentLevel default = 255;
ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7303,7 +7303,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -6340,7 +6340,7 @@ endpoint 1 {
ram attribute onLevel default = 0xFF;
persist attribute startUpCurrentLevel default = 255;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5047,7 +5047,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
4 changes: 2 additions & 2 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -2330,7 +2330,7 @@ endpoint 2 {
ram attribute defaultMoveRate;
persist attribute startUpCurrentLevel default = 255;
ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/bridge-common/bridge-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -5387,7 +5387,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -2041,7 +2041,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0x03;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4564,7 +4564,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -2407,7 +2407,7 @@ endpoint 2 {
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4666,7 +4666,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -1988,7 +1988,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3047,7 +3047,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -1852,7 +1852,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0x03;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3301,7 +3301,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -2109,7 +2109,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0x03;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3269,7 +3269,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -2237,7 +2237,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 1;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
16 changes: 8 additions & 8 deletions examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
"package": [
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl.json",
"type": "zcl-properties",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data"
"version": "chip-v1"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"path": "../../../src/app/zap-templates/zcl/zcl.json",
"type": "zcl-properties",
"category": "matter",
"version": "chip-v1"
"version": 1,
"description": "Matter SDK ZCL data"
}
],
"endpointTypes": [
Expand Down Expand Up @@ -3173,7 +3173,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
4 changes: 2 additions & 2 deletions examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -1789,7 +1789,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
2 changes: 1 addition & 1 deletion examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap
Original file line number Diff line number Diff line change
Expand Up @@ -3269,7 +3269,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
4 changes: 2 additions & 2 deletions examples/chef/devices/rootnode_onofflight_samplemei.matter
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -1821,7 +1821,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
2 changes: 1 addition & 1 deletion examples/chef/devices/rootnode_onofflight_samplemei.zap
Original file line number Diff line number Diff line change
Expand Up @@ -3269,7 +3269,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"category": "matter",
"version": "chip-v1"
}
],
"endpointTypes": [
Expand Down
4 changes: 2 additions & 2 deletions examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ cluster OnOff = 6 {

/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */
cluster LevelControl = 8 {
revision 5;
revision 6;

enum MoveModeEnum : enum8 {
kUp = 0;
Expand Down Expand Up @@ -1686,7 +1686,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0x1;
ram attribute clusterRevision default = 5;
ram attribute clusterRevision default = 6;

handle command MoveToLevel;
handle command Move;
Expand Down
2 changes: 1 addition & 1 deletion examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
5 changes: 3 additions & 2 deletions examples/chef/sample_app_util/test_files/sample_zap_file.zap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"fileFormat": 2,
"featureLevel": 100,
"featureLevel": 102,
"creator": "zap",
"keyValuePairs": [
{
Expand Down Expand Up @@ -29,6 +29,7 @@
"pathRelativity": "relativeToZap",
"path": "../../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"category": "matter",
"version": "chip-v1"
}
],
Expand Down Expand Up @@ -4925,7 +4926,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "5",
"defaultValue": "6",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
Loading

0 comments on commit 638cebd

Please sign in to comment.