-
Notifications
You must be signed in to change notification settings - Fork 582
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
Modify behaviour of .observeConnectionStateChanges()
#50
Comments
Hey, you can use |
I was using This is why I was not informed by |
Anyway, when I removed unsubscribing from subscription on
The So |
@farmazon3000 I am revisiting this issue and I have an idea. This change would cause a need for further changes. Things to consider:
This is an invite for a discussion on how the feature should look like. |
.observeConnectionStateChanges()
A few thoughts from me. I think that status should reflect the library state of readiness when the DISCONNECTED is received it should be safe to establish the connection right away. I think the current implementation is a little bit too optimistic in terms when it is emitted. The correct logic is implemented within the |
Currently when the There is a difference between what |
I don't like this behaviour at all. It is inconsistent with what is actually happening and it is a reason of a lot of edge cases which need to be handled. Every subscription is asynchronous by nature and I don't see any need to immediately apply CONNECTING state when .establishConnection() is called. Does it help with anything? User could do that by himself if he needs it? |
Then we could have an opposite situation to:
The |
For me it would be acceptable, but I would like to hear feedback from other developers. |
I think CONNECTING would best be when For DISCONNECTED, I'd like to get that after the disconnect radio operation finishes. As noted, after |
That is true. Though in some situations the time distance between subscribing to |
…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.
`RxBleDevice.observeConnectionStateChanges()` emits only connection state 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.
Should be available in |
I'd like to react in my app when
RxBle#Radio: FINISHED
happened - because for example I'd like to inform my UI when device actually finshed disconnecting.Now, I believe, I can only unsubscribe from subscription on
RxBleDevice#establishConnection
and I don't know what happened later.The text was updated successfully, but these errors were encountered: