mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-26 01:43:59 +02:00
catch all exceptions on Bluetooth scan stop
This commit is contained in:
@@ -232,7 +232,12 @@ public abstract class BluetoothCommunication {
|
|||||||
public void disconnect() {
|
public void disconnect() {
|
||||||
Timber.d("Bluetooth disconnect");
|
Timber.d("Bluetooth disconnect");
|
||||||
setBluetoothStatus(BT_STATUS.CONNECTION_DISCONNECT);
|
setBluetoothStatus(BT_STATUS.CONNECTION_DISCONNECT);
|
||||||
|
try {
|
||||||
central.stopScan();
|
central.stopScan();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Timber.e("Error on Bluetooth disconnecting " + ex.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
if (btPeripheral != null) {
|
if (btPeripheral != null) {
|
||||||
central.cancelConnection(btPeripheral);
|
central.cancelConnection(btPeripheral);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user