Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnection fixed #528

Merged
merged 1 commit into from Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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