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

[Help]: Unable to disconnect cached connection #678

Closed
1 task done
mengzhidaren opened this issue Nov 13, 2023 · 2 comments
Closed
1 task done

[Help]: Unable to disconnect cached connection #678

mengzhidaren opened this issue Nov 13, 2023 · 2 comments
Labels
help Questions, help, observations, or possible bugs

Comments

@mengzhidaren
Copy link

mengzhidaren commented Nov 13, 2023

Requirements

  • I've looked at the README 'Common Problems' section

Have you checked this problem on the example app?

No

FlutterBluePlus Version

1.28.10

Flutter Version

Flutter 3.13.9

What OS?

Android

OS Version

android9

Bluetooth Module

none

What is your problem?

Question 1:

 final cache = await FlutterBluePlus.systemDevices
 for (var element in cache) {
 //await element.disconnect(queue: true);
 await element.disconnect(queue: false);
}

Unable to disconnect cached connection

Question 2:
If connecting a cache device:

 final cache = await FlutterBluePlus.systemDevices
 for (var element in cache) {
element .connect()......
//....
await characteristic.setNotifyValue(true)
characteristic.onValueReceived.listen(e){
//There will be duplicate callback data here
//The device's callback will send the same data twice each time
}
}

Logs

no
@mengzhidaren mengzhidaren added the bug Something isn't working label Nov 13, 2023
@chipweinberger
Copy link
Collaborator

chipweinberger commented Nov 13, 2023

for question 1. you are correct. Those devices are not connected to your app. you cannot disconnect them. You can try connecting then disconnecting, im not sure what will happen tbh.

for question 2, see README. duplicate data is common problem.

@mengzhidaren
Copy link
Author

Thank you so much

@chipweinberger chipweinberger changed the title [Bug]: Unable to disconnect cached connection [Help]: Unable to disconnect cached connection Jan 4, 2024
@chipweinberger chipweinberger added help Questions, help, observations, or possible bugs and removed bug Something isn't working labels Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help Questions, help, observations, or possible bugs
Projects
None yet
Development

No branches or pull requests

2 participants