Attempt to fix reconnection not happening in some cases

Fixes #530
master
cpfeiffer 2017-04-20 23:00:43 +02:00
parent bc368a788b
commit 696dc1f08d
1 changed files with 1 additions and 1 deletions

View File

@ -225,7 +225,7 @@ public final class BtLEQueue {
// alive (we do not close() it). Unfortunately we sometimes have problems
// reconnecting automatically, so we try to fix this by re-creating mBluetoothGatt.
// Not sure if this actually works without re-initializing the device...
if (status != 0) {
if (mBluetoothGatt != null) {
if (!wasInitialized || !maybeReconnect()) {
disconnect(); // ensure that we start over cleanly next time
}