In RxAndroidBle, I want to set the MTU and then read a characteristic from the connection.
device
.establishConnection(false)
.flatMapSingle(conn -> conn.requestMtu(64))
.flatMapSingle(mtu -> <?>);
I'd like to then do a conn.readCharacteristic
, but I don't have a reference to conn
after raising the MTU.
I'm fairly new to RxJava2 so maybe I'm missing something at a conceptual level. Could anybody provide any insight here?
You can do it like that
device
.establishConnection(false)
.flatMapSingle(conn -> conn.requestMtu(64)
.flatMap(mtu -> conn.readCharacteristic()))