public abstract class AwaitingRequest<T> extends TimeoutableValueRequest<T>
timeouthandler, requestHandler| Modifier and Type | Method and Description |
|---|---|
<E extends T> |
await(E response)
Synchronously waits until the request is done.
|
AwaitingRequest<T> |
trigger(Operation trigger)
Sets an optional request that is suppose to trigger the notification or indication.
|
await, await, await, timeout, withawait, await, enqueue, enqueue, setHandlerbefore, 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@NonNull public AwaitingRequest<T> trigger(@NonNull Operation trigger)
trigger - the operation that triggers the notification, usually a write characteristic
request that write some OP CODE.@NonNull public <E extends T> E await(@NonNull E response) throws RequestFailedException, DeviceDisconnectedException, BluetoothDisabledException, InvalidRequestException, java.lang.InterruptedException
TimeoutableValueRequest
When the timeout, set with TimeoutableValueRequest.timeout(long) occurs, the InterruptedException
will be thrown.
Callbacks set using Request.done(SuccessCallback) and Request.fail(FailCallback) and
#with(E) will be ignored.
This method may not be called from the main (UI) thread.
await in class TimeoutableValueRequest<T>E - a response class.response - the response object.RequestFailedException - thrown when the BLE request finished with status other
than BluetoothGatt.GATT_SUCCESS.DeviceDisconnectedException - thrown when the device disconnected before the request
was completed.BluetoothDisabledException - thrown when the Bluetooth adapter is disabled.InvalidRequestException - thrown when the request was called before the device was
connected at least once (unknown device).java.lang.InterruptedException - thrown if the timeout occurred before the request has
finished.