public interface RxBleRadioOperationCustom<T> extends RxBleCustomOperation<T>
| Modifier and Type | Method and Description |
|---|---|
<any> |
asObservable(android.bluetooth.BluetoothGatt bluetoothGatt,
RxBleGattCallback rxBleGattCallback,
Scheduler scheduler)
Deprecated.
Return an observable that implement a custom radio operation using low-level Android BLE API.
|
<any> asObservable(android.bluetooth.BluetoothGatt bluetoothGatt,
RxBleGattCallback rxBleGattCallback,
Scheduler scheduler)
throws java.lang.Throwable
The Observable returned by this method will be subscribed to by the ConnectionOperationQueue
when it determines that the custom operation should be the next to be run.
The method receives everything needed to access the low-level Android BLE API objects mainly the
BluetoothGatt to interact with Android BLE GATT operations and RxBleGattCallback
to be notified when GATT operations completes.
Every event emitted by the returned Observable will be forwarded to the observable
returned by RxBleConnection.queue(RxBleCustomOperation)
As the implementer, your contract is to return an Observable that completes at some
point in time. When the returned observable terminates, either via the Observer#onComplete() or
Observer#onError(Throwable) callback, the ConnectionOperationQueue lock is released so that
queue operations can continue.
You must ensure the returned Observable does terminate either via onCompleted
or onError(Throwable). Otherwise, the internal queue orchestrator will wait forever for
your Observable to complete and the it will not continue to process queued operations.
asObservable in interface RxBleCustomOperation<T>bluetoothGatt - The Android API GATT instancerxBleGattCallback - The internal Rx ready bluetooth gatt callback to be notified of GATT operationsscheduler - The RxBleRadio scheduler used to asObservable operationjava.lang.Throwable - Any exception that your custom operation might throw