summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Heikkinen <jani.heikkinen@digia.com>2014-04-23 12:44:00 +0300
committerJani Heikkinen <jani.heikkinen@digia.com>2014-04-23 12:44:00 +0300
commitf665f9d8c5e1bf491b479c94b140a03de6b459fc (patch)
tree78c5a21ffb63ad0b234a7685ff05f2e9cb93a3ce
parent764780a8d30d375d21f033c7216e4c54b193a428 (diff)
parent9b11226f3d23dfb4c6b8457f2a839584666cda6a (diff)
Merge remote-tracking branch 'origin/release' into stable
-rw-r--r--dist/changes-5.3.0154
-rw-r--r--examples/bluetooth/btchat/doc/src/btchat.qdoc7
-rw-r--r--examples/bluetooth/btfiletransfer/doc/src/btfiletransfer.qdoc7
-rw-r--r--examples/bluetooth/btscanner/doc/src/btscanner.qdoc9
-rw-r--r--examples/bluetooth/picturetransfer/doc/src/picturetransfer.qdoc40
-rw-r--r--examples/bluetooth/pingpong/doc/src/pingpong.qdoc6
-rw-r--r--examples/bluetooth/scanner/doc/src/scanner.qdoc5
-rw-r--r--examples/nfc/annotatedurl/doc/src/annotatedurl.qdoc14
-rw-r--r--examples/nfc/corkboard/doc/src/corkboard.qdoc9
-rw-r--r--examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc12
-rw-r--r--examples/nfc/poster/doc/src/poster.qdoc13
-rw-r--r--src/bluetooth/android/servicediscoverybroadcastreceiver.cpp6
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_android.cpp23
13 files changed, 267 insertions, 38 deletions
diff --git a/dist/changes-5.3.0 b/dist/changes-5.3.0
new file mode 100644
index 00000000..97754515
--- /dev/null
+++ b/dist/changes-5.3.0
@@ -0,0 +1,154 @@
+Qt 5.3 introduces many new features and improvements as well as bugfixes
+over the 5.2.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+ http://qt-project.org/doc/qt-5.3
+
+The Qt version 5.3 series is binary compatible with the 5.2.x series.
+Applications compiled for 5.2 will continue to run with 5.3.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ http://bugreports.qt-project.org/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* General *
+****************************************************************************
+
+General Improvements
+--------------------
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+QtBluetooth
+-----------
+
+ - Documentation:
+ * The documentation for the Bluetooth discovery classes has been
+ improved.
+ * QBluetoothSocket's local name, port and address property documentation
+ improved.
+ * Documentation of all examples improved.
+
+ - General:
+ * Added a new Object-Push example.
+ * QML scanner example was optimized for high DPI displays and
+ error handling was improved. This ensures a better user interface
+ for Android and BlackBerry devices.
+ * Replaced tennis example against new QML based PingPong example.
+ * Test application added. This application enables easier testing
+ and debugging of the various API features.
+
+ - BluetoothDiscoveryModel:
+ * Improved error handling of device discovery process.
+ * Fixed incorrect behavior when changing from device to service discovery
+ and vice versa.
+
+ - QBluetoothDeviceDiscoveryAgent:
+ * Added checks and error enum value to avoid incorrect handling of
+ non-existing local Bluetooth adapter addresses.
+
+ - QBluetoothHostInfo:
+ * Copy operator added.
+
+ - QBluetoothLocalDevice:
+ * Added a new API elements to retrieve connected Bluetooth devices
+ and to receive notifications about connection changes.
+
+ - QBluetoothServiceDiscoveryAgent:
+ * Fixed the fallback backend's initial state and error values.
+ * Duplicated code was removed.
+ * QBluetoothServiceDiscoveryAgent::clear() was improved to avoid
+ unpredictable class behavior.
+
+ - QBluetoothServer:
+ * Checks added to avoid calls to listen() while the server socket is
+ already listening for incoming sockets.
+ * Fixed inconsistent state() of server object after failed service
+ registration attempt during listen() call.
+ * Fixed incorrect parameter type of error() signal. This fixed issues
+ whereby QObject::connect() could not find the signal.
+ * Added custom uuid to serial port service SDP data set. This enables
+ the discovery of such profiles on Android devices.
+
+ - QBluetoothServiceInfo:
+ * Fixed broken implementation of serviceClassUuids().
+
+ - QBluetoothSocket:
+ * Fixed a crash in Bluez part of QBluetoothSocket() which was caused
+ triggered when calling the sequence connect() - abort() - connect().
+ * Fixed missing initialization of the internal socket error state
+ variable. This caused incorrect QBluetoothSocket::error() right after
+ class instantiation.
+ * Synchronized handling of errors across all supported platforms.
+
+ - QBluetoothUuid:
+ * Fixed wrong value of PnpInformation enum value.
+ * Added newly defined ServiceClassUuid's defined Bluetooth forum.
+
+
+QtNfc
+-----
+
+ - Documentation:
+ * Added missing documentation to QQmlNdefRecord.
+ * General documentation fixes add.
+
+ - General:
+ * Added a new corkboard example displaying the content of NDEF text
+ records.
+ * A new NFC share API was added. The API provides sharing of NDEF
+ messages and arbitrary files via NFC and may potentially use other
+ communication protocols such as wifi or Bluetooth as part of its
+ implementation.
+
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+Android
+-------
+
+ - [QTBUG-33792] QtBluetooth has been ported to Android.
+
+BlackBerry 10:
+
+ - [QTBUG-36626] Fixed a memory leak in QBluetoothServer::listen().
+ - Fixed incomplete implementation of QBluetoothServer::close().
+ - Fixed wrong pairingStatus() returned by QBluetoothLocalDevice.
+ - Fixed accidental loss of remote device information in QBluetoothServer.
+ - Added incomplete implementation of QBluetooth::setMaxPendingConnections().
+ - Fixed always failing call to QBluetoothServerInfo::unregisterService().
+ - Fixed missing emission of ConnectedState by QBluetoothSocket.
+ - Fixed implementation of QBluetoothTransferManager::put() when using
+ together with a QFile.
+
+Bluez/Linux
+-------
+
+ - The handling of powered-off local Bluetooth adapters was improved.
+ - Fixed memory leaks in service and device discovery classes.
+ - Removed dead code from SDP discovery implementation.
+ - Fixed crash during service discovery.
+ - Fixed incorrect invocation of QBluetoothDiscoveryAgent where the
+ remote service address was incorrectly assumed to be the local Bt
+ adapter address. This prevented the detection of the remote service.
+ - Removed caching of QBluetoothSocket::localName() and peerName() values. Under
+ certain circumstances those functions returned wrong values.
+ - Fixed missing update of internal QBluetoothSocket::state during SDP discovery.
+ - Removed assertion during service discovery due to unknown SDP attribute.
+ - Prevented calls to QBluetoothSocket::connectToService() while the socket
+ is already in the ServiceLoockupState.
+ - Fixed failing call to QBluetoothServer::listen(QBluetoothAddress) if the passed
+ address was null.
+
+
+
diff --git a/examples/bluetooth/btchat/doc/src/btchat.qdoc b/examples/bluetooth/btchat/doc/src/btchat.qdoc
index 77f73fd1..a78b9ede 100644
--- a/examples/bluetooth/btchat/doc/src/btchat.qdoc
+++ b/examples/bluetooth/btchat/doc/src/btchat.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt local connectivty modules.
@@ -28,8 +28,9 @@
/*!
\example btchat
\title Bluetooth Chat Example
+ \brief An example showing communication through Bluetooth.
- The Bluetooth Chat example shows how to use the Qt Connectivity Bluetooth API to communicate
+ The Bluetooth Chat example shows how to use the \l{Qt Bluetooth} API to communicate
with another application on a remote device using Bluetooth.
\image btchat-example.png
@@ -38,6 +39,8 @@
application always acts as both a server and a client eliminating the need to determine who
should connect to whom.
+ \include examples-run.qdocinc
+
\section1 Chat Server
The chat server is implemented by the ChatServer class. The ChatServer class is declared as:
diff --git a/examples/bluetooth/btfiletransfer/doc/src/btfiletransfer.qdoc b/examples/bluetooth/btfiletransfer/doc/src/btfiletransfer.qdoc
index aeeffffb..53832725 100644
--- a/examples/bluetooth/btfiletransfer/doc/src/btfiletransfer.qdoc
+++ b/examples/bluetooth/btfiletransfer/doc/src/btfiletransfer.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt local connectivty modules.
@@ -28,6 +28,7 @@
/*!
\example btfiletransfer
\title Bluetooth File Transfer Example
+ \brief An example showing the use of Bluetooth Object Push Profile (OPP).
The Bluetooth File Transfer example is an application to transfer files
via a bluetooth connection. This example does not work on Android due to
@@ -35,4 +36,8 @@
\image btfiletransfer-example.png
+ \include examples-run.qdocinc
+
+ \sa {Qt Bluetooth}
+
*/
diff --git a/examples/bluetooth/btscanner/doc/src/btscanner.qdoc b/examples/bluetooth/btscanner/doc/src/btscanner.qdoc
index e67b761a..e4d28ee2 100644
--- a/examples/bluetooth/btscanner/doc/src/btscanner.qdoc
+++ b/examples/bluetooth/btscanner/doc/src/btscanner.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt local connectivty modules.
@@ -28,9 +28,14 @@
/*!
\example btscanner
\title Bluetooth Scanner Example
+ \brief An example showing how to locate Bluetooth devices.
- An example of how to locate Bluetooth devices.
+ An example showing how to locate Bluetooth devices.
\image btscanner-example.png
+ \include examples-run.qdocinc
+
+ \sa {Qt Bluetooth}
+
*/
diff --git a/examples/bluetooth/picturetransfer/doc/src/picturetransfer.qdoc b/examples/bluetooth/picturetransfer/doc/src/picturetransfer.qdoc
index 7a166121..3b0218d4 100644
--- a/examples/bluetooth/picturetransfer/doc/src/picturetransfer.qdoc
+++ b/examples/bluetooth/picturetransfer/doc/src/picturetransfer.qdoc
@@ -28,18 +28,20 @@ a/****************************************************************************
/*!
\example picturetransfer
\title QML Bluetooth Picture Push Example
+\brief An example showing the use Bluetooth Object Push Profile (OPP).
-The Bluetooth Picture Push example shows how to use the \l QBluetoothTransferManager
-API. The example transfers a local image to a remote device. Unfortunately this example cannot be used on
-Android as Qt does not support the Object Push Profile on this platform.
+The Bluetooth Picture Push example shows how to use the \l
+QBluetoothTransferManager API. The example transfers a local image to a remote
+device. Unfortunately this example cannot be used on Android as Qt does not
+support the Object Push Profile (OPP) on this platform.
-On the first user interface page the application scans for remote Bluetooth devices. The user must select
-the appropriate device to continue:
+On the first user interface page the application scans for remote Bluetooth
+devices. The user must select the appropriate device to continue:
\image opp-example-1.png
-The next page presents a list of image files on the device. The files must be located under
-\l QStandardPaths::PicturesLocation}:
+The next page presents a list of image files on the device. The files must be
+located under \l QStandardPaths::PicturesLocation}:
\image opp-example-2.png
@@ -47,29 +49,35 @@ Once the picture was selected the UI shows the progress of the file transfer:
\image opp-example-3.png
+\include examples-run.qdocinc
+
+\sa {Qt Bluetooth}
+
\section1 Device Discovery
-The device discovery uses the \l BluetoothDiscoveryModel to detect the remote devices. Each discovery is displayed
-as an entry in a list. Once a device was selected the device address is stored in the \c root element. More
-details about the \c root element will follow further below.
+The device discovery uses the \l BluetoothDiscoveryModel to detect the remote
+devices. Each discovery is displayed as an entry in a list. Once a device was
+selected the device address is stored in the \c root element. More details about
+the \c root element will follow further below.
\snippet picturetransfer/DeviceDiscovery.qml Discovery-1
\snippet picturetransfer/DeviceDiscovery.qml Discovery-2
\section1 File Selection
-The file is selected with the help of \l FolderListModel. Once again the selected file is stored in the \c root
-element:
+The file is selected with the help of \l FolderListModel. Once again the
+selected file is stored in the \c root element:
\snippet picturetransfer/PictureSelector.qml FileSelect-1
\snippet picturetransfer/PictureSelector.qml FileSelect-2
\snippet picturetransfer/PictureSelector.qml FileSelect-3
\snippet picturetransfer/PictureSelector.qml FileSelect-4
-\section1 The root element
+\section1 Root Element
-The already mentioned \c root element collects the necessary pieces of data for the picture transfer.
-Once the file name has been set it triggers the file transfer:
+The already mentioned \c root element collects the necessary pieces of data for
+the picture transfer. Once the file name has been set it triggers the file
+transfer:
\snippet picturetransfer/bttransfer.qml Root-1
@@ -77,7 +85,7 @@ Once the file name has been set it triggers the file transfer:
\snippet picturetransfer/bttransfer.qml Root-3
\snippet picturetransfer/bttransfer.qml Root-3
-\section1 The File Transfer
+\section1 File Transfer
The file transfer is implemented in C++:
diff --git a/examples/bluetooth/pingpong/doc/src/pingpong.qdoc b/examples/bluetooth/pingpong/doc/src/pingpong.qdoc
index df7fcc34..0e82a71a 100644
--- a/examples/bluetooth/pingpong/doc/src/pingpong.qdoc
+++ b/examples/bluetooth/pingpong/doc/src/pingpong.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
@@ -28,6 +28,7 @@
/*!
\example pingpong
\title Bluetooth QML Ping Pong example
+ \brief A QML example showing Bluetooth communication.
The Bluetooth QML Ping Pong example presents the socket communication between two
Bluetooth devices. The basic concept is the ping pong game where two players
@@ -35,6 +36,8 @@
\image intro.png
+ \include examples-run.qdocinc
+
At the beginning, the user selects the role. One device acts as a server and the second
one as a client. After selecting the role, adjustments to the screen size are done
(two devices might have different screen sizes). The server side starts a service named
@@ -77,4 +80,3 @@
\image intro1.png
*/
-
diff --git a/examples/bluetooth/scanner/doc/src/scanner.qdoc b/examples/bluetooth/scanner/doc/src/scanner.qdoc
index 62b9680c..f4e292a8 100644
--- a/examples/bluetooth/scanner/doc/src/scanner.qdoc
+++ b/examples/bluetooth/scanner/doc/src/scanner.qdoc
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
** Contact: http://www.qt-project.org/legal
**
@@ -28,6 +29,7 @@
/*!
\example scanner
\title QML Bluetooth Scanner Example
+\brief A QML example about locating Bluetooth devices.
This is an example on how to locate Bluetooth devices in QML.
@@ -50,4 +52,7 @@ from local cache information and may not always be complete and accurate. The pr
perform a minimal discovery are time constraints. A full service discovery can take up to two minutes.
Note that not every platform supports a minimal discovery. In such cases the API performs a full discovery.
+\include examples-run.qdocinc
+
+\sa {Qt Bluetooth}
*/
diff --git a/examples/nfc/annotatedurl/doc/src/annotatedurl.qdoc b/examples/nfc/annotatedurl/doc/src/annotatedurl.qdoc
index 2a84c8b3..08001fdf 100644
--- a/examples/nfc/annotatedurl/doc/src/annotatedurl.qdoc
+++ b/examples/nfc/annotatedurl/doc/src/annotatedurl.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt local connectivty modules.
@@ -28,10 +28,16 @@
/*!
\example annotatedurl
\title Annotated URL Example
+\brief An example showing reading from formatted NFC Data Exchange Format (NDEF) messages.
-The Annotated URL example displays the contents of specifically formatted NDEF messages read from
-an NFC Tag. The NDEF message should contain a URI record, an optional image/* MIME record, and one
-or more localized Text records.
+The Annotated URL example displays the contents of specifically formatted NFC
+Data Exchange Format (NDEF) messages read from an NFC Tag. The NDEF message
+should contain a URI record, an optional \c image/* MIME record, and one or more
+localized Text records.
\image annotatedurl.png
+
+\include examples-run.qdocinc
+
+\sa {Qt NFC}
*/
diff --git a/examples/nfc/corkboard/doc/src/corkboard.qdoc b/examples/nfc/corkboard/doc/src/corkboard.qdoc
index 4027fc26..db982d2e 100644
--- a/examples/nfc/corkboard/doc/src/corkboard.qdoc
+++ b/examples/nfc/corkboard/doc/src/corkboard.qdoc
@@ -28,12 +28,17 @@
/*!
\example corkboard
\title QML CorkBoard Example
+\brief A QML example about displaying NFC Data Exchange Format (NDEF) messages.
The QML CorkBoard example displays the contents of NDEF messages read from an
NFC Tag. Each newly detected NDEF message is added to the corkboard and can be
-dragged into an arbitrary position on the board. The corkboard has a "Personal"
-and "Work" space. The workspace can be changed by sliding left or right.
+dragged into an arbitrary position on the board. The corkboard has a \e Personal
+and \e Work space. The workspace can be changed by sliding left or right.
\image corkboard.png
+\include examples-run.qdocinc
+
+\sa {Qt NFC}
+
*/
diff --git a/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc b/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc
index 346feb8e..3ebc5525 100644
--- a/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc
+++ b/examples/nfc/ndefeditor/doc/src/ndefeditor.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt local connectivty modules.
@@ -28,9 +28,15 @@
/*!
\example ndefeditor
\title NDEF Editor Example
+\brief An example about reading and writing NFC Data Exchange Format (NDEF) messages to NFC Forum Tags.
-The NDEF Editor example reads and writes NDEF messages to NFC Forum Tags. NDEF messages can be
-composed by adding records of supported types.
+The NDEF Editor example reads and writes NFC Data Exchange Format (NDEF)
+messages to NFC Forum Tags. NDEF messages can be composed by adding records of
+supported types.
\image ndefeditor.png
+
+\include examples-run.qdocinc
+
+\sa {Qt NFC}
*/
diff --git a/examples/nfc/poster/doc/src/poster.qdoc b/examples/nfc/poster/doc/src/poster.qdoc
index 125afd95..05cfd6d3 100644
--- a/examples/nfc/poster/doc/src/poster.qdoc
+++ b/examples/nfc/poster/doc/src/poster.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt local connectivty modules.
@@ -28,11 +28,16 @@
/*!
\example poster
\title QML Poster Example
+\brief A QML example about reading and displaying NFC Data Exchange Format (NDEF) messages.
-The QML Poster example displays the contents of specifically formatted NDEF messages read from an
-NFC Tag. The NDEF message should contain a URI record, an optional image/* MIME record, and one
-or more localized Text records.
+The QML Poster example displays the contents of specifically formatted NFC Data
+Exchange Format (NDEF) messages read from an NFC Tag. The NDEF message should
+contain a URI record, an optional \c image/* MIME record, and one or more
+localized Text records.
\image qml-poster-example.png
+\include examples-run.qdocinc
+
+\sa {Qt NFC}
*/
diff --git a/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp b/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp
index 0a3f97f9..87564ce6 100644
--- a/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp
+++ b/src/bluetooth/android/servicediscoverybroadcastreceiver.cpp
@@ -76,8 +76,10 @@ void ServiceDiscoveryBroadcastReceiver::onReceive(JNIEnv *env, jobject context,
"getParcelableArrayExtra",
"(Ljava/lang/String;)[Landroid/os/Parcelable;",
keyExtra.object<jstring>());
- if (!parcelableUuids.isValid())
+ if (!parcelableUuids.isValid()) {
+ emit uuidFetchFinished(QBluetoothAddress(), QList<QBluetoothUuid>());
return;
+ }
const QList<QBluetoothUuid> result = ServiceDiscoveryBroadcastReceiver::convertParcelableArray(parcelableUuids);
keyExtra = valueForStaticField(JavaNames::BluetoothDevice, JavaNames::ExtraDevice);
@@ -89,6 +91,8 @@ void ServiceDiscoveryBroadcastReceiver::onReceive(JNIEnv *env, jobject context,
if (bluetoothDevice.isValid()) {
address = QBluetoothAddress(bluetoothDevice.callObjectMethod<jstring>("getAddress").toString());
emit uuidFetchFinished(address, result);
+ } else {
+ emit uuidFetchFinished(QBluetoothAddress(), QList<QBluetoothUuid>());
}
}
}
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
index 2e55d40e..2643d7a9 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
@@ -246,6 +246,12 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_processFetchedUuids(
if (discoveredDevices.count() == 0)
return;
+ //could not find any service for the current address/device -> go to next one
+ if (address.isNull() || uuids.isEmpty()) {
+ _q_serviceDiscoveryFinished();
+ return;
+ }
+
if (QT_BT_ANDROID().isDebugEnabled()) {
qCDebug(QT_BT_ANDROID) << "Found UUID for" << address.toString()
<< "\ncount: " << uuids.count();
@@ -416,7 +422,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::populateDiscoveredServices(const QB
}
for (int i = 0; i < uuids.count(); i++) {
- if (i == sppIndex) //skip SPP service class id
+ if (i == sppIndex && !customUuids.isEmpty())
continue;
QBluetoothServiceInfo serviceInfo;
@@ -444,6 +450,21 @@ void QBluetoothServiceDiscoveryAgentPrivate::populateDiscoveredServices(const QB
serviceInfo.setServiceName(QBluetoothServiceDiscoveryAgent::tr("Serial Port Profile"));
serviceInfo.setServiceUuid(uuids.at(i));
+ } else if (sppIndex == i && customUuids.isEmpty()) {
+ //set rfcomm protocol
+ QBluetoothServiceInfo::Sequence protocol;
+ protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Rfcomm))
+ << QVariant::fromValue(0);
+ protocolDescriptorList.append(QVariant::fromValue(protocol));
+
+ QBluetoothServiceInfo::Sequence classId;
+ classId << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort));
+ serviceInfo.setAttribute(QBluetoothServiceInfo::BluetoothProfileDescriptorList,
+ classId);
+
+ //also we need to set the custom uuid to the SPP uuid
+ //otherwise QBluetoothSocket::connectToService() would fail due to a missing service uuid
+ serviceInfo.setServiceUuid(uuids.at(i));
} else if (customUuids.contains(i)) {
//custom uuid but no serial port
serviceInfo.setServiceUuid(uuids.at(i));