-
- 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.GlucoseMeasurementCallback,no.nordicsemi.android.ble.common.profile.glucose.GlucoseTypes
public final class GlucoseMeasurementResponse extends GlucoseMeasurementDataCallback 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 { GlucoseMeasurementResponse response = waitForNotification(characteristic) .awaitValid(GlucoseMeasurementResponse.class); if (response.contextInformationFollows()) { ... } ... } 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 Calendartimeprivate FloatglucoseConcentrationprivate Integerunitprivate Integertypeprivate IntegersampleLocationprivate GlucoseMeasurementCallback.GlucoseStatusstatuspublic final static Parcelable.Creator<GlucoseMeasurementResponse>CREATOR
-
Constructor Summary
Constructors Constructor Description GlucoseMeasurementResponse()
-
Method Summary
Modifier and Type Method Description intgetSequenceNumber()CalendargetTime()FloatgetGlucoseConcentration()IntegergetUnit()IntegergetType()IntegergetSampleLocation()GlucoseMeasurementCallback.GlucoseStatusgetStatus()voidonGlucoseMeasurementReceived(@NonNull() BluetoothDevice device, 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. booleancontextInformationFollows()voidwriteToParcel(@NonNull() Parcel dest, int flags)-
Methods inherited from class no.nordicsemi.android.ble.common.callback.glucose.GlucoseMeasurementDataCallback
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.GlucoseMeasurementCallback
onGlucoseMeasurementReceived, toKgPerL, toMgPerDecilitre, toMmolPerL, toMolPerL -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getSequenceNumber
int getSequenceNumber()
-
getGlucoseConcentration
@Nullable() Float getGlucoseConcentration()
-
getSampleLocation
@Nullable() Integer getSampleLocation()
-
getStatus
@Nullable() GlucoseMeasurementCallback.GlucoseStatus getStatus()
-
onGlucoseMeasurementReceived
void onGlucoseMeasurementReceived(@NonNull() BluetoothDevice device, 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.
-
contextInformationFollows
boolean contextInformationFollows()
-
writeToParcel
void writeToParcel(@NonNull() Parcel dest, int flags)
-
-
-
-