I am trying to read from a characteristic and then write to the same characteristic, but was unable to figure out how. As a first step, I was trying to do multiple writes following this example:
connectionDisposable =
connectionObservable.flatMap(rxBleConnection -> {
return rxBleConnection.writeCharacteristic(SSID, bytes)
.flatMap(ssidBytes -> rxBleConnection.writeCharacteristic(SSID, bytes)
.flatMap(ssid2Bytes -> rxBleConnection.writeCharacteristic(SSID, bytes)));
})
.subscribe(ssid3Bytes -> {
//do something
}, this::onError, this::onComplete);
But I am getting the following error:
no instance(s) of type variable(s) R exist so that Single<R> conforms to ObservableSource<? extends R>
It would be great if someone can help me figure out how to do more than just one read or one write using RxAndroidBle.