Author: Jean-François Milants <jf@codingfield.com>
Simple Weather Service Fix ToUInt64() in SimpleWeatherService.cpp. Fix typo in SimpleWeatherService.md.
doc/SimpleWeatherService.md | 3 ++- src/components/ble/SimpleWeatherService.cpp | 2 +-
diff --git a/doc/SimpleWeatherService.md b/doc/SimpleWeatherService.md index db8a6f653029eb737f3bfea8d2d349d0416fedce..8183637939191ed0c4f8ef3579a1bed110e60ae4 100644 --- a/doc/SimpleWeatherService.md +++ b/doc/SimpleWeatherService.md @@ -2,7 +2,8 @@ # Simple Weather Service ## Introduction -The Simple Weather Service provide a simple and straightforward API to specify the current weather and the forecast for the next 5 days. It effectively replaces the original Weather Service (from InfiniTime 1.8) since InfiniTime 1.14 +The Simple Weather Service provides a simple and straightforward API to specify the current weather and the forecast for the next 5 days. +It effectively replaces the original Weather Service (from InfiniTime 1.8) since InfiniTime 1.14. ## Service diff --git a/src/components/ble/SimpleWeatherService.cpp b/src/components/ble/SimpleWeatherService.cpp index 8317aeab86e6a18b918bf5d17397f3f66d700ac7..886bf659396b14641efd053b65c2f1a7551d56a0 100644 --- a/src/components/ble/SimpleWeatherService.cpp +++ b/src/components/ble/SimpleWeatherService.cpp @@ -30,7 +30,7 @@ enum class MessageType : uint8_t { CurrentWeather, Forecast, Unknown }; uint64_t ToUInt64(const uint8_t* data) { return data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24) + (static_cast<uint64_t>(data[4]) << 32) + - (static_cast<uint64_t>(data[5]) << 48) + (static_cast<uint64_t>(data[6]) << 48) + (static_cast<uint64_t>(data[7]) << 56); + (static_cast<uint64_t>(data[5]) << 40) + (static_cast<uint64_t>(data[6]) << 48) + (static_cast<uint64_t>(data[7]) << 56); } int16_t ToInt16(const uint8_t* data) {