-
- 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.DateTimeCallback
public abstract class DateTimeDataCallback extends ProfileReadResponse implements DateTimeCallback
Data callback that parses 7-byte value into a Calendar instance. If the value received is shorter than 7 bytes the onInvalidDataReceived callback will be called.
-
-
Constructor Summary
Constructors Constructor Description DateTimeDataCallback()
-
Method Summary
Modifier and Type Method Description voidonDataReceived(@NonNull() BluetoothDevice device, @NonNull() Data data)static CalendarreadDateTime(@NonNull() Data data, int offset)Returns a Gregorian Calendar object with YEAR, MONTH, DATE, HOUR, MINUTE, SECONDS set fromthe data at given offset using the Date Time characteristic format.MILLISECONDS are set to 0. -
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.DateTimeCallback
onDateTimeReceived -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onDataReceived
void onDataReceived(@NonNull() BluetoothDevice device, @NonNull() Data data)
-
readDateTime
@Nullable() static Calendar readDateTime(@NonNull() Data data, int offset)
Returns a Gregorian Calendar object with YEAR, MONTH, DATE, HOUR, MINUTE, SECONDS set fromthe data at given offset using the Date Time characteristic format.MILLISECONDS are set to 0. Time Zone and DST offset are from the local time zone.
If YEAR, MONTH or DATE are set to 0 in the data, the corresponding fields in the calendar are 'unset',that is
{@code calendar.isSet(Calendar.YEAR)}returns false.- Parameters:
data- input data (7 bytes required).offset- offset to read from.
-
-
-
-