aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-01-30 18:54:26 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-01-30 18:54:26 +0100
commit991620666551c1eaf655a0aa0b1fe08d2bc19681 (patch)
tree2fd2bf31c582985d1fdecc84c106fee352d15618 /app/src
parent3e619a735e63a1222e71060d9e65b354a156b158 (diff)
downloadio.trygvis.soilmoisture-android-991620666551c1eaf655a0aa0b1fe08d2bc19681.tar.gz
io.trygvis.soilmoisture-android-991620666551c1eaf655a0aa0b1fe08d2bc19681.tar.bz2
io.trygvis.soilmoisture-android-991620666551c1eaf655a0aa0b1fe08d2bc19681.tar.xz
io.trygvis.soilmoisture-android-991620666551c1eaf655a0aa0b1fe08d2bc19681.zip
o This variant actually work on a device.
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/io/trygvis/android/bt/BtDevice.java4
-rw-r--r--app/src/main/java/io/trygvis/android/bt/DefaultBtService.java7
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
// -----------------------------------------------------------------------