From 3e4e368b5cb59055fdf8dc11ec1e1b6e62e203dd Mon Sep 17 00:00:00 2001 From: Sarthak Shaha Date: Wed, 14 Aug 2024 14:00:41 -0400 Subject: [PATCH] getter for air quality --- .../include/air-quality-sensor-manager.h | 5 +++++ .../src/air-quality-sensor-manager.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/include/air-quality-sensor-manager.h b/examples/air-quality-sensor-app/air-quality-sensor-common/include/air-quality-sensor-manager.h index 93e7bff871c942..a4d6367596e3c5 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/include/air-quality-sensor-manager.h +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/include/air-quality-sensor-manager.h @@ -29,6 +29,11 @@ class AirQualitySensorManager } }; + /** + * @return The current AirQuality value. + */ + AirQuality::AirQualityEnum GetAirQuality(); + /** * @brief Get an Air Quality Manager object - this class acts as a singleton device manager for the air quality device * @param[in] aEndpointId Endpoint that the air quality is on diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp b/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp index a6e94765d86cf8..5fc8bd86c5f821 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp @@ -134,6 +134,11 @@ void AirQualitySensorManager::Init() mFormaldehydeConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); } +AirQualityEnum AirQualitySensorManager::GetAirQuality() +{ + return mAirQualityInstance.GetAirQuality(); +} + void AirQualitySensorManager::OnAirQualityChangeHandler(AirQualityEnum newValue) { mAirQualityInstance.UpdateAirQuality(newValue);