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

Introduce getConnectedPeripherals to allow existing connections to be retrieved #765

Merged
merged 9 commits into from
May 21, 2022

Conversation

DaBs
Copy link
Contributor

@DaBs DaBs commented Nov 3, 2021

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.

@CLAassistant
Copy link

CLAassistant commented Nov 3, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Owner

@dariuszseweryn dariuszseweryn left a 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

Copy link
Owner

@dariuszseweryn dariuszseweryn left a 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

@DaBs DaBs requested a review from dariuszseweryn November 15, 2021 23:01
…ntImpl.java

Co-authored-by: Dariusz Seweryn <dariusz.seweryn@gmail.com>
@DaBs
Copy link
Contributor Author

DaBs commented Nov 15, 2021

@dariuszseweryn Nice to hear - Sorry for re-re-requesting, I only just noticed that you had re-reviewed. Must have had a cached page.

@DaBs DaBs changed the title Introduce getConnectedDevices to allow existing connections to be retrieved Introduce getConnectedPeripherals to allow existing connections to be retrieved Nov 23, 2021
@nrbrook
Copy link
Contributor

nrbrook commented Mar 26, 2022

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.

@dariuszseweryn dariuszseweryn merged commit 15987fd into dariuszseweryn:master May 21, 2022
@dariuszseweryn
Copy link
Owner

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

@nrbrook
Copy link
Contributor

nrbrook commented May 21, 2022

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!

@dariuszseweryn
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants