LenhartStephan / flutter_blue_classic

A Bluetooth Classic Plugin for Flutter
https://pub.dev/packages/flutter_blue_classic
GNU General Public License v3.0
5 stars 2 forks source link

Reconnect function #3

Closed Zacktamondo closed 3 months ago

Zacktamondo commented 4 months ago

Hello, First of all, thanks for the amazing package. Is it possible to make a reconnect function that I can pass the same connection to it and simply reconnect without the need to make a new connection.

LenhartStephan commented 3 months ago

I don't think such a function would be possible, because as soon as you close the connection, Android releases any system resources associated with it. See [Android developer: BluetoothSocket close()](https://developer.android.com/reference/android/bluetooth/BluetoothSocket#close()). So to re-establish a connection, you would need to create a new connection and call connect with the given MAC-Address again.

LenhartStephan commented 3 months ago

If you have other thoughts or suggestions regarding this, please feel free to reopen this issue.