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

Observable emitted from RxBleConnection.setupNotification()/RxBleConnection.setupIndication() does not complete #231

Closed
dariuszseweryn opened this issue Jun 23, 2017 · 2 comments
Assignees
Labels
bug Bug that is caused by the library
Milestone

Comments

@dariuszseweryn
Copy link
Owner

dariuszseweryn commented Jun 23, 2017

Summary

Currently when the user will unsubscribe from .setupNotification()/.setupIndication() the notification/indication is teardown but the (possibly) emitted Observable<byte[]> does not complete.
Similarly when the RxBleConnection terminates the emitted Observable<byte[]> does not throw an error.

Library version

1.3.1

Steps to reproduce actual result


1. Connect to a device

2. Setup notification (or indication)

3. Wait for it being setup

4. Get emitted Observable<byte[]>

5. Un-subscribe from the .setup*()

6. Observe that emitted Observable<byte[]> has not completed

Minimum code snippet reproducing the issue

rxBleDevice.establishConnection(false)
                .flatMap(connection -> connection.setupNotification(characteristicUuid)
                        .takeUntil(Observable.timer(15, TimeUnit.SECONDS))
                        .flatMap(observable -> observable)
                        .doOnCompleted(() -> Log.d("SHOULD", "COMPLETE"))
                )
                .subscribe();

Actual result

SHOULD COMPLETE is not logged after 15 seconds from the notification setup.

Expected result

SHOULD COMPLETE should be logged after 15 seconds from the notification setup.

@dariuszseweryn dariuszseweryn added the bug Bug that is caused by the library label Jun 23, 2017
@dariuszseweryn dariuszseweryn changed the title Observable emitted from RxBleConnection.setupNotification()/RxBleConnection.setupIndication() does not com Observable emitted from RxBleConnection.setupNotification()/RxBleConnection.setupIndication() does not complete Jun 23, 2017
@dariuszseweryn dariuszseweryn changed the title Observable emitted from RxBleConnection.setupNotification()/RxBleConnection.setupIndication() does not complete Observable emitted from RxBleConnection.setupNotification()/RxBleConnection.setupIndication() does not terminate Jun 23, 2017
@dariuszseweryn dariuszseweryn self-assigned this Jun 23, 2017
@dariuszseweryn dariuszseweryn added this to the 1.3.2 milestone Jun 23, 2017
@RobLewis
Copy link

Haven't thought this through, but will this fix require any changes to ConnectionSharingAdapter?

@dariuszseweryn
Copy link
Owner Author

@RobLewis No.

@dariuszseweryn dariuszseweryn changed the title Observable emitted from RxBleConnection.setupNotification()/RxBleConnection.setupIndication() does not terminate Observable emitted from RxBleConnection.setupNotification()/RxBleConnection.setupIndication() does not complete Jun 26, 2017
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

2 participants