From 4a2ca2d94c827566f8682e8dbd6fbdf17d70b4dd Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 4 Jan 2015 23:48:53 +0100 Subject: 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. --- .../main/java/io/trygvis/android/bt/BtCallback.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'app/src/main/java/io/trygvis/android/bt/BtCallback.java') 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(); } -- cgit v1.2.3