mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
ble: fix wrong Logger in performInitialized
This commit is contained in:
+2
-5
@@ -28,7 +28,6 @@ import android.content.Context;
|
||||
import androidx.annotation.CallSuper;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -57,8 +56,6 @@ import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.AbstractBlePro
|
||||
* @see BtLEQueue
|
||||
*/
|
||||
public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport implements GattCallback, GattServerCallback {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(AbstractBTLEDeviceSupport.class);
|
||||
|
||||
private int mMTU = 23;
|
||||
private BtLEQueue mQueue;
|
||||
private Map<UUID, BluetoothGattCharacteristic> mAvailableCharacteristics;
|
||||
@@ -202,13 +199,13 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
|
||||
*/
|
||||
public TransactionBuilder performInitialized(String taskName) throws IOException {
|
||||
if (!isConnected()) {
|
||||
LOG.debug("Connecting to device for {}", taskName);
|
||||
logger.debug("Connecting to device for {}", taskName);
|
||||
if (!connect()) {
|
||||
throw new IOException("1: Unable to connect to device: " + getDevice());
|
||||
}
|
||||
}
|
||||
if (!isInitialized()) {
|
||||
LOG.debug("Initializing device for {}", taskName);
|
||||
logger.debug("Initializing device for {}", taskName);
|
||||
// first, add a transaction that performs device initialization
|
||||
TransactionBuilder builder = createTransactionBuilder("Initialize device");
|
||||
builder.add(new CheckInitializedAction(gbDevice));
|
||||
|
||||
+2
-3
@@ -57,7 +57,6 @@ import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.AbstractBlePro
|
||||
public abstract class AbstractBTLEMultiDeviceSupport extends AbstractDeviceSupport
|
||||
implements GattCallback, GattServerCallback {
|
||||
public static final String BASE_UUID = "0000%s-0000-1000-8000-00805f9b34fb";
|
||||
private static final Logger LOG = LoggerFactory.getLogger(AbstractBTLEMultiDeviceSupport.class);
|
||||
|
||||
private final int deviceCount;
|
||||
private final Set<UUID>[] mSupportedServices;
|
||||
@@ -278,13 +277,13 @@ public abstract class AbstractBTLEMultiDeviceSupport extends AbstractDeviceSuppo
|
||||
"Requested device index " + deviceIdx + " doesn't exist.");
|
||||
}
|
||||
if (!isConnected()) {
|
||||
LOG.debug("Connecting to device for {}", taskName);
|
||||
logger.debug("Connecting to device for {}", taskName);
|
||||
if (!connect()) {
|
||||
throw new IOException("1: Unable to connect to device: " + getDevice(deviceIdx));
|
||||
}
|
||||
}
|
||||
if (!devices[deviceIdx].isInitialized()) {
|
||||
LOG.debug("Initializing device for {}", taskName);
|
||||
logger.debug("Initializing device for {}", taskName);
|
||||
// first, add a transaction that performs device initialization
|
||||
TransactionBuilder builder = createTransactionBuilder("Initialize device");
|
||||
builder.add(new CheckInitializedAction(devices[deviceIdx]));
|
||||
|
||||
Reference in New Issue
Block a user