-
- All Implemented Interfaces:
-
no.nordicsemi.android.ble.common.profile.ht.HealthThermometerTypes
public interface TemperatureMeasurementCallback implements HealthThermometerTypes
-
-
Method Summary
Modifier and Type Method Description abstract voidonTemperatureMeasurementReceived(@NonNull() BluetoothDevice device, float temperature, int unit, @Nullable() Calendar calendar, @Nullable() Integer type)Callback called when Temperature Measurement or Intermediate Temperaturecharacteristic has changed its value. static floattoCelsius(float temperature, int unit)Converts the value provided in given unit to Celsius degrees. static floattoFahrenheit(float temperature, int unit)Converts the value provided in given unit to Fahrenheit degrees. -
-
Method Detail
-
onTemperatureMeasurementReceived
abstract void onTemperatureMeasurementReceived(@NonNull() BluetoothDevice device, float temperature, int unit, @Nullable() Calendar calendar, @Nullable() Integer type)
Callback called when Temperature Measurement or Intermediate Temperaturecharacteristic has changed its value.
Use toCelsius or toFahrenheit to convert units.
- Parameters:
device- the target device.temperature- the temperature received in given unitunit- the temperature unit (UNIT_C or UNIT_F).calendar- an optional timestamp of measurement.type- an optional type where the temperature was measured, see TYPE_* constants.
-
toCelsius
static float toCelsius(float temperature, int unit)
Converts the value provided in given unit to Celsius degrees.If the unit is already UNIT_C it will be returned as is.
- Parameters:
temperature- the temperature value in given unit.unit- the unit of the value (UNIT_C or UNIT_F).
-
toFahrenheit
static float toFahrenheit(float temperature, int unit)
Converts the value provided in given unit to Fahrenheit degrees.If the unit is already UNIT_F it will be returned as is.
- Parameters:
temperature- the temperature value in given unit.unit- the unit of the value (UNIT_C or UNIT_F).
-
-
-
-