summaryrefslogtreecommitdiff
path: root/src/components/ble
diff options
context:
space:
mode:
authorAvamander <avamander@gmail.com>2021-12-02 23:49:51 +0200
committerAvamander <avamander@gmail.com>2021-12-04 22:03:40 +0200
commit58d454b11fe3c143b37aea90772c122321a5b902 (patch)
treefd01604408d5837f82f4d4ef362d171a4716ae01 /src/components/ble
parent4a8f72bd1e77a387b1fe97d316c0f75d8c94c936 (diff)
Improved Temperature parsing
Diffstat (limited to 'src/components/ble')
-rw-r--r--src/components/ble/weather/WeatherService.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/components/ble/weather/WeatherService.cpp b/src/components/ble/weather/WeatherService.cpp
index e5d8053a..a30b2270 100644
--- a/src/components/ble/weather/WeatherService.cpp
+++ b/src/components/ble/weather/WeatherService.cpp
@@ -195,7 +195,7 @@ namespace Pinetime {
int64_t tmpTemperature = 0;
QCBORDecode_GetInt64InMapSZ(&decodeContext, "Temperature", &tmpTemperature);
- if (tmpTemperature < 0 || tmpTemperature > 65535) {
+ if (tmpTemperature < -32768 || tmpTemperature > 32767) {
return BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN;
}
temperature->temperature = tmpTemperature; // NOLINT(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)