-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exceptions #33
Comments
Please fix problem with "UndeliverableException". I recive this error if use dispose before connect to device with error. |
Maybe replace onError to tryOnError |
Use 'RxJavaPlugins.setErrorHandler()` fun connect(){
rxBluetooth.observeConnectionState()
.filter { it.state == BluetoothAdapter.STATE_CONNECTED }
.subscribe(
{ onConnected() },
{ it.printStackTrace() })
rxBluetooth.observeConnectionState()
.filter { it.state == BluetoothAdapter.STATE_DISCONNECTED }
.subscribe(
{ onDisconnected() },
{ it.printStackTrace() })
}
fun onConnected() {
readDisposable = bluetoothConnection.observeByteStream()
.subscribeOn(Schedulers.computation())
.subscribe(
{
// do something
},
{ it.printStackTrace() })
bluetoothConnection.send("111")
}
fun onDisconnected(){
readDisposable.dispose()
} then go to Bluetooth setup on phone -> tap connected device -> disconnect -> power off device -> app crash
so I add |
Hi! I have problem with next:
I do close connect with BluetoothConnection and recive next exception to RX onError ->
com.github.ivbaranov.rxbluetooth.exceptions.ConnectionClosedException Can't read stream
at com.github.ivbaranov.rxbluetooth.BluetoothConnection$1.subscribe(BluetoothConnection.java88)
at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java72)
at io.reactivex.Flowable.subscribe(Flowable.java13234)
at io.reactivex.internal.operators.flowable.FlowablePublish.connect(FlowablePublish.java130)
at io.reactivex.internal.operators.flowable.FlowableRefCount.subscribeActual(FlowableRefCount.java138)
at io.reactivex.Flowable.subscribe(Flowable.java13234)
at io.reactivex.Flowable.subscribe(Flowable.java13183)
at io.reactivex.internal.operators.flowable.FlowableLift.subscribeActual(FlowableLift.java49)
at io.reactivex.Flowable.subscribe(Flowable.java13234)
at io.reactivex.internal.operators.flowable.FlowableOnBackpressureBuffer.subscribeActual(FlowableOnBackpressureBuffer.java46)
at io.reactivex.Flowable.subscribe(Flowable.java13234)
I do dispose to observeStringStream
I again received above error in main thread.
The text was updated successfully, but these errors were encountered: