diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/io/trygvis/android/bt/BtDevice.java | 4 | ||||
-rw-r--r-- | app/src/main/java/io/trygvis/android/bt/DefaultBtService.java | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/app/src/main/java/io/trygvis/android/bt/BtDevice.java b/app/src/main/java/io/trygvis/android/bt/BtDevice.java index 07e4e52..50fe707 100644 --- a/app/src/main/java/io/trygvis/android/bt/BtDevice.java +++ b/app/src/main/java/io/trygvis/android/bt/BtDevice.java @@ -107,7 +107,7 @@ public class BtDevice<A> implements Comparable<BtDevice> { throw new RuntimeException("The current callback is not done."); } - Log.i(TAG, "withConnection(), address=" + address + ", connected: " + (gatt != null)); + Log.i(TAG, "withConnection(), address=" + address + ", connected: " + connected()); BtSequence newSequence; if (gatt == null) { @@ -154,7 +154,7 @@ public class BtDevice<A> implements Comparable<BtDevice> { if (gatt == null) { gatt = bluetoothDevice.connectGatt(btService, false, wrappingCallback); } else { - sequencer.onDirect(); + sequencer.onDirect(gatt); } } diff --git a/app/src/main/java/io/trygvis/android/bt/DefaultBtService.java b/app/src/main/java/io/trygvis/android/bt/DefaultBtService.java index 2487bd8..fc1819c 100644 --- a/app/src/main/java/io/trygvis/android/bt/DefaultBtService.java +++ b/app/src/main/java/io/trygvis/android/bt/DefaultBtService.java @@ -57,6 +57,13 @@ public class DefaultBtService<A> extends Service implements BtService<A> { private Scanner scanner = new Scanner(); + static { + BtSequencer.d = msg -> Log.d(BtSequencer.TAG, msg); + BtSequencer.i = msg -> Log.i(BtSequencer.TAG, msg); + BtSequencer.w = msg -> Log.w(BtSequencer.TAG, msg); + BtSequencer.we = pair -> Log.w(BtSequencer.TAG, pair.getKey(), pair.getValue()); + } + // ----------------------------------------------------------------------- // BtService Implementation // ----------------------------------------------------------------------- |