mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 21:06:50 +01:00
Log any exceptions during ble callbacks, if any #91
This commit is contained in:
parent
5b8bf468f5
commit
9db7d13a94
@ -365,7 +365,11 @@ public final class BtLEQueue {
|
||||
return;
|
||||
}
|
||||
if (getCallbackToUse() != null) {
|
||||
try {
|
||||
getCallbackToUse().onCharacteristicRead(gatt, characteristic, status);
|
||||
} catch (Throwable ex) {
|
||||
LOG.error("onCharaceristicRead: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
checkWaitingCharacteristic(characteristic, status);
|
||||
}
|
||||
@ -377,7 +381,11 @@ public final class BtLEQueue {
|
||||
return;
|
||||
}
|
||||
if (getCallbackToUse() != null) {
|
||||
try {
|
||||
getCallbackToUse().onDescriptorRead(gatt, descriptor, status);
|
||||
} catch (Throwable ex) {
|
||||
LOG.error("onDescriptorRead: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
checkWaitingCharacteristic(descriptor.getCharacteristic(), status);
|
||||
}
|
||||
@ -389,7 +397,11 @@ public final class BtLEQueue {
|
||||
return;
|
||||
}
|
||||
if (getCallbackToUse() != null) {
|
||||
try {
|
||||
getCallbackToUse().onDescriptorWrite(gatt, descriptor, status);
|
||||
} catch (Throwable ex) {
|
||||
LOG.error("onDescriptorWrite: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
checkWaitingCharacteristic(descriptor.getCharacteristic(), status);
|
||||
}
|
||||
@ -402,7 +414,11 @@ public final class BtLEQueue {
|
||||
return;
|
||||
}
|
||||
if (getCallbackToUse() != null) {
|
||||
try {
|
||||
getCallbackToUse().onCharacteristicChanged(gatt, characteristic);
|
||||
} catch (Throwable ex) {
|
||||
LOG.error("onCharaceristicChanged: " + ex.getMessage(), ex);
|
||||
}
|
||||
} else {
|
||||
LOG.info("No gattcallback registered, ignoring characteristic change");
|
||||
}
|
||||
@ -415,7 +431,11 @@ public final class BtLEQueue {
|
||||
return;
|
||||
}
|
||||
if (getCallbackToUse() != null) {
|
||||
try {
|
||||
getCallbackToUse().onReadRemoteRssi(gatt, rssi, status);
|
||||
} catch (Throwable ex) {
|
||||
LOG.error("onReadRemoteRssi: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,6 +466,4 @@ public final class BtLEQueue {
|
||||
mTransactionGattCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user