aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/io/trygvis/android/bt/BtService.java
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-01-17 18:15:52 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-01-17 18:15:52 +0100
commitbc09707edf110da018a68be4d16bdfcee8af600f (patch)
tree1f8a6032244f2384372f2c37e220f6946aa4e483 /app/src/main/java/io/trygvis/android/bt/BtService.java
parent5f880d3816526157c5d411896707b971af48212b (diff)
downloadio.trygvis.soilmoisture-android-bc09707edf110da018a68be4d16bdfcee8af600f.tar.gz
io.trygvis.soilmoisture-android-bc09707edf110da018a68be4d16bdfcee8af600f.tar.bz2
io.trygvis.soilmoisture-android-bc09707edf110da018a68be4d16bdfcee8af600f.tar.xz
io.trygvis.soilmoisture-android-bc09707edf110da018a68be4d16bdfcee8af600f.zip
o Not disconnecting when the promise is done.
o All user code can assume that they're already connected to the device, simplifying the life cycle. o When starting, send a 'new device' even for all stored devices.
Diffstat (limited to 'app/src/main/java/io/trygvis/android/bt/BtService.java')
-rw-r--r--app/src/main/java/io/trygvis/android/bt/BtService.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/src/main/java/io/trygvis/android/bt/BtService.java b/app/src/main/java/io/trygvis/android/bt/BtService.java
index ff2c68c..06857ee 100644
--- a/app/src/main/java/io/trygvis/android/bt/BtService.java
+++ b/app/src/main/java/io/trygvis/android/bt/BtService.java
@@ -10,7 +10,7 @@ import java.util.Collection;
import io.trygvis.android.Function;
-public interface BtService<A extends BtDevice.BtDeviceWrapper<A>> {
+public interface BtService<A> {
boolean initialize(BtDbIntegration<A> btDbIntegration);
@@ -32,7 +32,7 @@ public interface BtService<A extends BtDevice.BtDeviceWrapper<A>> {
<T> T runTx(Function<SQLiteDatabase, T> action);
- public static interface BtDbIntegration<A extends BtDevice.BtDeviceWrapper<A>> {
+ public static interface BtDbIntegration<A> {
A createTag(SQLiteDatabase db, BtDevice<A> a);
}
@@ -53,10 +53,13 @@ public interface BtService<A extends BtDevice.BtDeviceWrapper<A>> {
public void onScanStarted() {
}
+ public void onScanStopped() {
+ }
+
public void onNewDevice(String address) {
}
- public void onScanStopped() {
+ public void onDeviceConnection(String address) {
}
}
}