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

[Feature]: Android: Get connection parameters #746

Open
savvn001 opened this issue Dec 29, 2023 · 6 comments
Open

[Feature]: Android: Get connection parameters #746

savvn001 opened this issue Dec 29, 2023 · 6 comments
Labels
feature Feature request

Comments

@savvn001
Copy link

FlutterBluePlus Version

1.31.2

Flutter Version

3.16.5

What OS?

All

OS Version

macOS

Bluetooth Module

.

What is your feature request?

It would be nice to have an API to be able to get some other current connection parameters other than MTU for the connected device, for example, connection interval, without having to dig down into the platform APIs. Would this be a fairly straightforward addition?

Logs

.
@savvn001 savvn001 added the feature Feature request label Dec 29, 2023
@chipweinberger
Copy link
Owner

chipweinberger commented Dec 29, 2023

not possible. android and ios don't expose this.

please link me the docs if i'm wrong.

@savvn001
Copy link
Author

Oh that's interesting. I just assumed they did. Have you used Nordic's nRF connect app for android? It seems to be able to log when connection parameters are changed, and show information like that. So it's maybe hooking on somehow. But I don't believe that particular app is open sourced.

@chipweinberger chipweinberger changed the title Get connection parameters [Feature]: [Feature]: Get connection parameters Jan 3, 2024
@savvn001
Copy link
Author

savvn001 commented Feb 9, 2024

On Android, I think is some kind of callback whenever the connection is updated:

I saw from my logs whilst debugging my app:

D/BluetoothGatt(13462): onConnectionUpdated() - Device=F0:0D:BE:EF:BB:11 interval=144 latency=0 timeout=400 status=0

There seems to be this onConnectionUpdated method in BluetoothGatt.java. See this https://stackoverflow.com/a/52757948

@chipweinberger
Copy link
Owner

chipweinberger commented Feb 9, 2024

interesting. never saw that before!

it's not in the documentation: https://developer.android.com/reference/android/bluetooth/BluetoothGattCallback

feel free to open a PR

@chipweinberger chipweinberger reopened this Feb 9, 2024
@chipweinberger chipweinberger changed the title [Feature]: Get connection parameters [Feature]: Android: Get connection parameters Feb 9, 2024
@savvn001
Copy link
Author

Yeah sure. If I get some time I can try to contribute that feature

@chipweinberger
Copy link
Owner

chipweinberger commented Feb 12, 2024

I mean, only if you need this feature.

otherwise we shouldn't add it if no one wants it.

Repository owner deleted a comment from elethiame Aug 29, 2024
Repository owner deleted a comment from bcliang Aug 29, 2024
Repository owner deleted a comment from bcliang Aug 29, 2024
Repository owner deleted a comment from bcliang Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request
Projects
None yet
Development

No branches or pull requests

2 participants