-
- All Implemented Interfaces:
-
com.polidea.rxandroidble2.RxBleCustomOperation
public interface RxBleRadioOperationCustom<T> implements RxBleCustomOperation<T>
-
-
Method Summary
Modifier and Type Method Description abstract Observable<T>asObservable(BluetoothGatt bluetoothGatt, RxBleGattCallback rxBleGattCallback, Scheduler scheduler)Return an observable that implement a custom radio operation using low-level Android BLE API. -
-
Method Detail
-
asObservable
@NonNull() abstract Observable<T> asObservable(BluetoothGatt bluetoothGatt, RxBleGattCallback rxBleGattCallback, Scheduler scheduler)
Return an observable that implement a custom radio operation using low-level Android BLE API.
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 observablereturned by queue
As the implementer, your contract is to return an Observable that completes at somepoint in time. When the returned observable terminates, either via the onComplete or onError callback, the ConnectionOperationQueue lock is released so thatqueue operations can continue.
You must ensure the returned Observable does terminate either via
{@code onCompleted}or{@code onError(Throwable)}. Otherwise, the internal queue orchestrator will wait forever foryour Observable to complete and the it will not continue to process queued operations.- Parameters:
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 operation
-
-
-
-