Improved Temperature parsing
This commit is contained in:
parent
4a8f72bd1e
commit
58d454b11f
|
@ -195,7 +195,7 @@ namespace Pinetime {
|
||||||
|
|
||||||
int64_t tmpTemperature = 0;
|
int64_t tmpTemperature = 0;
|
||||||
QCBORDecode_GetInt64InMapSZ(&decodeContext, "Temperature", &tmpTemperature);
|
QCBORDecode_GetInt64InMapSZ(&decodeContext, "Temperature", &tmpTemperature);
|
||||||
if (tmpTemperature < 0 || tmpTemperature > 65535) {
|
if (tmpTemperature < -32768 || tmpTemperature > 32767) {
|
||||||
return BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN;
|
return BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN;
|
||||||
}
|
}
|
||||||
temperature->temperature = tmpTemperature; // NOLINT(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
|
temperature->temperature = tmpTemperature; // NOLINT(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user