Skip to content

Commit 4c88809

Browse files
committed
Handling error 147 just like 133 with its a timeout
1 parent 2ea4b4e commit 4c88809

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ble/src/main/java/no/nordicsemi/android/ble/BleManagerHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ abstract class BleManagerHandler extends RequestHandler {
9393
private boolean initialization;
9494

9595
/**
96-
* A time after which receiving 133 error is considered a timeout, instead of a
96+
* A time after which receiving 133 or 147 error is considered a timeout, instead of a
9797
* different reason.
9898
* A {@link BluetoothDevice#connectGatt(Context, boolean, BluetoothGattCallback)} call will
9999
* fail after 30 seconds if the device won't be found until then. Other errors happen much
@@ -2329,7 +2329,7 @@ public void onConnectionStateChange(@NonNull final BluetoothGatt gatt,
23292329
reason = FailCallback.REASON_DEVICE_NOT_SUPPORTED;
23302330
else if (status == BluetoothGatt.GATT_SUCCESS)
23312331
reason = FailCallback.REASON_DEVICE_DISCONNECTED;
2332-
else if (status == GattError.GATT_ERROR && timeout)
2332+
else if ((status == GattError.GATT_ERROR || status == GattError.GATT_TIMEOUT) && timeout)
23332333
reason = FailCallback.REASON_TIMEOUT;
23342334
else
23352335
reason = status;

0 commit comments

Comments
 (0)