From edee83bccaec12e34f1abd1ac9f6d941a0190a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 24 Dec 2023 11:01:00 +0100 Subject: [PATCH] Add support for Celsius to Fahreneit conversion --- sim/components/ble/SimpleWeatherService.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sim/components/ble/SimpleWeatherService.h b/sim/components/ble/SimpleWeatherService.h index be0d141..1c1be02 100644 --- a/sim/components/ble/SimpleWeatherService.h +++ b/sim/components/ble/SimpleWeatherService.h @@ -88,6 +88,10 @@ class SimpleWeatherService { std::optional Current() const; std::optional GetForecast() const; + static int16_t CelsiusToFahrenheit(int16_t celsius) { + return celsius * 9 / 5 + 3200; + } + private: // 00050000-78fc-48fe-8e23-433b3a1942d0 //static constexpr ble_uuid128_t BaseUuid() {