From 1e1453a15c30201b54aee7963ad74e020b1a7088 Mon Sep 17 00:00:00 2001 From: Matt Hazley Date: Thu, 7 Sep 2023 14:13:52 +0100 Subject: [PATCH] Added Feature Map to `AirQuality` Read Handler (#29105) * Added Feature Map to read handler * Set the air quality feature map to zero in zapfile so that we are sure the value is being encoded by the read handler --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../all-clusters-common/all-clusters-app.zap | 8 ++++---- .../clusters/air-quality-server/air-quality-server.cpp | 3 +++ 3 files changed, 8 insertions(+), 5 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 58f744659d5801..705324367f39e9 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 @@ -6826,7 +6826,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 15; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; } 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 bcd0bb239ab26d..191519900a4990 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 @@ -10495,7 +10495,7 @@ ] }, { - "id": 4, + "id": 2, "name": "MA-onofflight", "deviceTypeRef": { "code": 256, @@ -16926,7 +16926,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "15", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -34866,7 +34866,7 @@ ] }, { - "id": 2, + "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { "code": 61442, @@ -35394,4 +35394,4 @@ } ], "log": [] -} +} \ No newline at end of file diff --git a/src/app/clusters/air-quality-server/air-quality-server.cpp b/src/app/clusters/air-quality-server/air-quality-server.cpp index 875bd4c4dfa9bb..f9ff17bc4fe53f 100644 --- a/src/app/clusters/air-quality-server/air-quality-server.cpp +++ b/src/app/clusters/air-quality-server/air-quality-server.cpp @@ -115,6 +115,9 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu case Attributes::AirQuality::Id: ReturnErrorOnFailure(aEncoder.Encode(mAirQuality)); break; + case Attributes::FeatureMap::Id: + ReturnErrorOnFailure(aEncoder.Encode(mFeature.Raw())); + break; } return CHIP_NO_ERROR; }