Skip to content

Commit

Permalink
Add Air Quality Cluster to All Clusters Example (#26765) (#26834)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
tobiasgraf authored May 26, 2023
1 parent a63cc4f commit 3d521b0
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
180 changes: 172 additions & 8 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
}
],
"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": [
Expand Down Expand Up @@ -2967,7 +2967,7 @@
"code": 2,
"mfgCode": null,
"side": "server",
"type": "RegulatoryLocationTypeEnum",
"type": "RegulatoryLocationType",
"included": 1,
"storageOption": "External",
"singleton": 0,
Expand All @@ -2983,7 +2983,7 @@
"code": 3,
"mfgCode": null,
"side": "server",
"type": "RegulatoryLocationTypeEnum",
"type": "RegulatoryLocationType",
"included": 1,
"storageOption": "External",
"singleton": 0,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/app/util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ void MatterProxyValidPluginServerInitCallback() {}
void MatterProxyDiscoveryPluginServerInitCallback() {}
void MatterProxyConfigurationPluginServerInitCallback() {}
void MatterFanControlPluginServerInitCallback() {}
void MatterAirQualityPluginServerInitCallback() {}

// ****************************************
// Print out information about each cluster
Expand Down
1 change: 1 addition & 0 deletions src/app/zap_cluster_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 3d521b0

Please sign in to comment.