-
- 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.CGMSessionStartTimeCallback
public final class CGMSessionStartTimeResponse extends CGMSessionStartTimeDataCallback 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 { CGMSessionStartTimeResponse response = readCharacteristic(characteristic) .awaitValid(CGMSessionStartTimeResponse.class); Calendar startTime = response.getStartTime(); ... } 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 CalendarstartTimepublic final static Parcelable.Creator<CGMSessionStartTimeResponse>CREATOR
-
Constructor Summary
Constructors Constructor Description CGMSessionStartTimeResponse()
-
Method Summary
Modifier and Type Method Description CalendargetStartTime()voidonContinuousGlucoseMonitorSessionStartTimeReceived(@NonNull() BluetoothDevice device, @NonNull() Calendar calendar, boolean secured)Callback called whenever the CGM Session Start Time characteristic was read. voidonContinuousGlucoseMonitorSessionStartTimeReceivedWithCrcError(@NonNull() BluetoothDevice device, @NonNull() Data data)Callback called when a CGM Session Start Time packet with E2E field was received but theCRC check has failed. 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.CGMSessionStartTimeDataCallback
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.CGMSessionStartTimeCallback
onContinuousGlucoseMonitorSessionStartTimeReceived, onContinuousGlucoseMonitorSessionStartTimeReceivedWithCrcError -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getStartTime
Calendar getStartTime()
-
onContinuousGlucoseMonitorSessionStartTimeReceived
void onContinuousGlucoseMonitorSessionStartTimeReceived(@NonNull() BluetoothDevice device, @NonNull() Calendar calendar, boolean secured)
Callback called whenever the CGM Session Start Time characteristic was read.
If the E2E CRC field was present in the CGM packet, the data has been verified against it.If CRC check has failed, the onContinuousGlucoseMonitorSessionStartTimeReceivedWithCrcError will be called instead.
- Parameters:
device- the target device.calendar- the date and time received, as Calendar object.Time zone and DST offset are included in the calendar.secured- true if the packet was sent with E2E-CRC value that was verified tomatch the packet, false if the packet didn't contain CRC field.
-
onContinuousGlucoseMonitorSessionStartTimeReceivedWithCrcError
void onContinuousGlucoseMonitorSessionStartTimeReceivedWithCrcError(@NonNull() BluetoothDevice device, @NonNull() Data data)
Callback called when a CGM Session Start Time packet with E2E field was received but theCRC check has failed.
- Parameters:
device- the target device.data- the CGM Session Start Time packet data that was received, including theCRC field.
-
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)
-
-
-
-