Package 

Class TimeoutableValueRequest

    • Method Summary

      Modifier and Type Method Description
      TimeoutableValueRequest<T> timeout(@IntRange(from = 0) long timeout) Sets the operation timeout.
      TimeoutableValueRequest<T> with(@NonNull() T callback) Sets the value callback.
      <E extends T> E await(@NonNull() E response) Synchronously waits until the request is done.
      <E extends T> E await(@NonNull() Class<E> responseClass) Synchronously waits until the request is done.
      <E extends T> E await(@NonNull() Class<E> responseClass, @IntRange(from = 0) long timeout) Synchronously waits until the request is done, for at most given number of millisecondsafter which the InterruptedException will be thrown.
      <E extends T> E await(@NonNull() E response, @IntRange(from = 0) long timeout) Synchronously waits until the request is done, for at most given number of millisecondsafter which the InterruptedException will be thrown.
      • Methods inherited from class no.nordicsemi.android.ble.TimeoutableRequest

        await, await, cancel, enqueue, enqueue, isCancelled, setHandler, timeout
      • Methods inherited from class no.nordicsemi.android.ble.Request

        before, createBond, done, fail, invalid, newConnectionPriorityRequest, newDisableBatteryLevelNotificationsRequest, newDisableIndicationsRequest, newDisableNotificationsRequest, newEnableBatteryLevelNotificationsRequest, newEnableIndicationsRequest, newEnableNotificationsRequest, newMtuRequest, newReadBatteryLevelRequest, newReadPhyRequest, newReadRequest, newReadRequest, newReadRssiRequest, newRefreshCacheRequest, newSetPreferredPhyRequest, newSleepRequest, newWaitForIndicationRequest, newWaitForNotificationRequest, newWriteRequest, newWriteRequest, newWriteRequest, newWriteRequest, newWriteRequest, newWriteRequest, removeBond, setHandler, then
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • timeout

        @NonNull() TimeoutableValueRequest<T> timeout(@IntRange(from = 0) long timeout)

        Sets the operation timeout.When the timeout occurs, the request will fail with REASON_TIMEOUT.

        Parameters:
        timeout - the request timeout in milliseconds, 0 to disable timeout.
      • with

        @NonNull() TimeoutableValueRequest<T> with(@NonNull() T callback)

        Sets the value callback. When the request is invoked synchronously, this callback willbe ignored and the received value will be returned by the await(...) method;

        Parameters:
        callback - the callback.
      • await

        @NonNull() <E extends T> E await(@NonNull() E response)

        Synchronously waits until the request is done.

        When the timeout, set with timeout occurs, the InterruptedException will be thrown.

        Callbacks set using done and fail and with will be ignored.

        This method may not be called from the main (UI) thread.

        Parameters:
        response - the response object.
      • await

        @NonNull() <E extends T> E await(@NonNull() Class<E> responseClass)

        Synchronously waits until the request is done.

        Callbacks set using done and fail and with will be ignored.

        This method may not be called from the main (UI) thread.

        Parameters:
        responseClass - the response class.
      • await

        @NonNull()@Deprecated() <E extends T> E await(@NonNull() Class<E> responseClass, @IntRange(from = 0) long timeout)

        Synchronously waits until the request is done, for at most given number of millisecondsafter which the InterruptedException will be thrown.

        Callbacks set using done, fail and with will be ignored.

        This method may not be called from the main (UI) thread.

        Parameters:
        responseClass - the response class.
        timeout - optional timeout in milliseconds.
      • await

        @NonNull()@Deprecated() <E extends T> E await(@NonNull() E response, @IntRange(from = 0) long timeout)

        Synchronously waits until the request is done, for at most given number of millisecondsafter which the InterruptedException will be thrown.

        Callbacks set using done, fail and with will be ignored.

        This method may not be called from the main (UI) thread.

        Parameters:
        response - the response object.
        timeout - optional timeout in milliseconds.