From 8251397dd722544b45771456e8d6c8275512bae5 Mon Sep 17 00:00:00 2001 From: Kame <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 21:52:35 +0200 Subject: [PATCH] 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. --- .../all-clusters-app.matter | 38 ++++ .../all-clusters-common/all-clusters-app.zap | 180 +++++++++++++++++- src/app/util/util.cpp | 1 + src/app/zap_cluster_list.json | 1 + 4 files changed, 212 insertions(+), 8 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 dff6d6779890f7..0cd7708285ae79 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 @@ server cluster ModeSelect = 80 { 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 @@ endpoint 1 { 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 869e7eb9865a25..310a5e6b0a8797 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 @@ -16,6 +16,12 @@ } ], "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", @@ -23,12 +29,6 @@ "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, @@ -13028,6 +13028,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, diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index f11e4c635a5509..8af4be16d12cb3 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -137,6 +137,7 @@ void MatterProxyValidPluginServerInitCallback() {} 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 c7acfd77abdb92..a5d1237868d5a1 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"],