1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-20 07:21:40 +02:00

Revert "Stop LE scan when services have been discovered"

This reverts commit d9b8c6253f.
This commit is contained in:
Erik Johansson
2018-05-03 23:11:26 +02:00
parent d9b8c6253f
commit 262237bcbf

View File

@@ -521,6 +521,11 @@ public abstract class BluetoothCommunication {
Timber.d("onConnectionStateChange: status=%d, newState=%d", status, newState);
if (newState == BluetoothProfile.STATE_CONNECTED) {
if (leScanCallback != null) {
btAdapter.stopLeScan(leScanCallback);
leScanCallback = null;
}
connectionEstablished = true;
setBtStatus(BT_STATUS_CODE.BT_CONNECTION_ESTABLISHED);
gatt.discoverServices();
@@ -537,11 +542,6 @@ public abstract class BluetoothCommunication {
public void onServicesDiscovered(final BluetoothGatt gatt, int status) {
Timber.d("onServicesDiscovered: status=%d", status);
if (leScanCallback != null) {
btAdapter.stopLeScan(leScanCallback);
leScanCallback = null;
}
synchronized (lock) {
cmdStepNr = 0;
initStepNr = 0;