Another small change to BTLE device connection #156
This commit is contained in:
parent
5864189b91
commit
f349846f4a
|
@ -156,11 +156,11 @@ 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, false, internalGattCallback);
|
mBluetoothGatt = remoteDevice.connectGatt(mContext, false, internalGattCallback);
|
||||||
result = mBluetoothGatt.connect();
|
// result = mBluetoothGatt.connect();
|
||||||
}
|
}
|
||||||
|
boolean result = mBluetoothGatt != null;
|
||||||
if (result) {
|
if (result) {
|
||||||
setDeviceConnectionState(State.CONNECTING);
|
setDeviceConnectionState(State.CONNECTING);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue