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

Adjusted RxBleDevice.observeConnectionStateChanges() behaviour #238

Conversation

dariuszseweryn
Copy link
Owner

#50
Previously RxBleDevice.observeConnectionStateChanges() was emitting immediately the initial state. The state was derived from user’s actions (i.e. CONNECTING was emitted right after user has subscribed to RxBleDevice.establishConnection()) rather than state in which the BluetoothGatt was. This behaviour has been changed to best reflect the state of BluetoothGatt at any given time.

…tate changes of the actual `BluetoothGatt`.

#50
Previously `RxBleDevice.observeConnectionStateChanges()` was emitting immediately the initial state. The state was derived from user’s actions (i.e. `CONNECTING` was emitted right after user has subscribed to `RxBleDevice.establishConnection()`) rather than state in which the `BluetoothGatt` was. This behaviour has been changed to best reflect the state of `BluetoothGatt` at any given time.
@dariuszseweryn dariuszseweryn requested a review from uKL June 29, 2017 14:28
@dariuszseweryn dariuszseweryn self-assigned this Jun 29, 2017
@dariuszseweryn dariuszseweryn added this to the 1.4.0 milestone Jun 29, 2017
@@ -48,12 +50,14 @@ public Builder(
BleConnectionCompat connectionCompat,
RxBleGattCallback rxBleGattCallback,
@Named(CONNECT_TIMEOUT) TimeoutConfiguration connectionTimeout,
BluetoothGattProvider bluetoothGattProvider) {
BluetoothGattProvider bluetoothGattProvider,
Action1<RxBleConnection.RxBleConnectionState> connectionStateChangedAction) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really declarative that we inject Action1<RxBleConnection.RxBleConnectionState> here. Can we have it wrapped in a custom interface saying that this is a connection state dispatcher?

Looking from a test/user perspective it wouldn't say much about this parameter.

…n_state_beahviour_change

# Conflicts:
#	CHANGELOG.md
@dariuszseweryn dariuszseweryn merged commit c3570cb into develop Jul 4, 2017
@dariuszseweryn dariuszseweryn deleted the feature/issue_50_device_observe_connection_state_beahviour_change branch July 4, 2017 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants