-
- All Implemented Interfaces:
-
no.nordicsemi.android.ble.common.profile.cgm.CGMTypes,no.nordicsemi.android.ble.common.profile.glucose.GlucoseTypes
public interface ContinuousGlucoseMeasurementCallback implements CGMTypes
-
-
Method Summary
Modifier and Type Method Description abstract voidonContinuousGlucoseMeasurementReceived(@NonNull() BluetoothDevice device, @FloatRange(from = 0) float glucoseConcentration, @Nullable() Float cgmTrend, @Nullable() Float cgmQuality, @Nullable() CGMTypes.CGMStatus status, @IntRange(from = 0) int timeOffset, boolean secured)Callback called when a Continuous Glucose Measurement packet has been received. voidonContinuousGlucoseMeasurementReceivedWithCrcError(@NonNull() BluetoothDevice device, @NonNull() Data data)Callback called when a CGM packet with E2E field was received but the CRC check has failed. static floattoMgPerDecilitre(float value)Converts the value from mmol/L to mg/dL. -
-
Method Detail
-
onContinuousGlucoseMeasurementReceived
abstract void onContinuousGlucoseMeasurementReceived(@NonNull() BluetoothDevice device, @FloatRange(from = 0) float glucoseConcentration, @Nullable() Float cgmTrend, @Nullable() Float cgmQuality, @Nullable() CGMTypes.CGMStatus status, @IntRange(from = 0) int timeOffset, boolean secured)
Callback called when a Continuous Glucose Measurement packet has been received.
If the E2E CRC field was present in the CGM packet, the data has been verified against it.If CRC check has failed, the onContinuousGlucoseMeasurementReceivedWithCrcError will be called instead.
The Glucose concentration is reported in mg/dL. To convert it to mmol/L use:
or simply call toMgPerDecilitre.value [mg/dL] = 18.02 * value [mmol/L]Note that the conversion factor is compliant to the Continua blood glucose meter specification.
- Parameters:
device- the target device.glucoseConcentration- the glucose concentration in mg/dL.cgmTrend- an optional CGM Trend information, in (mg/dL)/min.cgmQuality- an optional CGM Quality information in percent.status- the status of the measurement.timeOffset- the time offset in minutes since Session Start Time.secured- true if the packet was sent with E2E-CRC value that was verifiedto match the packet, false if the packet didn't contain CRC field.
-
onContinuousGlucoseMeasurementReceivedWithCrcError
void onContinuousGlucoseMeasurementReceivedWithCrcError(@NonNull() BluetoothDevice device, @NonNull() Data data)
Callback called when a CGM packet with E2E field was received but the CRC check has failed.
- Parameters:
device- the target device.data- the CGM packet data that was received, including the CRC field.
-
toMgPerDecilitre
static float toMgPerDecilitre(float value)
Converts the value from mmol/L to mg/dL.
- Parameters:
value- the glucose concentration value in given unit.
-
-
-
-