aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/io/trygvis/android/bt/WrappingBluetoothGattCallback.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/io/trygvis/android/bt/WrappingBluetoothGattCallback.java')
-rw-r--r--app/src/main/java/io/trygvis/android/bt/WrappingBluetoothGattCallback.java60
1 files changed, 60 insertions, 0 deletions
diff --git a/app/src/main/java/io/trygvis/android/bt/WrappingBluetoothGattCallback.java b/app/src/main/java/io/trygvis/android/bt/WrappingBluetoothGattCallback.java
new file mode 100644
index 0000000..8d790d1
--- /dev/null
+++ b/app/src/main/java/io/trygvis/android/bt/WrappingBluetoothGattCallback.java
@@ -0,0 +1,60 @@
+package io.trygvis.android.bt;
+
+import android.bluetooth.BluetoothGatt;
+import android.bluetooth.BluetoothGattCallback;
+import android.bluetooth.BluetoothGattCharacteristic;
+import android.bluetooth.BluetoothGattDescriptor;
+
+class WrappingBluetoothGattCallback extends BluetoothGattCallback {
+
+ private final BluetoothGattCallback wrapped;
+
+ public WrappingBluetoothGattCallback(BluetoothGattCallback wrapped) {
+ this.wrapped = wrapped;
+ }
+
+ @Override
+ public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
+ wrapped.onConnectionStateChange(gatt, status, newState);
+ }
+
+ @Override
+ public void onServicesDiscovered(BluetoothGatt gatt, int status) {
+ wrapped.onServicesDiscovered(gatt, status);
+ }
+
+ @Override
+ public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
+ wrapped.onCharacteristicRead(gatt, characteristic, status);
+ }
+
+ @Override
+ public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
+ wrapped.onCharacteristicWrite(gatt, characteristic, status);
+ }
+
+ @Override
+ public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
+ wrapped.onCharacteristicChanged(gatt, characteristic);
+ }
+
+ @Override
+ public void onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
+ wrapped.onDescriptorRead(gatt, descriptor, status);
+ }
+
+ @Override
+ public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
+ wrapped.onDescriptorWrite(gatt, descriptor, status);
+ }
+
+ @Override
+ public void onReliableWriteCompleted(BluetoothGatt gatt, int status) {
+ wrapped.onReliableWriteCompleted(gatt, status);
+ }
+
+ @Override
+ public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) {
+ wrapped.onReadRemoteRssi(gatt, rssi, status);
+ }
+}