Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/components/ble/weather/WeatherService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,13 @@ namespace Pinetime {
return result;
}

int16_t WeatherService::GetTempFahrenheit(int16_t temp) const {
if (temp == -32768) {
return -32768;
}
return temp * 9 / 5 + 3200;
}

void WeatherService::CleanUpQcbor(QCBORDecodeContext* decodeContext) {
QCBORDecode_ExitMap(decodeContext);
QCBORDecode_Finish(decodeContext);
Expand Down
6 changes: 6 additions & 0 deletions src/components/ble/weather/WeatherService.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ namespace Pinetime {
*/
int16_t GetTodayMinTemp() const;

/**
* Converts the temperature in degrees Celsius to degrees Fahrenheit
* @return -32768 if there's no data, degrees Fahrenheit times 100 otherwise
*/
int16_t GetTempFahrenheit(int16_t temp) const;

/*
* Management functions
*/
Expand Down