-
- All Implemented Interfaces:
-
android.os.Parcelable,no.nordicsemi.android.ble.callback.DataReceivedCallback,no.nordicsemi.android.ble.callback.profile.ProfileDataCallback,no.nordicsemi.android.ble.common.callback.cgm.CRCSecuredResponse,no.nordicsemi.android.ble.common.profile.cgm.CGMSpecificOpsControlPointCallback,no.nordicsemi.android.ble.common.profile.cgm.CGMTypes,no.nordicsemi.android.ble.common.profile.glucose.GlucoseTypes
public final class CGMSpecificOpsControlPointResponse extends CGMSpecificOpsControlPointDataCallback implements CRCSecuredResponse, 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 { CGMSpecificOpsControlPointResponse response = waitForIndication(characteristic) .trigger(CGMSpecificOpsControlPointData.startSession()) .awaitValid(CGMSpecificOpsControlPointResponse.class); if (response.isOperationCompleted()) { ... } ... } 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 intrequestCodeprivate interrorCodeprivate intglucoseCommunicationIntervalprivate floatglucoseConcentrationOfCalibrationprivate intcalibrationTimeprivate intnextCalibrationTimeprivate inttypeprivate intsampleLocationprivate intcalibrationDataRecordNumberprivate CGMTypes.CGMCalibrationStatuscalibrationStatusprivate floatalertLevelpublic final static Parcelable.Creator<CGMSpecificOpsControlPointResponse>CREATOR
-
Constructor Summary
Constructors Constructor Description CGMSpecificOpsControlPointResponse()
-
Method Summary
Modifier and Type Method Description intgetRequestCode()intgetErrorCode()intgetGlucoseCommunicationInterval()floatgetGlucoseConcentrationOfCalibration()intgetCalibrationTime()intgetNextCalibrationTime()intgetType()intgetSampleLocation()intgetCalibrationDataRecordNumber()CGMTypes.CGMCalibrationStatusgetCalibrationStatus()floatgetAlertLevel()voidonCGMSpecificOpsOperationCompleted(@NonNull() BluetoothDevice device, int requestCode, boolean secured)Callback called when a CGM Specific Ops request has finished successfully. voidonCGMSpecificOpsOperationError(@NonNull() BluetoothDevice device, int requestCode, int errorCode, boolean secured)Callback called when a CGM Specific Ops request has failed. voidonCGMSpecificOpsResponseReceivedWithCrcError(@NonNull() BluetoothDevice device, @NonNull() Data data)Callback called when a CGM Specific Ops response was received with and incorrect E2E CRC. voidonContinuousGlucoseCommunicationIntervalReceived(@NonNull() BluetoothDevice device, int interval, boolean secured)Callback called as a result of 'Fet CGM communication interval' procedure. voidonContinuousGlucoseCalibrationValueReceived(@NonNull() BluetoothDevice device, float glucoseConcentrationOfCalibration, int calibrationTime, int nextCalibrationTime, int type, int sampleLocation, int calibrationDataRecordNumber, @NonNull() CGMTypes.CGMCalibrationStatus status, boolean secured)Callback called after a calibration value is received from the server. voidonContinuousGlucosePatientHighAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)Callback called when the Patient High Alert response was received. voidonContinuousGlucosePatientLowAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)Callback called when the Patient Low Alert response was received. voidonContinuousGlucoseHypoAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)Callback called when the Hypo Alert response was received. voidonContinuousGlucoseHyperAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)Callback called when the Hyper Alert response was received. voidonContinuousGlucoseRateOfDecreaseAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)Callback called when the Rate Of Decrease Alert response was received. voidonContinuousGlucoseRateOfIncreaseAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)Callback called when the Hyper Alert response was received. booleanisOperationCompleted()booleanisSecured()Returns true if the packet was secured with E2E CRC. booleanisCrcValid()Returns true if the packet was secured with E2E CRC value and the CRC was valid.In all other cases it returns false. voidwriteToParcel(@NonNull() Parcel dest, int flags)-
Methods inherited from class no.nordicsemi.android.ble.common.callback.cgm.CGMSpecificOpsControlPointDataCallback
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.cgm.CGMSpecificOpsControlPointCallback
onCGMSpecificOpsOperationCompleted, onCGMSpecificOpsOperationError, onCGMSpecificOpsResponseReceivedWithCrcError, onContinuousGlucoseCalibrationValueReceived, onContinuousGlucoseCommunicationIntervalReceived, onContinuousGlucoseHyperAlertReceived, onContinuousGlucoseHypoAlertReceived, onContinuousGlucosePatientHighAlertReceived, onContinuousGlucosePatientLowAlertReceived, onContinuousGlucoseRateOfDecreaseAlertReceived, onContinuousGlucoseRateOfIncreaseAlertReceived -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getRequestCode
int getRequestCode()
-
getErrorCode
int getErrorCode()
-
getGlucoseCommunicationInterval
int getGlucoseCommunicationInterval()
-
getGlucoseConcentrationOfCalibration
float getGlucoseConcentrationOfCalibration()
-
getCalibrationTime
int getCalibrationTime()
-
getNextCalibrationTime
int getNextCalibrationTime()
-
getType
int getType()
-
getSampleLocation
int getSampleLocation()
-
getCalibrationDataRecordNumber
int getCalibrationDataRecordNumber()
-
getCalibrationStatus
CGMTypes.CGMCalibrationStatus getCalibrationStatus()
-
getAlertLevel
float getAlertLevel()
-
onCGMSpecificOpsOperationCompleted
void onCGMSpecificOpsOperationCompleted(@NonNull() BluetoothDevice device, int requestCode, boolean secured)
Callback called when a CGM Specific Ops request has finished successfully.
- Parameters:
device- the target device.requestCode- the request code that has completed.secured- true, if the value received was secured with E2E-CRC value and theCRC matched the packet.
-
onCGMSpecificOpsOperationError
void onCGMSpecificOpsOperationError(@NonNull() BluetoothDevice device, int requestCode, int errorCode, boolean secured)
Callback called when a CGM Specific Ops request has failed.
- Parameters:
device- the target device.requestCode- the request code that has completed with an error.One of CGM_OP_CODE_* constants, or other if such was requested.errorCode- the received error code, see CGM_ERROR_* constants.secured- true, if the value received was secured with E2E-CRC value and theCRC matched the packet.
-
onCGMSpecificOpsResponseReceivedWithCrcError
void onCGMSpecificOpsResponseReceivedWithCrcError(@NonNull() BluetoothDevice device, @NonNull() Data data)
Callback called when a CGM Specific Ops response was received with and incorrect E2E CRC.
- Parameters:
device- the target device.data- the CGM Specific Ops packet data that was received, including the CRC field.
-
onContinuousGlucoseCommunicationIntervalReceived
void onContinuousGlucoseCommunicationIntervalReceived(@NonNull() BluetoothDevice device, int interval, boolean secured)
Callback called as a result of 'Fet CGM communication interval' procedure.
- Parameters:
device- the target device.interval- the time interval in minutes after which the CGM Measurement is sent tothe client.secured- true, if the value received was secured with E2E-CRC value andthe CRC matched the packet.
-
onContinuousGlucoseCalibrationValueReceived
void onContinuousGlucoseCalibrationValueReceived(@NonNull() BluetoothDevice device, float glucoseConcentrationOfCalibration, int calibrationTime, int nextCalibrationTime, int type, int sampleLocation, int calibrationDataRecordNumber, @NonNull() CGMTypes.CGMCalibrationStatus status, boolean secured)
Callback called after a calibration value is received from the server.
- Parameters:
device- the target device.glucoseConcentrationOfCalibration- the glucose concentration value is transmitted in mg/dL.calibrationTime- the time the calibration value has been measured asrelative offset to the Session Start Time in minutes.nextCalibrationTime- the relative offset to the Session Start Time when thenext calibration is required.type- the sample type, see TYPE_* constants.sampleLocation- the sample location, see SAMPLE_LOCATION_* constants.calibrationDataRecordNumber- a unique number of the calibration record.A value of 0 represents no calibration value is stored.status- the status of the calibration procedure of the Serverrelated to the Calibration Data Record.secured- true, if the value received was secured with E2E-CRCvalue and the CRC matched the packet.
-
onContinuousGlucosePatientHighAlertReceived
void onContinuousGlucosePatientHighAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)
Callback called when the Patient High Alert response was received.
- Parameters:
device- the target device.alertLevel- a level of glucose concentration in mg/dL to trigger the Patient High Alertin the Sensor Status Annunciation field.secured- true, if the value received was secured with E2E-CRCvalue and the CRC matched the packet.
-
onContinuousGlucosePatientLowAlertReceived
void onContinuousGlucosePatientLowAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)
Callback called when the Patient Low Alert response was received.
- Parameters:
device- the target device.alertLevel- a level of glucose concentration in mg/dL to trigger the Patient Low Alertin the Sensor Status Annunciation field.secured- true, if the value received was secured with E2E-CRCvalue and the CRC matched the packet.
-
onContinuousGlucoseHypoAlertReceived
void onContinuousGlucoseHypoAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)
Callback called when the Hypo Alert response was received.
- Parameters:
device- the target device.alertLevel- a level of glucose concentration in mg/dL to trigger the Hypo Alertin the Sensor Status Annunciation field.secured- true, if the value received was secured with E2E-CRCvalue and the CRC matched the packet.
-
onContinuousGlucoseHyperAlertReceived
void onContinuousGlucoseHyperAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)
Callback called when the Hyper Alert response was received.
- Parameters:
device- the target device.alertLevel- a level of glucose concentration in mg/dL to trigger the Hyper Alertin the Sensor Status Annunciation field.secured- true, if the value received was secured with E2E-CRCvalue and the CRC matched the packet.
-
onContinuousGlucoseRateOfDecreaseAlertReceived
void onContinuousGlucoseRateOfDecreaseAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)
Callback called when the Rate Of Decrease Alert response was received.
- Parameters:
device- the target device.alertLevel- a rate of glucose concentration change in mg/dL/min to trigger theRate Of Decrease Alert in the Sensor Status Annunciation field.secured- true, if the value received was secured with E2E-CRCvalue and the CRC matched the packet.
-
onContinuousGlucoseRateOfIncreaseAlertReceived
void onContinuousGlucoseRateOfIncreaseAlertReceived(@NonNull() BluetoothDevice device, float alertLevel, boolean secured)
Callback called when the Hyper Alert response was received.
- Parameters:
device- the target device.alertLevel- a rate of glucose concentration change in mg/dL/min to trigger theRate Of Increase Alert in the Sensor Status Annunciation field.secured- true, if the value received was secured with E2E-CRCvalue and the CRC matched the packet.
-
isOperationCompleted
boolean isOperationCompleted()
-
isSecured
boolean isSecured()
Returns true if the packet was secured with E2E CRC.See isCrcValid to check if the CRC was valid.
-
isCrcValid
boolean isCrcValid()
Returns true if the packet was secured with E2E CRC value and the CRC was valid.In all other cases it returns false.
-
writeToParcel
void writeToParcel(@NonNull() Parcel dest, int flags)
-
-
-
-