Restart advertising if client gets disconnected

This commit is contained in:
Simon Stürz 2018-05-11 14:50:01 +02:00
parent 065376e06d
commit db5d59bb2f

View File

@ -211,6 +211,11 @@ void Core::onBluetoothServerRunningChanged(bool running)
void Core::onBluetoothServerConnectedChanged(bool connected) void Core::onBluetoothServerConnectedChanged(bool connected)
{ {
qCDebug(dcApplication()) << "Bluetooth client" << (connected ? "connected" : "disconnected"); qCDebug(dcApplication()) << "Bluetooth client" << (connected ? "connected" : "disconnected");
if (!connected) {
// Restart bluetooth server if a client disconnected
m_bluetoothServer->stop();
m_bluetoothServer->start(m_networkManager->wirelessNetworkDevices().first());
}
} }
void Core::onNetworkManagerAvailableChanged(const bool &available) void Core::onNetworkManagerAvailableChanged(const bool &available)