Closed kazyh closed 4 years ago
It will also solve problem with double didDisconnect call (didDisconnect is called direct from bluefalcon disconnect method and it is called again when gattCallbeck.onConnectionStateChange notify about newState == STATE_DISCONNECTED ) .
If BluetoothGatt.close() would be called in disconnect method it will prevent from any callbacks from disconnected device.
ok sounds logical, i will look into it. - PR's always welcome.
Issue has been closed, please checkout release 0.7.2
It is propably only android issue
When calling connect and disconnect device several times during one app session GattCallbacks are aggregated and I get multiplied callbacks about characteristic changed.
This happens because in BluetoothGatt.connect (it is called by BluetoothDevice.connectGatt in BlueFalcon.connect) callback is registered. But BlueFalcon.disconnect method calling only BluetoothGatt.disconnect and should also call BluetoothGatt.close (in close() method callback is unregistered).