I think this is minimal required change to fix the issue. The call to notifyDeviceDisconnected(...) was added to BleServerManager in #521. It was supposed to fix no disconnection callback in server-only mode when attachClientConnection is used.
However, as @corentin-c noticed, that broke bidirectional connection, as that method is now called twice, from server and client, and client doesn't reconnect.
The proposed check ensures that it is called only in server-only mode when bluetoothGatt object is null.
This PR fixes #526.
I think this is minimal required change to fix the issue. The call to
notifyDeviceDisconnected(...)
was added toBleServerManager
in #521. It was supposed to fix no disconnection callback in server-only mode whenattachClientConnection
is used.However, as @corentin-c noticed, that broke bidirectional connection, as that method is now called twice, from server and client, and client doesn't reconnect.
The proposed check ensures that it is called only in server-only mode when
bluetoothGatt
object is null.