mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-30 03:30:30 +02:00
Log exception for #159
This commit is contained in:
@@ -290,6 +290,7 @@ public abstract class BluetoothCommunication {
|
|||||||
protected void setIndicationOn(UUID service, UUID characteristic, UUID descriptor) {
|
protected void setIndicationOn(UUID service, UUID characteristic, UUID descriptor) {
|
||||||
Timber.d("Set indication on for %s", characteristic);
|
Timber.d("Set indication on for %s", characteristic);
|
||||||
|
|
||||||
|
try {
|
||||||
BluetoothGattCharacteristic gattCharacteristic =
|
BluetoothGattCharacteristic gattCharacteristic =
|
||||||
bluetoothGatt.getService(service).getCharacteristic(characteristic);
|
bluetoothGatt.getService(service).getCharacteristic(characteristic);
|
||||||
bluetoothGatt.setCharacteristicNotification(gattCharacteristic, true);
|
bluetoothGatt.setCharacteristicNotification(gattCharacteristic, true);
|
||||||
@@ -302,6 +303,10 @@ public abstract class BluetoothCommunication {
|
|||||||
handleRequests();
|
handleRequests();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
Timber.e(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set notification flag on for the Bluetooth device.
|
* Set notification flag on for the Bluetooth device.
|
||||||
@@ -312,6 +317,7 @@ public abstract class BluetoothCommunication {
|
|||||||
protected void setNotificationOn(UUID service, UUID characteristic, UUID descriptor) {
|
protected void setNotificationOn(UUID service, UUID characteristic, UUID descriptor) {
|
||||||
Timber.d("Set notification on for %s", characteristic);
|
Timber.d("Set notification on for %s", characteristic);
|
||||||
|
|
||||||
|
try {
|
||||||
BluetoothGattCharacteristic gattCharacteristic =
|
BluetoothGattCharacteristic gattCharacteristic =
|
||||||
bluetoothGatt.getService(service).getCharacteristic(characteristic);
|
bluetoothGatt.getService(service).getCharacteristic(characteristic);
|
||||||
bluetoothGatt.setCharacteristicNotification(gattCharacteristic, true);
|
bluetoothGatt.setCharacteristicNotification(gattCharacteristic, true);
|
||||||
@@ -324,6 +330,10 @@ public abstract class BluetoothCommunication {
|
|||||||
handleRequests();
|
handleRequests();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
Timber.e(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set notification flag off for the Bluetooth device.
|
* Set notification flag off for the Bluetooth device.
|
||||||
|
Reference in New Issue
Block a user