T - The type of emitted result.public abstract class SingleResponseOperation<T> extends QueueOperation<T>
BluetoothGatt functions that fire one-time actions.| Constructor and Description |
|---|
SingleResponseOperation(android.bluetooth.BluetoothGatt bluetoothGatt,
RxBleGattCallback rxBleGattCallback,
BleGattOperationType gattOperationType,
TimeoutConfiguration timeoutConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract <any> |
getCallback(RxBleGattCallback rxBleGattCallback)
A function that should return
Observable derived from the passed RxBleGattCallback. |
protected void |
protectedRun(<any> emitter,
QueueReleaseInterface queueReleaseInterface)
This method must be overridden in a concrete operation implementations and should contain specific operation logic.
|
protected BleException |
provideException(android.os.DeadObjectException deadObjectException)
This function will be overridden in concrete operation implementations to provide an exception with needed context
|
protected abstract boolean |
startOperation(android.bluetooth.BluetoothGatt bluetoothGatt)
A function that should call the passed
BluetoothGatt and return `true` if the call has succeeded. |
protected <any> |
timeoutFallbackProcedure(android.bluetooth.BluetoothGatt bluetoothGatt,
RxBleGattCallback rxBleGattCallback,
Scheduler timeoutScheduler) |
java.lang.String |
toString() |
compareTo, definedPriority, runpublic SingleResponseOperation(android.bluetooth.BluetoothGatt bluetoothGatt,
RxBleGattCallback rxBleGattCallback,
BleGattOperationType gattOperationType,
TimeoutConfiguration timeoutConfiguration)
protected final void protectedRun(<any> emitter,
QueueReleaseInterface queueReleaseInterface)
throws java.lang.Throwable
QueueOperationQueueReleaseInterface.release() at appropriate point to release the queue for any other operations
that are queued.
If the emitter is cancelled, a responsibility of the operation is to call QueueReleaseInterface.release(). The radio
should be released as soon as the operation decides it won't interact with the BluetoothGatt anymore and
subsequent operations will be able to start. Check usage of QueueReleasingEmitterWrapper for convenience.protectedRun in class QueueOperation<T>emitter - the emitter to be called in order to inform the caller about the output of a particular run of the operationqueueReleaseInterface - the queue release interface to release the queue when readyjava.lang.Throwableprotected abstract <any> getCallback(RxBleGattCallback rxBleGattCallback)
Observable derived from the passed RxBleGattCallback.
The returned Observable will be automatically unsubscribed after the first emission.
The returned Observable is a subject to Observable#timeout(long, TimeUnit, Scheduler, io.reactivex.ObservableSource)
and by default it will throw BleGattCallbackTimeoutException. This behaviour can be overridden by overriding
timeoutFallbackProcedure(BluetoothGatt, RxBleGattCallback, Scheduler).rxBleGattCallback - the RxBleGattCallback to useprotected abstract boolean startOperation(android.bluetooth.BluetoothGatt bluetoothGatt)
BluetoothGatt and return `true` if the call has succeeded.bluetoothGatt - the BluetoothGatt to useprotected <any> timeoutFallbackProcedure(android.bluetooth.BluetoothGatt bluetoothGatt,
RxBleGattCallback rxBleGattCallback,
Scheduler timeoutScheduler)
protected BleException provideException(android.os.DeadObjectException deadObjectException)
QueueOperationprovideException in class QueueOperation<T>deadObjectException - the cause for the exceptionpublic java.lang.String toString()
toString in class java.lang.Object