aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/io/trygvis/android/bt/BtCallback.java
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-01-04 23:48:53 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-01-04 23:48:53 +0100
commit4a2ca2d94c827566f8682e8dbd6fbdf17d70b4dd (patch)
tree10c9fe3e9b3c829cfc675d3184ce122964441fb5 /app/src/main/java/io/trygvis/android/bt/BtCallback.java
parent31fc64bec1c5286c27bdc1f683d037ae0e91418d (diff)
downloadio.trygvis.soilmoisture-android-4a2ca2d94c827566f8682e8dbd6fbdf17d70b4dd.tar.gz
io.trygvis.soilmoisture-android-4a2ca2d94c827566f8682e8dbd6fbdf17d70b4dd.tar.bz2
io.trygvis.soilmoisture-android-4a2ca2d94c827566f8682e8dbd6fbdf17d70b4dd.tar.xz
io.trygvis.soilmoisture-android-4a2ca2d94c827566f8682e8dbd6fbdf17d70b4dd.zip
o Adding a way to prepend callbacks on the promise's queue. Needed for devices that give you [disconnect, connect] events when connecting. Yay.
o Reading meta data from the Soil Moisture device.
Diffstat (limited to 'app/src/main/java/io/trygvis/android/bt/BtCallback.java')
-rw-r--r--app/src/main/java/io/trygvis/android/bt/BtCallback.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/app/src/main/java/io/trygvis/android/bt/BtCallback.java b/app/src/main/java/io/trygvis/android/bt/BtCallback.java
index 29ea9e1..8dab149 100644
--- a/app/src/main/java/io/trygvis/android/bt/BtCallback.java
+++ b/app/src/main/java/io/trygvis/android/bt/BtCallback.java
@@ -4,6 +4,8 @@ import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
+import static io.trygvis.android.bt.BtPromise.*;
+
public class BtCallback {
public final String name;
@@ -11,39 +13,39 @@ public class BtCallback {
this.name = name;
}
- public boolean onConnectionStateChange(BluetoothGatt gatt, int newState) {
+ public PromiseResult onConnectionStateChange(BluetoothGatt gatt, int newState) {
throw new NotOverriddenException();
}
- public boolean onServicesDiscovered(BluetoothGatt gatt) {
+ public PromiseResult onServicesDiscovered(BluetoothGatt gatt) {
throw new NotOverriddenException();
}
- public boolean onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
+ public PromiseResult onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
throw new NotOverriddenException();
}
- public boolean onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
+ public PromiseResult onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
throw new NotOverriddenException();
}
- public boolean onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
+ public PromiseResult onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
throw new NotOverriddenException();
}
- public boolean onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor) {
+ public PromiseResult onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor) {
throw new NotOverriddenException();
}
- public boolean onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor) {
+ public PromiseResult onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor) {
throw new NotOverriddenException();
}
- public boolean onReliableWriteCompleted(BluetoothGatt gatt) {
+ public PromiseResult onReliableWriteCompleted(BluetoothGatt gatt) {
throw new NotOverriddenException();
}
- public boolean onReadRemoteRssi(BluetoothGatt gatt, int rssi) {
+ public PromiseResult onReadRemoteRssi(BluetoothGatt gatt, int rssi) {
throw new NotOverriddenException();
}