asRx2
A helper function to wrap a MavConnection as an Rx2MavConnection. The returned Rx2MavConnection uses the provided scheduler to perform the IO operations of reading and sending the messages.
fun MavConnection.asRx2(scheduler: Scheduler = Schedulers.io(), onFailure: Rx2MavConnection.() -> Unit = {}): Rx2MavConnection
Deprecated
Rx2MavConnection with onFailure callback is deprecated and will be removed in the future releases. For checking the states including failure, use Rx2MavConnection.streamState.
Replace with
import com.divpundir.mavlink.adapters.rxjava2.asRx2
Content copied to clipboard
asRx2(scheduler)
Content copied to clipboard
A helper function to wrap a MavConnection as an Rx2MavConnection. The returned Rx2MavConnection uses the provided scheduler to perform the IO operations of reading and sending the messages. The onFailure callback is invoked when an exception is thrown while reading the messages. This can be used to implement a custom reconnection strategy.