diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp index 9435d479..38c50d78 100644 --- a/src/bluetooth/qlowenergycontroller_bluez.cpp +++ b/src/bluetooth/qlowenergycontroller_bluez.cpp @@ -3035,6 +3035,9 @@ void QLowEnergyControllerPrivate::handleConnectionRequest() closeServerSocket(); l2cpSocket = new QBluetoothSocket(QBluetoothServiceInfo::L2capProtocol, this); + + qCDebug(QT_BT_BLUEZ) << __FUNCTION__ << ":" << __LINE__ << "before setSocketDescriptor: " << l2cpSocket->socketDescriptor(); + connect(l2cpSocket, &QBluetoothSocket::disconnected, this, &QLowEnergyControllerPrivate::l2cpDisconnected); connect(l2cpSocket, static_cast @@ -3047,6 +3050,8 @@ void QLowEnergyControllerPrivate::handleConnectionRequest() restoreClientConfigurations(); loadSigningDataIfNecessary(RemoteSigningKey); + qCDebug(QT_BT_BLUEZ) << __FUNCTION__ << ":" << __LINE__ << "after setSocketDescriptor: " << l2cpSocket->socketDescriptor(); + Q_Q(QLowEnergyController); setState(QLowEnergyController::ConnectedState); emit q->connected(); @@ -3057,6 +3062,7 @@ void QLowEnergyControllerPrivate::closeServerSocket() if (!serverSocketNotifier) return; serverSocketNotifier->disconnect(); + qCDebug(QT_BT_BLUEZ) << __FUNCTION__ << ":" << __LINE__ << "close socket: " << serverSocketNotifier->socket(); close(serverSocketNotifier->socket()); serverSocketNotifier->deleteLater(); serverSocketNotifier = nullptr;