mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-09 19:49:30 +01:00
OK, just connect(true) is not sufficient #249
(we again get connection problems. Let's try this.)
This commit is contained in:
parent
a49335fa67
commit
1e5dbb6a23
@ -157,11 +157,12 @@ public final class BtLEQueue {
|
|||||||
LOG.info("Attempting to connect to " + mGbDevice.getName());
|
LOG.info("Attempting to connect to " + mGbDevice.getName());
|
||||||
mBluetoothAdapter.cancelDiscovery();
|
mBluetoothAdapter.cancelDiscovery();
|
||||||
BluetoothDevice remoteDevice = mBluetoothAdapter.getRemoteDevice(mGbDevice.getAddress());
|
BluetoothDevice remoteDevice = mBluetoothAdapter.getRemoteDevice(mGbDevice.getAddress());
|
||||||
|
boolean result;
|
||||||
synchronized (mGattMonitor) {
|
synchronized (mGattMonitor) {
|
||||||
mBluetoothGatt = remoteDevice.connectGatt(mContext, true, internalGattCallback);
|
mBluetoothGatt = remoteDevice.connectGatt(mContext, true, internalGattCallback);
|
||||||
// result = mBluetoothGatt.connect();
|
result = mBluetoothGatt.connect();
|
||||||
}
|
}
|
||||||
boolean result = mBluetoothGatt != null;
|
// boolean result = mBluetoothGatt != null;
|
||||||
if (result) {
|
if (result) {
|
||||||
setDeviceConnectionState(State.CONNECTING);
|
setDeviceConnectionState(State.CONNECTING);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user