-
- All Implemented Interfaces:
-
io.reactivex.ObservableTransformer
@Deprecated() public class ConnectionSharingAdapter implements ObservableTransformer<RxBleConnection, RxBleConnection>
Observable transformer that can be used to share connection between many subscribers.
Example use:
UUID characteristicUUID = UUID.fromString("70a5bfcc-a0ec-4091-985e-d5506a31c921"); ObservableconnectionObservable = bleDevice .establishConnection(this, false) .compose(new ConnectionSharingAdapter()); connectionObservable .flatMap(rxBleConnection -> rxBleConnection.setupNotification(characteristicUUID)) .flatMap(notificationObservable -> notificationObservable) .subscribe(bytes -> { // React on characteristic changes }); connectionObservable .flatMap(rxBleConnection -> rxBleConnection.writeCharacteristic(characteristicUUID, "some text".getBytes())) .subscribe();
-
-
Method Summary
Modifier and Type Method Description ObservableSource<RxBleConnection>apply(Observable<RxBleConnection> upstream)-
-
Method Detail
-
apply
ObservableSource<RxBleConnection> apply(Observable<RxBleConnection> upstream)
-
-
-
-