Minor changes and a fix to a NPE when mBtGatt is null

This commit is contained in:
TaaviE
2020-07-28 08:10:39 +02:00
committed by Gitea
parent 443658bf9e
commit bcac8e0d7f
@@ -186,8 +186,9 @@ public class CasioGB6900DeviceSupport extends AbstractBTLEDeviceSupport {
// FIXME: Replace hardcoded values by configuration // FIXME: Replace hardcoded values by configuration
private void configureWatch(TransactionBuilder builder) { private void configureWatch(TransactionBuilder builder) {
if (mBtGatt == null) if (mBtGatt == null) {
return; return;
}
byte value[] = new byte[]{GattCharacteristic.MILD_ALERT}; byte value[] = new byte[]{GattCharacteristic.MILD_ALERT};
@@ -680,10 +681,15 @@ public class CasioGB6900DeviceSupport extends AbstractBTLEDeviceSupport {
@Override @Override
public void onFindDevice(boolean start) { public void onFindDevice(boolean start) {
if(!isConnected()) if (!isConnected()) {
return; return;
}
if(start) { if (mBtGatt == null) {
return;
}
if (start) {
try { try {
TransactionBuilder builder = performInitialized("findDevice"); TransactionBuilder builder = performInitialized("findDevice");
byte value[] = new byte[]{GattCharacteristic.HIGH_ALERT}; byte value[] = new byte[]{GattCharacteristic.HIGH_ALERT};