1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 04:46:51 +01:00

OK, revert to connectGatt(false), connect often does not work with true #249

This commit is contained in:
cpfeiffer 2016-04-09 09:53:03 +02:00
parent 42dda911e4
commit 802e9a8235

View File

@ -157,12 +157,13 @@ public final class BtLEQueue {
LOG.info("Attempting to connect to " + mGbDevice.getName());
mBluetoothAdapter.cancelDiscovery();
BluetoothDevice remoteDevice = mBluetoothAdapter.getRemoteDevice(mGbDevice.getAddress());
boolean result;
// boolean result;
synchronized (mGattMonitor) {
mBluetoothGatt = remoteDevice.connectGatt(mContext, true, internalGattCallback);
result = mBluetoothGatt.connect();
// connectGatt with true doesn't really work ;( too often connection problems
mBluetoothGatt = remoteDevice.connectGatt(mContext, false, internalGattCallback);
// result = mBluetoothGatt.connect();
}
// boolean result = mBluetoothGatt != null;
boolean result = mBluetoothGatt != null;
if (result) {
setDeviceConnectionState(State.CONNECTING);
}