diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-01-28 23:45:38 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-01-28 23:45:38 +0100 |
commit | 3e619a735e63a1222e71060d9e65b354a156b158 (patch) | |
tree | 2f31cdc65d0d773874800c114530eb620bcca536 /bt/src/main/java/io/trygvis/android/bt/BtCallback.java | |
parent | c4685214d8db34166213ffa373a16af1a99401a5 (diff) | |
download | io.trygvis.soilmoisture-android-3e619a735e63a1222e71060d9e65b354a156b158.tar.gz io.trygvis.soilmoisture-android-3e619a735e63a1222e71060d9e65b354a156b158.tar.bz2 io.trygvis.soilmoisture-android-3e619a735e63a1222e71060d9e65b354a156b158.tar.xz io.trygvis.soilmoisture-android-3e619a735e63a1222e71060d9e65b354a156b158.zip |
o Major refactoring on the BtPromise, mainly internal. Renaming BtPromise to BtSequence and BtSequencer.
Diffstat (limited to 'bt/src/main/java/io/trygvis/android/bt/BtCallback.java')
-rw-r--r-- | bt/src/main/java/io/trygvis/android/bt/BtCallback.java | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/bt/src/main/java/io/trygvis/android/bt/BtCallback.java b/bt/src/main/java/io/trygvis/android/bt/BtCallback.java new file mode 100644 index 0000000..4aa8529 --- /dev/null +++ b/bt/src/main/java/io/trygvis/android/bt/BtCallback.java @@ -0,0 +1,74 @@ +package io.trygvis.android.bt; + +import android.bluetooth.BluetoothGatt; +import android.bluetooth.BluetoothGattCharacteristic; +import android.bluetooth.BluetoothGattDescriptor; + +import static io.trygvis.android.bt.BtSequence.SequenceResult; +import static io.trygvis.android.bt.BtSequencer.EventType; + +public class BtCallback { + public final boolean stopOnFailure; + public final EventType type; + + public BtCallback(boolean stopOnFailure, EventType type) { + this.stopOnFailure = stopOnFailure; + this.type = type; + } + + public SequenceResult onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { + throw new NotOverriddenException(); + } + + public SequenceResult onServicesDiscovered(BluetoothGatt gatt) { + throw new NotOverriddenException(); + } + + public SequenceResult onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { + throw new NotOverriddenException(); + } + + public SequenceResult onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { + throw new NotOverriddenException(); + } + + public SequenceResult onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { + throw new NotOverriddenException(); + } + + public SequenceResult onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor) { + throw new NotOverriddenException(); + } + + public SequenceResult onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor) { + throw new NotOverriddenException(); + } + + public SequenceResult onReliableWriteCompleted(BluetoothGatt gatt) { + throw new NotOverriddenException(); + } + + public SequenceResult onReadRemoteRssi(BluetoothGatt gatt, int rssi) { + throw new NotOverriddenException(); + } + + public SequenceResult onDirect(BluetoothGatt value) { + throw new NotOverriddenException(); + } + + public void onFailure() { + throw new NotOverriddenException(); + } + + public void onFinally(boolean success) { + throw new NotOverriddenException(); + } + + @Override + public String toString() { + return "BtCallback{" + + "type='" + type + '\'' + + ", stopOnFailure=" + stopOnFailure + + '}'; + } +} |