NordicSemiconductor / Android-BLE-Library

A library that makes working with Bluetooth LE on Android a pleasure. Seriously.
BSD 3-Clause "New" or "Revised" License
1.98k stars 413 forks source link

Server connection events #521

Closed philips77 closed 11 months ago

philips77 commented 11 months ago

This PR fixes #506. At least I hope so. @nadrolinux, please check.

When a server disconnection event is received and corresponding BleManager exists, the server manager will call notifyDeviceDisconnected(...), which should reset the states to STATE_DISCONNECTED and notify the requests.

Also, when the server manager was set for a BleManager, and the device is used as client (that is connect(..) is used, the manager now calls connect(..) method in the BluetoothGattServer. This should make the connection reference persistent in the server. I don't think this is necessary, as it was working before, but should work with it as well.

nadrolinux commented 10 months ago

Hi @philips77 Sorry, I'm replying so late. I can confirm that this PR solved an issue. Thanks.