Package 

Class DateTimeDataCallback

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

    • Method Summary

      Modifier and Type Method Description
      void onDataReceived(@NonNull() BluetoothDevice device, @NonNull() Data data)
      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.
      • 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
    • Constructor Detail

      • DateTimeDataCallback

        DateTimeDataCallback()
    • Method Detail

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