Skip to content

Commit

Permalink
Merge pull request #528 from NordicSemiconductor/bugfix/auto-connect
Browse files Browse the repository at this point in the history
Reconnection fixed
  • Loading branch information
philips77 committed Oct 18, 2023
2 parents 8743da2 + a0de084 commit 53e169e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -82,7 +82,7 @@ abstract class BleManagerHandler extends RequestHandler {

private final Object LOCK = new Object();
private BluetoothDevice bluetoothDevice;
private BluetoothGatt bluetoothGatt;
/* package */ BluetoothGatt bluetoothGatt;
private BleManager manager;
private BleServerManager serverManager;
private Handler handler;
Expand Down
Expand Up @@ -738,7 +738,9 @@ public void onConnectionStateChange(@NonNull final BluetoothDevice device, final
log(Log.WARN, "[Server] " + device.getAddress() + " has disconnected connected with status: " + status);
}
final BleManagerHandler handler = getRequestHandler(device);
if (handler != null) {
if (handler != null && handler.bluetoothGatt == null) {
// There is no client connection to the device.
// We have to notify disconnection manually.
handler.notifyDeviceDisconnected(device, status);
}
if (serverObserver != null)
Expand Down

0 comments on commit 53e169e

Please sign in to comment.