diff options
author | Juha Vuolle <juha.vuolle@insta.fi> | 2022-01-19 15:07:25 +0200 |
---|---|---|
committer | Juha Vuolle <juha.vuolle@insta.fi> | 2022-01-21 15:07:46 +0200 |
commit | debf0fd212b232bcd83c8bb8f51ba2bad2f57a1c (patch) | |
tree | 130909e2ff7cd9c5e841939984065a6be069494e /examples/bluetooth/pingpong | |
parent | 218dcb1a2e7a6d290f53cc9bdc6b20a20579aea9 (diff) |
Store the serviceinfo in pingpong example
The service info returned by the QBluetoothServer::listen() overload
that returns it needs to be stored or otherwise it will be destroyed.
The consequence was that the SDP "advertisement" didn't properly
include the added pingpong service record on Windows.
Task-number: QTBUG-100042
Pick-to: 6.2 6.3 5.15
Change-Id: I79cbd0f574e35bbc1c9c3123ce8382f3aad296d4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/bluetooth/pingpong')
-rw-r--r-- | examples/bluetooth/pingpong/pingpong.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/bluetooth/pingpong/pingpong.cpp b/examples/bluetooth/pingpong/pingpong.cpp index b6e6196c..9a446542 100644 --- a/examples/bluetooth/pingpong/pingpong.cpp +++ b/examples/bluetooth/pingpong/pingpong.cpp @@ -270,7 +270,7 @@ void PingPong::startServer() connect(m_serverInfo, &QBluetoothServer::errorOccurred, this, &PingPong::serverError); const QBluetoothUuid uuid(serviceUuid); - m_serverInfo->listen(uuid, QStringLiteral("PingPong server")); + m_serviceInfo = m_serverInfo->listen(uuid, QStringLiteral("PingPong server")); //! [Starting the server] setMessage(QStringLiteral("Server started, waiting for the client. You are the left player.")); // m_role is set to 1 if it is a server |