66 unsigned short toValue(
float temperature) const noexcept;
103 return value / _factor + _offset;
108 return static_cast<unsigned short>((temperature - _offset) * _factor);
Contains defines controlling the Windows DLL export and import of symbols.
#define OTC_SDK_API
Only needed when working with Windows DLLs.
Definition Api.h:65
Contains an enum representing the different temperature precisions and constants denoting invalid tem...
bool isValueValid(unsigned short value) noexcept
Checks if an internal value is valid.
Definition TemperatureConverter.h:116
OTC_SDK_API TemperatureConverter() noexcept
Constructor.
float toTemperature(float value) const noexcept
Converts an internal value to a temperature in °C.
Definition TemperatureConverter.h:101
TemperaturePrecision getPrecision() const noexcept
Returns the temperature precision.
Definition TemperatureConverter.h:96
unsigned short toValue(float temperature) const noexcept
Converts a temperature in °C to an internal value.
Definition TemperatureConverter.h:106
OTC_SDK_API void setPrecision(TemperaturePrecision precision) noexcept
Set the temperature precision.
bool isTemperatureValid(float temperature) noexcept
Checks if the given temperature in °C is valid.
Definition TemperatureConverter.h:111
Main SDK namespace.
Definition DeviceInfo.h:23
static constexpr float INVALID_TEMPERATURE
All temperatures in °C equal or lower are invalid.
Definition TemperaturePrecision.h:21
static constexpr unsigned short INVALID_VALUE
All internal temperature values equal to this are invalid.
Definition TemperaturePrecision.h:24
TemperaturePrecision
Represents the available temperature precisions.
Definition TemperaturePrecision.h:29