From 3e619a735e63a1222e71060d9e65b354a156b158 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 28 Jan 2015 23:45:38 +0100 Subject: o Major refactoring on the BtPromise, mainly internal. Renaming BtPromise to BtSequence and BtSequencer. --- .../main/java/android/bluetooth/BluetoothGatt.java | 32 ++++++++++++++++++++++ .../android/bluetooth/BluetoothGattCallback.java | 31 +++++++++++++++++++++ .../bluetooth/BluetoothGattCharacteristic.java | 13 +++++++++ .../android/bluetooth/BluetoothGattDescriptor.java | 13 +++++++++ .../android/bluetooth/BluetoothGattService.java | 4 +++ .../src/main/java/android/util/Log.java | 20 ++++++++++++++ 6 files changed, 113 insertions(+) create mode 100644 trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGatt.java create mode 100644 trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattCallback.java create mode 100644 trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattCharacteristic.java create mode 100644 trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattDescriptor.java create mode 100644 trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattService.java create mode 100644 trygvis-io-bt-stubs/src/main/java/android/util/Log.java (limited to 'trygvis-io-bt-stubs/src/main/java') diff --git a/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGatt.java b/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGatt.java new file mode 100644 index 0000000..13b33ed --- /dev/null +++ b/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGatt.java @@ -0,0 +1,32 @@ +package android.bluetooth; + +import java.util.List; +import java.util.UUID; + +public class BluetoothGatt { + public static final int GATT_SUCCESS = 1; + public static final int STATE_CONNECTED = 2; + + public boolean discoverServices() { + return false; + } + + public List getServices() { + return null; + } + + public BluetoothGattService getService(UUID uuid) { + return null; + } + + public boolean writeCharacteristic(BluetoothGattCharacteristic characteristic) { + return false; + } + + public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean b) { + } + + public boolean writeDescriptor(BluetoothGattDescriptor descriptor) { + return false; + } +} diff --git a/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattCallback.java b/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattCallback.java new file mode 100644 index 0000000..a2a2943 --- /dev/null +++ b/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattCallback.java @@ -0,0 +1,31 @@ +package android.bluetooth; + +public class BluetoothGattCallback { + + public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { + } + + public void onServicesDiscovered(BluetoothGatt gatt, int status) { + } + + public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { + } + + public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { + } + + public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { + } + + public void onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { + } + + public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { + } + + public void onReliableWriteCompleted(BluetoothGatt gatt, int status) { + } + + public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) { + } +} diff --git a/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattCharacteristic.java b/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattCharacteristic.java new file mode 100644 index 0000000..8398b5a --- /dev/null +++ b/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattCharacteristic.java @@ -0,0 +1,13 @@ +package android.bluetooth; + +import java.util.UUID; + +public class BluetoothGattCharacteristic { + public UUID getUuid() { + return null; + } + + public byte[] getValue() { + return null; + } +} diff --git a/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattDescriptor.java b/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattDescriptor.java new file mode 100644 index 0000000..0a86c7e --- /dev/null +++ b/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattDescriptor.java @@ -0,0 +1,13 @@ +package android.bluetooth; + +import java.util.UUID; + +public class BluetoothGattDescriptor { + public UUID getUuid() { + return null; + } + + public BluetoothGattCharacteristic getCharacteristic() { + return null; + } +} diff --git a/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattService.java b/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattService.java new file mode 100644 index 0000000..cd2a57f --- /dev/null +++ b/trygvis-io-bt-stubs/src/main/java/android/bluetooth/BluetoothGattService.java @@ -0,0 +1,4 @@ +package android.bluetooth; + +public class BluetoothGattService { +} diff --git a/trygvis-io-bt-stubs/src/main/java/android/util/Log.java b/trygvis-io-bt-stubs/src/main/java/android/util/Log.java new file mode 100644 index 0000000..036ce22 --- /dev/null +++ b/trygvis-io-bt-stubs/src/main/java/android/util/Log.java @@ -0,0 +1,20 @@ +package android.util; + +public class Log { + public static void d(String tag, String s) { + System.out.println("d: " + tag + ": " + s); + } + + public static void i(String tag, String s) { + System.out.println("i: " + tag + ": " + s); + } + + public static void w(String tag, String s) { + System.out.println("w: " + tag + ": " + s); + } + + public static void w(String tag, String s, Exception e) { + System.out.println("w: " + tag + ": " + s); + e.printStackTrace(System.out); + } +} -- cgit v1.2.3