-
Notifications
You must be signed in to change notification settings - Fork 588
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
Introduce getConnectedPeripherals
to allow existing connections to be retrieved
#765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Who knows for how long I thought about adding this functionality. Few minors that you could adjust and its ready to go
...roidble/src/main/java/com/polidea/rxandroidble2/internal/util/RxBluetoothManagerWrapper.java
Outdated
Show resolved
Hide resolved
...roidble/src/main/java/com/polidea/rxandroidble2/internal/util/RxBluetoothManagerWrapper.java
Outdated
Show resolved
Hide resolved
rxandroidble/src/test/groovy/com/polidea/rxandroidble2/MockRxBluetoothManagerWrapper.groovy
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will merge this after #770 to have potential conflicts in the smaller PR
rxandroidble/src/main/java/com/polidea/rxandroidble2/RxBleClientImpl.java
Outdated
Show resolved
Hide resolved
…ntImpl.java Co-authored-by: Dariusz Seweryn <dariusz.seweryn@gmail.com>
@dariuszseweryn Nice to hear - Sorry for re-re-requesting, I only just noticed that you had re-reviewed. Must have had a cached page. |
getConnectedDevices
to allow existing connections to be retrievedgetConnectedPeripherals
to allow existing connections to be retrieved
I decided to fork this project so we can maintain it more actively and merge the PRs we had open. I've forked at https://github.com/NRB-Tech/RxAndroidBle/ and it's on Maven Central as io.nrbtech.rxandroidble. I've merged this PR there. |
Sorry for such a long wait. I did took some time off and forgot to rewire email notifications so I missed a lot of events here |
Thanks @dariuszseweryn. However as I've now put effort into forking and upgrading the library further, I intend to continue to maintain the fork. As I've changed the namespace it would be difficult to create PRs or merge into this repo but you are welcome to if you want. I'll keep an eye on developments here. Thanks for creating RxAndroidBle! |
Sure thing! I recon you did put effort in the fork and I cannot ask you to leave it nor I want to — no hard feelings on my side. I would like to express my apology for my disappearance without notice and thank you again for your help. Good luck! |
Currently, there's no way to retrieve existing connected devices within the system. This PR introduces the capability, enhancing that use-case.
It would also allow https://github.com/dotintent/MultiPlatformBleAdapter to behave consistently across platforms, which it is currently not doing, and hence it could also bleed over to e.g.
react-native-ble-plx
(of which we are users)Documentation for the Android methods are here:
https://developer.android.com/reference/android/bluetooth/BluetoothManager#getConnectedDevices(int)
I've also taken the liberty to create a BluetoothManager wrapper, albeit it's not consistently implemented across all classes within the internal library.
Last note, I couldn't run the tests for some reason, but I've ran the sample application with some dummy code verifying that it compiles and also functions as intended.