-
- All Implemented Interfaces:
-
android.os.Parcelable,no.nordicsemi.android.ble.callback.DataReceivedCallback,no.nordicsemi.android.ble.callback.profile.ProfileDataCallback,no.nordicsemi.android.ble.common.profile.glucose.GlucoseMeasurementContextCallback
public final class GlucoseMeasurementContextResponse extends GlucoseMeasurementContextDataCallback implements Parcelable
Response class that could be used as a result of a synchronous request. The data received are available through getters, instead of a callback.
Usage example:
try { GlucoseMeasurementContextResponse response = waitForNotification(characteristic) .awaitValid(GlucoseMeasurementContextResponse.class); Carbohydrate carbohydrate = response.getCarbohydrate(); if (carbohydrate != null) { ... } ... } catch (RequestFailedException e) { Log.w(TAG, "Request failed with status " + e.getStatus(), e); } catch (InvalidDataException e) { Log.w(TAG, "Invalid data received: " + e.getResponse().getRawData()); }
-
-
Field Summary
Fields Modifier and Type Field Description private intsequenceNumberprivate GlucoseMeasurementContextCallback.Carbohydratecarbohydrateprivate FloatcarbohydrateAmountprivate GlucoseMeasurementContextCallback.Mealmealprivate GlucoseMeasurementContextCallback.Testertesterprivate GlucoseMeasurementContextCallback.Healthhealthprivate IntegerexerciseDurationprivate IntegerexerciseIntensityprivate GlucoseMeasurementContextCallback.Medicationmedicationprivate FloatmedicationAmountprivate IntegermedicationUnitpublic final static Parcelable.Creator<GlucoseMeasurementContextResponse>CREATOR
-
Constructor Summary
Constructors Constructor Description GlucoseMeasurementContextResponse()
-
Method Summary
-
Methods inherited from class no.nordicsemi.android.ble.common.callback.glucose.GlucoseMeasurementContextDataCallback
onDataReceived -
Methods inherited from class no.nordicsemi.android.ble.callback.profile.ProfileReadResponse
isValid, onInvalidDataReceived, writeToParcel -
Methods inherited from class no.nordicsemi.android.ble.response.ReadResponse
describeContents, getBluetoothDevice, getRawData, onDataReceived -
Methods inherited from class no.nordicsemi.android.ble.common.profile.glucose.GlucoseMeasurementContextCallback
onGlucoseMeasurementContextReceived -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getSequenceNumber
int getSequenceNumber()
-
getCarbohydrate
@Nullable() GlucoseMeasurementContextCallback.Carbohydrate getCarbohydrate()
-
getCarbohydrateAmount
@Nullable() Float getCarbohydrateAmount()
-
getMeal
@Nullable() GlucoseMeasurementContextCallback.Meal getMeal()
-
getTester
@Nullable() GlucoseMeasurementContextCallback.Tester getTester()
-
getHealth
@Nullable() GlucoseMeasurementContextCallback.Health getHealth()
-
getExerciseDuration
@Nullable() Integer getExerciseDuration()
-
getExerciseIntensity
@Nullable() Integer getExerciseIntensity()
-
getMedication
@Nullable() GlucoseMeasurementContextCallback.Medication getMedication()
-
getMedicationAmount
@Nullable() Float getMedicationAmount()
-
getMedicationUnit
@Nullable() Integer getMedicationUnit()
-
onGlucoseMeasurementContextReceived
void onGlucoseMeasurementContextReceived(@NonNull() BluetoothDevice device, int sequenceNumber, @Nullable() GlucoseMeasurementContextCallback.Carbohydrate carbohydrate, @Nullable() Float carbohydrateAmount, @Nullable() GlucoseMeasurementContextCallback.Meal meal, @Nullable() GlucoseMeasurementContextCallback.Tester tester, @Nullable() GlucoseMeasurementContextCallback.Health health, @Nullable() Integer exerciseDuration, @Nullable() Integer exerciseIntensity, @Nullable() GlucoseMeasurementContextCallback.Medication medication, @Nullable() Float medicationAmount, @Nullable() Integer medicationUnit, @Nullable() Float HbA1c)
Callback called when Glucose Measurement Context value was received.
- Parameters:
device- the target device.sequenceNumber- the sequence number that matches the Glucose Measurementsequence number.carbohydrate- an optional carbohydrate ID.carbohydrateAmount- amount of carbohydrate in grams.meal- an optional meal ID.tester- an optional tester ID.health- an optional health information.exerciseDuration- exercise duration in seconds.exerciseIntensity- exercise intensity in percent.medication- an optional medication ID.medicationAmount- amount of medication in milligrams or milliliters,depending on the medicationUnit value.medicationUnit- the unit of medication amount (UNIT_mg or UNIT_ml).HbA1c- the amount of glycated haemoglobin, in percentage.
-
writeToParcel
void writeToParcel(@NonNull() Parcel dest, int flags)
-
-
-
-