I have an issue with the connection(with bonding) between two android devices using the Bluetooth Low Energy. On both devices I'm running Android 8.0. The problem is the following. When I establish the connection between both devices, everything works fine but after closing the BLE server(and open it again) I am not able to reconnect from the client. The only way so far is deleting the bonding information from the client. However this is not comfortable at all. Is there a way to reestablish the connection without deleting the bonding manually? For example, resetting some flag from the BLE protocol or something. Also, I have a short output from the connection process:
1970-01-04 05:36:10.158 5254-5348/ D/BluetoothGatt: onClientRegistered() - status=0 clientIf=6
1970-01-04 05:36:10.164 5254-5348/ D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=7C:92:B3:23:C0:19
1970-01-04 05:36:10.164 5254-5348/ I/info: ######## CURRENT BLE STATUS: 0 [DISCONNECTED]
1970-01-04 05:36:10.164 5254-5348/ I/info: ######## NEW BLE STATUS: 2 [CONNECTED]
1970-01-04 05:36:10.164 5254-5348/ D/BluetoothGatt: configureMTU() - device: 7C:92:B3:23:C0:19 mtu: 482
1970-01-04 05:36:10.238 5254-5348/ D/BluetoothGattServer: onConnectionUpdated() - Device=7C:92:B3:23:C0:19 interval=39 latency=0 timeout=500 status=42
1970-01-04 05:36:10.239 5254-5268/ D/BluetoothGatt: onConnectionUpdated() - Device=7C:92:B3:23:C0:19 interval=39 latency=0 timeout=500 status=42
1970-01-04 05:36:11.164 5254-5348/ D/BluetoothGatt: onConfigureMTU() - Device=7C:92:B3:23:C0:19 mtu=482 status=0
1970-01-04 05:36:11.165 5254-5348/ D/BluetoothGatt: requestConnectionPriority() - params: 1
1970-01-04 05:36:11.360 5254-5348/ D/BluetoothGattServer: onConnectionUpdated() - Device=7C:92:B3:23:C0:19 interval=39 latency=0 timeout=500 status=0
1970-01-04 05:36:11.361 5254-5268/ D/BluetoothGatt: onConnectionUpdated() - Device=7C:92:B3:23:C0:19 interval=39 latency=0 timeout=500 status=0
1970-01-04 05:36:11.793 5254-5348/ D/BluetoothGatt: onConnectionUpdated() - Device=7C:92:B3:23:C0:19 interval=12 latency=0 timeout=2000 status=0
1970-01-04 05:36:11.793 5254-5268/ D/BluetoothGattServer: onConnectionUpdated() - Device=7C:92:B3:23:C0:19 interval=12 latency=0 timeout=2000 status=0
1970-01-04 05:36:13.353 5254-5348/ D/BluetoothGattServer: onServerConnectionState() - status=0 serverIf=5 device=7C:92:B3:23:C0:19
1970-01-04 05:36:13.355 5254-5348/ D/BluetoothGatt: onClientConnectionState() - status=19 clientIf=6 device=7C:92:B3:23:C0:19
1970-01-04 05:36:13.356 5254-5348/ I/info: ######## CURRENT BLE STATUS: 19 [HID_DEVICE]
1970-01-04 05:36:13.356 5254-5348/ I/info: ######## NEW BLE STATUS: 0 [DISCONNECTED]
1970-01-04 05:36:13.356 5254-5348/ D/BluetoothGatt: close()
As you can see, the initial state of the client is: DISCONNECTED. After that, he tries to connect, but after a few seconds gets disconnected. Any ideas why?
Thanks a lot!