[Scenes] Explicit feature flag (#29535)
* Enforced Explicit support in scene server and added default values to scene cluster where enabled
* Fixed overwrite in attributes
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 4b5bef3..1b65362 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
@@ -6558,15 +6558,15 @@
ram attribute currentScene default = 0x00;
ram attribute currentGroup default = 0x0000;
ram attribute sceneValid default = 0x00;
- ram attribute nameSupport;
+ ram attribute nameSupport default = 0x80;
ram attribute lastConfiguredBy;
- ram attribute sceneTableSize;
- callback attribute remainingCapacity;
+ ram attribute sceneTableSize default = 16;
+ callback attribute remainingCapacity default = 8;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
- ram attribute featureMap default = 0;
+ ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
}
@@ -7606,14 +7606,14 @@
ram attribute currentScene default = 0x00;
ram attribute currentGroup default = 0x0000;
ram attribute sceneValid default = 0x00;
- ram attribute nameSupport;
- ram attribute sceneTableSize;
- callback attribute remainingCapacity;
+ ram attribute nameSupport default = 0x80;
+ ram attribute sceneTableSize default = 16;
+ callback attribute remainingCapacity default = 8;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
- ram attribute featureMap default = 0;
+ ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
}
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 c7ccc67..ba764f3 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
@@ -18,17 +18,17 @@
"package": [
{
"pathRelativity": "relativeToZap",
+ "path": "../../../src/app/zap-templates/app-templates.json",
+ "type": "gen-templates-json",
+ "version": "chip-v1"
+ },
+ {
+ "pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json",
"type": "zcl-properties",
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data with some extensions"
- },
- {
- "pathRelativity": "relativeToZap",
- "path": "../../../src/app/zap-templates/app-templates.json",
- "type": "gen-templates-json",
- "version": "chip-v1"
}
],
"endpointTypes": [
@@ -11207,7 +11207,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x80",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -11239,7 +11239,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "16",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -11255,7 +11255,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "8",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -11335,7 +11335,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0",
+ "defaultValue": "3",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -31301,7 +31301,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x80",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -31333,7 +31333,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "16",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -31349,7 +31349,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "8",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -31429,7 +31429,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0",
+ "defaultValue": "3",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -35392,5 +35392,6 @@
"endpointId": 65534,
"networkId": 0
}
- ]
+ ],
+ "log": []
}
\ No newline at end of file
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
index 29b2c68..5263ae7 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
@@ -4285,15 +4285,15 @@
ram attribute currentScene default = 0x00;
ram attribute currentGroup default = 0x0000;
ram attribute sceneValid default = 0x00;
- ram attribute nameSupport;
+ ram attribute nameSupport default = 0x80;
ram attribute lastConfiguredBy;
- ram attribute sceneTableSize;
- callback attribute remainingCapacity;
+ ram attribute sceneTableSize default = 16;
+ callback attribute remainingCapacity default = 8;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
- ram attribute featureMap default = 0;
+ ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
}
@@ -4733,14 +4733,14 @@
ram attribute currentScene default = 0x00;
ram attribute currentGroup default = 0x0000;
ram attribute sceneValid default = 0x00;
- ram attribute nameSupport;
- ram attribute sceneTableSize;
- callback attribute remainingCapacity;
+ ram attribute nameSupport default = 0x80;
+ ram attribute sceneTableSize default = 16;
+ callback attribute remainingCapacity default = 8;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
- ram attribute featureMap default = 0;
+ ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
}
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
index 97f716a..66e573b 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap
@@ -10259,7 +10259,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x80",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -10291,7 +10291,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "16",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -10307,7 +10307,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "8",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -10387,7 +10387,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0",
+ "defaultValue": "3",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -23497,7 +23497,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "0x80",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -23529,7 +23529,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "16",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -23545,7 +23545,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "8",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -23625,7 +23625,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0",
+ "defaultValue": "3",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -27588,5 +27588,6 @@
"endpointId": 65534,
"networkId": 0
}
- ]
+ ],
+ "log": []
}
\ No newline at end of file
diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter
index dd21ff6..8b23739 100644
--- a/examples/lighting-app/lighting-common/lighting-app.matter
+++ b/examples/lighting-app/lighting-common/lighting-app.matter
@@ -2409,12 +2409,12 @@
ram attribute sceneValid default = 0x00;
ram attribute nameSupport default = 0x80;
ram attribute lastConfiguredBy;
- ram attribute sceneTableSize;
- callback attribute remainingCapacity;
+ ram attribute sceneTableSize default = 16;
+ callback attribute remainingCapacity default = 8;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute attributeList;
- ram attribute featureMap default = 1;
+ ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
}
diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap
index f76450d..8691f80 100644
--- a/examples/lighting-app/lighting-common/lighting-app.zap
+++ b/examples/lighting-app/lighting-common/lighting-app.zap
@@ -5332,7 +5332,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "16",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -5348,7 +5348,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "8",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -5428,7 +5428,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "1",
+ "defaultValue": "3",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -7796,5 +7796,6 @@
"endpointId": 1,
"networkId": 0
}
- ]
+ ],
+ "log": []
}
\ No newline at end of file
diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter
index 227c72d..c004f45 100644
--- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter
+++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter
@@ -2435,7 +2435,7 @@
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
- ram attribute featureMap default = 0;
+ ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
}
diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap
index d72f215..12a6f51 100644
--- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap
+++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap
@@ -6673,7 +6673,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0",
+ "defaultValue": "3",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -9546,5 +9546,6 @@
"endpointId": 1,
"networkId": 0
}
- ]
+ ],
+ "log": []
}
\ No newline at end of file
diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter
index 2d6ba3b..2f40d35 100644
--- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter
+++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter
@@ -2269,13 +2269,13 @@
ram attribute sceneValid default = 0x00;
ram attribute nameSupport default = 0x80;
ram attribute lastConfiguredBy;
- ram attribute sceneTableSize;
- callback attribute remainingCapacity;
+ ram attribute sceneTableSize default = 16;
+ callback attribute remainingCapacity default = 8;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
- ram attribute featureMap default = 1;
+ ram attribute featureMap default = 3;
ram attribute clusterRevision default = 5;
}
diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap
index 83ba6bb..10f51fc 100644
--- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap
+++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap
@@ -6299,7 +6299,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "16",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -6315,7 +6315,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": "8",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -6395,7 +6395,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "1",
+ "defaultValue": "3",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -9631,5 +9631,6 @@
"endpointId": 1,
"networkId": 0
}
- ]
+ ],
+ "log": []
}
\ No newline at end of file
diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp
index 4cfc016..9fe8763 100644
--- a/src/app/clusters/scenes-server/scenes-server.cpp
+++ b/src/app/clusters/scenes-server/scenes-server.cpp
@@ -115,10 +115,13 @@
for (auto endpoint : EnabledEndpointsWithServerCluster(Id))
{
- EmberAfStatus status = Attributes::FeatureMap::Set(endpoint, to_underlying(Feature::kSceneNames));
+ // Explicit AttributeValuePairs is mandatory for matter so we force it here, ScenesName is not but it is forced for now
+ // TODO: We currently force SceneNames on but this needs to be modified to read the value generated from Zap instead.
+ uint32_t featureMap = to_underlying(Feature::kExplicit) | to_underlying(Feature::kSceneNames);
+ EmberAfStatus status = Attributes::FeatureMap::Set(endpoint, featureMap);
if (EMBER_ZCL_STATUS_SUCCESS != status)
{
- ChipLogDetail(Zcl, "ERR: setting feature map on Endpoint %hu Status: %x", endpoint, status);
+ ChipLogDetail(Zcl, "ERR: setting the scenes FeatureMap on Endpoint %hu Status: %x", endpoint, status);
}
// The bit of 7 the NameSupport attribute indicates whether or not scene names are supported
//