dotintent / FlutterBleLib

Bluetooth Low Energy library for Flutter with support for simulating peripherals
Apache License 2.0
531 stars 195 forks source link

Automatically reconnect on Gatt status 19 #573

Closed VSL-V closed 3 years ago

VSL-V commented 3 years ago

I'm currently trying to implement a BLE Handling for a Flutter App to handle communication with some IoT Devices.

The Gatt Server of those Devices automatically sends status 19 (Connection closed by peripheral) after a few seconds

Now I ran into some issues with that because if I disconnect and reconnect using the library, the data on services and characteristics gets lost, but there is not enough time to discover the characteristics, set up a monitor for the characteristic I get an indication for and write data to the characteristic.

So I am wondering if there is any possibility to not have to go through the whole process and instead store the data across multiple connects/disconnects.

Thank you

mikolak commented 3 years ago

Adding a response for future generations: discovery is a system requirement upon establishing a connection, it has to always be done after connection.