Skip to content
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

Disconnection error is not properly routed #297

Closed
dariuszseweryn opened this issue Oct 24, 2017 · 0 comments
Closed

Disconnection error is not properly routed #297

dariuszseweryn opened this issue Oct 24, 2017 · 0 comments
Assignees
Labels
bug Bug that is caused by the library
Milestone

Comments

@dariuszseweryn
Copy link
Owner

Summary

When a connection error happens the ConnectionOperationQueue is always terminated with the BleDisconnectedException even when a different error has caused the disconnection

Library version

1.4.1

Steps to reproduce actual result


1. Connect to a device

2. Make the BluetoothGattCallback.onConnectionStateChange() to be called with status!=GATT_SUCCESS so the operation would fail with BleGattException(status, ON_CONNECTION_STATE)

3. Try to schedule a new operation and observe it will fail with BleDisconnectedException instead of the error from Step 2.

Actual result

BleDisconnectedException

Expected result

BleGattException

@dariuszseweryn dariuszseweryn added the bug Bug that is caused by the library label Oct 24, 2017
@dariuszseweryn dariuszseweryn added this to the 1.4.2 milestone Oct 24, 2017
@dariuszseweryn dariuszseweryn self-assigned this Oct 24, 2017
dariuszseweryn added a commit that referenced this issue Oct 24, 2017
As long as the user is interested in the connection the `ConnectionOperationQueue` will check the `DisconnectionRouterOutput` for exceptions that cause disconnection. If this exception is emitted the `ConnectionOperationQueue` terminates itself with the emitted error. If the user unsubscribes from the `RxBleDevice.establishConnection()` then the `ConnectionOperationQueue` terminates itself with the `BleDisconnectedException` as it was before this change.
dariuszseweryn added a commit that referenced this issue Oct 25, 2017
Terminate ConnectionOperationQueue with proper exception
As long as the user is interested in the connection the `ConnectionOperationQueue` will check the `DisconnectionRouterOutput` for exceptions that cause disconnection. If this exception is emitted the `ConnectionOperationQueue` terminates itself with the emitted error. If the user unsubscribes from the `RxBleDevice.establishConnection()` then the `ConnectionOperationQueue` terminates itself with the `BleDisconnectedException` as it was before this change. Fix #297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that is caused by the library
Projects
None yet
Development

No branches or pull requests

1 participant