Add Air Quality Cluster to All Clusters Example (#26765) (#26834)
* Add Air Quality Cluster to All Clusters Example (#26765)
* Add missing .matter file
* Add MatterAirQualityPluginServerInitCallback() to util.cpp
needed for some build targets
(#26765)
* Update Featuremap from 0 to 15
To include all the features in the all clusters example app.
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 dff6d67..0cd7708 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
@@ -2329,6 +2329,34 @@
command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0;
}
+/** Attributes for reporting air quality classification */
+server cluster AirQuality = 91 {
+ enum AirQualityEnum : ENUM8 {
+ kUnknown = 0;
+ kGood = 1;
+ kFair = 2;
+ kModerate = 3;
+ kPoor = 4;
+ kVeryPoor = 5;
+ kExtremelyPoor = 6;
+ }
+
+ bitmap Feature : BITMAP32 {
+ kFair = 0x1;
+ kModerate = 0x2;
+ kVeryPoor = 0x4;
+ kExtremelyPoor = 0x8;
+ }
+
+ readonly attribute AirQualityEnum airQuality = 0;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
/** An interface to a generic way to secure a door */
server cluster DoorLock = 257 {
enum AlarmCodeEnum : ENUM8 {
@@ -5145,6 +5173,16 @@
ram attribute manufacturerExtension default = 255;
}
+ server cluster AirQuality {
+ ram attribute airQuality default = 0;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 15;
+ ram attribute clusterRevision default = 1;
+ }
+
server cluster DoorLock {
emits event DoorLockAlarm;
emits event LockOperation;
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 869e7eb..310a5e6 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": [
@@ -2967,7 +2967,7 @@
"code": 2,
"mfgCode": null,
"side": "server",
- "type": "RegulatoryLocationTypeEnum",
+ "type": "RegulatoryLocationType",
"included": 1,
"storageOption": "External",
"singleton": 0,
@@ -2983,7 +2983,7 @@
"code": 3,
"mfgCode": null,
"side": "server",
- "type": "RegulatoryLocationTypeEnum",
+ "type": "RegulatoryLocationType",
"included": 1,
"storageOption": "External",
"singleton": 0,
@@ -13029,6 +13029,170 @@
]
},
{
+ "name": "Air Quality",
+ "code": 91,
+ "mfgCode": null,
+ "define": "AIR_QUALITY_CLUSTER",
+ "side": "client",
+ "enabled": 0,
+ "attributes": [
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "client",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Air Quality",
+ "code": 91,
+ "mfgCode": null,
+ "define": "AIR_QUALITY_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "AirQuality",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "AirQualityEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "15",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
"name": "Door Lock",
"code": 257,
"mfgCode": null,
diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp
index f11e4c6..8af4be1 100644
--- a/src/app/util/util.cpp
+++ b/src/app/util/util.cpp
@@ -137,6 +137,7 @@
void MatterProxyDiscoveryPluginServerInitCallback() {}
void MatterProxyConfigurationPluginServerInitCallback() {}
void MatterFanControlPluginServerInitCallback() {}
+void MatterAirQualityPluginServerInitCallback() {}
// ****************************************
// Print out information about each cluster
diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json
index c7acfd7..a5d1237 100644
--- a/src/app/zap_cluster_list.json
+++ b/src/app/zap_cluster_list.json
@@ -146,6 +146,7 @@
"ADMINISTRATOR_COMMISSIONING_CLUSTER": [
"administrator-commissioning-server"
],
+ "AIR_QUALITY_CLUSTER": [],
"ALARM_CLUSTER": [],
"APPLICATION_BASIC_CLUSTER": ["application-basic-server"],
"APPLICATION_LAUNCHER_CLUSTER": ["application-launcher-server"],