-
- All Implemented Interfaces:
-
no.nordicsemi.android.ble.common.profile.glucose.GlucoseTypes
public interface GlucoseMeasurementCallback implements GlucoseTypes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classGlucoseMeasurementCallback.GlucoseStatus
-
Method Summary
Modifier and Type Method Description abstract voidonGlucoseMeasurementReceived(@NonNull() BluetoothDevice device, @IntRange(from = 0, to = 65535) int sequenceNumber, @NonNull() Calendar time, @Nullable() Float glucoseConcentration, @Nullable() Integer unit, @Nullable() Integer type, @Nullable() Integer sampleLocation, @Nullable() GlucoseMeasurementCallback.GlucoseStatus status, boolean contextInformationFollows)Callback called when Glucose Measurement value was received.Except from the BluetoothDevice, only the sequence number and sample time is requiredto be non-null. static floattoKgPerL(float value, int unit)Converts the value provided in given unit to kg/L. static floattoMgPerDecilitre(float value, int unit)Converts the value provided in given unit to mg/dL. static floattoMolPerL(float value, int unit)Converts the value provided in given unit to mol/L. static floattoMmolPerL(float value, int unit)Converts the value provided in given unit to mmol/L. -
-
Method Detail
-
onGlucoseMeasurementReceived
abstract void onGlucoseMeasurementReceived(@NonNull() BluetoothDevice device, @IntRange(from = 0, to = 65535) int sequenceNumber, @NonNull() Calendar time, @Nullable() Float glucoseConcentration, @Nullable() Integer unit, @Nullable() Integer type, @Nullable() Integer sampleLocation, @Nullable() GlucoseMeasurementCallback.GlucoseStatus status, boolean contextInformationFollows)
Callback called when Glucose Measurement value was received.Except from the BluetoothDevice, only the sequence number and sample time is requiredto be non-null.
- Parameters:
device- the target device.sequenceNumber- represents the chronological order of the patient recordsin the Server measurement database.time- the base time with time offset added, if such was presentin the packet.glucoseConcentration- the glucose concentration in the provided unit.unit- the sample unit (UNIT_kg_L or UNIT_mol_L).type- the sample type, see TYPE_* constants.sampleLocation- the sample location, see SAMPLE_LOCATION_* constants.contextInformationFollows- true, if Glucose Measurement Context will be sentimmediately after this packet.
-
toKgPerL
static float toKgPerL(float value, int unit)
Converts the value provided in given unit to kg/L.If the unit is already UNIT_kg_L it will be returned as is.
- Parameters:
value- the glucose concentration value in given unit.unit- the unit of the value (UNIT_kg_L or UNIT_mol_L).
-
toMgPerDecilitre
static float toMgPerDecilitre(float value, int unit)
Converts the value provided in given unit to mg/dL.
- Parameters:
value- the glucose concentration value in given unit.unit- the unit of the value (UNIT_kg_L or UNIT_mol_L).
-
toMolPerL
static float toMolPerL(float value, int unit)
Converts the value provided in given unit to mol/L.If the unit is already UNIT_mol_L it will be returned as is.
- Parameters:
value- the glucose concentration value in given unit.unit- the unit of the value (UNIT_kg_L or UNIT_mol_L).
-
toMmolPerL
static float toMmolPerL(float value, int unit)
Converts the value provided in given unit to mmol/L.
- Parameters:
value- the glucose concentration value in given unit.unit- the unit of the value (UNIT_kg_L or UNIT_mol_L).
-
-
-
-