From de79f8bfc8897be4a344972d02f687b7d4bc20a3 Mon Sep 17 00:00:00 2001 From: BurievSardor <80237451+BurievSardor@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:55:52 +0500 Subject: [PATCH 1/2] chip::to_underlying is missing --- .../src/air-quality-sensor-manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8bc4f4c627925d..1de5fb9ac4d7b9 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 @@ -137,7 +137,7 @@ void AirQualitySensorManager::Init() void AirQualitySensorManager::OnAirQualityChangeHandler(AirQualityEnum newValue) { mAirQualityInstance.UpdateAirQuality(static_cast(newValue)); - ChipLogDetail(NotSpecified, "Updated AirQuality value: %huu", newValue); + ChipLogDetail(NotSpecified, "Updated AirQuality value: %huu", chip::to_underlying(newValue)); } void AirQualitySensorManager::OnCarbonDioxideMeasurementChangeHandler(float newValue) From a4f033a5ef82729ca8c42eb20cd93c9b796a7f51 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 27 Oct 2023 17:45:26 -0400 Subject: [PATCH 2/2] Apply suggested fix to remove unnecessary cast. --- .../src/air-quality-sensor-manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1de5fb9ac4d7b9..a6e94765d86cf8 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 @@ -136,7 +136,7 @@ void AirQualitySensorManager::Init() void AirQualitySensorManager::OnAirQualityChangeHandler(AirQualityEnum newValue) { - mAirQualityInstance.UpdateAirQuality(static_cast(newValue)); + mAirQualityInstance.UpdateAirQuality(newValue); ChipLogDetail(NotSpecified, "Updated AirQuality value: %huu", chip::to_underlying(newValue)); }