Package 

Class CGMStatusResponse

  • 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.CGMStatusCallback , no.nordicsemi.android.ble.common.profile.cgm.CGMTypes , no.nordicsemi.android.ble.common.profile.glucose.GlucoseTypes

    
    public final class CGMStatusResponse
    extends CGMStatusDataCallback 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 {
        CGMStatusResponse response = readCharacteristic(characteristic)
              .awaitValid(CGMStatusResponse.class);
        CGMStatus status = response.getStatus();
        if (status != 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());
    }
    
    • Method Summary

      Modifier and Type Method Description
      CGMTypes.CGMStatus getStatus()
      int getTimeOffset()
      void onContinuousGlucoseMonitorStatusChanged(@NonNull() BluetoothDevice device, @NonNull() CGMTypes.CGMStatus status, int timeOffset, boolean secured) Callback called whenever the CGM Status characteristic was read..
      void onContinuousGlucoseMonitorStatusReceivedWithCrcError(@NonNull() BluetoothDevice device, @NonNull() Data data) Callback called when a CGM packet with E2E field was received but the CRC check has failed.
      boolean isSecured() Returns true if the packet was secured with E2E CRC.
      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.
      void writeToParcel(@NonNull() Parcel dest, int flags)
      • Methods inherited from class no.nordicsemi.android.ble.common.callback.cgm.CGMStatusDataCallback

        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.CGMStatusCallback

        onContinuousGlucoseMonitorStatusChanged, onContinuousGlucoseMonitorStatusReceivedWithCrcError
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait