What would be the recommended way of specifying a timeout for a connection or operation? Currently I use:
ConnectionObservable = mDevice
.establishConnection(mRxAppCompatActivity, false)
.timeout(DEFAULT_TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS)
But I get the impression that occasionally the subsequent automatic closing and disconnecting of the gatt is not always done properly, as I sometimes have trouble reconnecting to the same device after that.
Would something like
.takeUntil(disconnectTrigger)
with disconnectTrigger.onNext() being triggered manually after the timeout be more recommended?