summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/bluetooth/btscanner/device.cpp11
-rw-r--r--examples/bluetooth/btscanner/device.h1
-rw-r--r--examples/bluetooth/btscanner/device.ui10
-rw-r--r--src/bluetooth/ApiChangesQt6.txt6
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent.cpp42
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent.h12
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp1
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp1
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_darwin.mm1
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp3
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_p.h1
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp3
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp3
-rw-r--r--tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp55
14 files changed, 9 insertions, 141 deletions
diff --git a/examples/bluetooth/btscanner/device.cpp b/examples/bluetooth/btscanner/device.cpp
index b6a07db4..bf882265 100644
--- a/examples/bluetooth/btscanner/device.cpp
+++ b/examples/bluetooth/btscanner/device.cpp
@@ -74,7 +74,6 @@ DeviceDiscoveryDialog::DeviceDiscoveryDialog(QWidget *parent)
discoveryAgent = new QBluetoothDeviceDiscoveryAgent();
- connect(ui->inquiryType, SIGNAL(toggled(bool)), this, SLOT(setGeneralUnlimited(bool)));
connect(ui->scan, SIGNAL(clicked()), this, SLOT(startScan()));
connect(discoveryAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)),
@@ -122,21 +121,11 @@ void DeviceDiscoveryDialog::startScan()
{
discoveryAgent->start();
ui->scan->setEnabled(false);
- ui->inquiryType->setEnabled(false);
}
void DeviceDiscoveryDialog::scanFinished()
{
ui->scan->setEnabled(true);
- ui->inquiryType->setEnabled(true);
-}
-
-void DeviceDiscoveryDialog::setGeneralUnlimited(bool unlimited)
-{
- if (unlimited)
- discoveryAgent->setInquiryType(QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry);
- else
- discoveryAgent->setInquiryType(QBluetoothDeviceDiscoveryAgent::LimitedInquiry);
}
void DeviceDiscoveryDialog::itemActivated(QListWidgetItem *item)
diff --git a/examples/bluetooth/btscanner/device.h b/examples/bluetooth/btscanner/device.h
index 35dc7965..15082141 100644
--- a/examples/bluetooth/btscanner/device.h
+++ b/examples/bluetooth/btscanner/device.h
@@ -79,7 +79,6 @@ public slots:
private slots:
void startScan();
void scanFinished();
- void setGeneralUnlimited(bool unlimited);
void itemActivated(QListWidgetItem *item);
void hostModeStateChanged(QBluetoothLocalDevice::HostMode);
diff --git a/examples/bluetooth/btscanner/device.ui b/examples/bluetooth/btscanner/device.ui
index 1f62dd96..fa81c5cb 100644
--- a/examples/bluetooth/btscanner/device.ui
+++ b/examples/bluetooth/btscanner/device.ui
@@ -47,16 +47,6 @@
</widget>
</item>
<item>
- <widget class="QCheckBox" name="inquiryType">
- <property name="text">
- <string>General Unlimited Inquiry</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="scan">
diff --git a/src/bluetooth/ApiChangesQt6.txt b/src/bluetooth/ApiChangesQt6.txt
index 95d8b69a..94e59856 100644
--- a/src/bluetooth/ApiChangesQt6.txt
+++ b/src/bluetooth/ApiChangesQt6.txt
@@ -7,6 +7,12 @@ General
- qbluetoothglobal.h was removed. qtbluetoothglobal. is the official header with the same purpose.
+QBluetoothDeviceDiscoveryAgent
+------------------------------
+
+ - QBluetoothDeviceDiscoveryAgent::inquiryType property and related setter/getter & enum were removed.
+ The API element was never implemented and/or supported.
+
QBluetoothDeviceInfo
--------------------
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
index f38f8994..64dad8e4 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
@@ -104,24 +104,6 @@ Q_DECLARE_LOGGING_CATEGORY(QT_BT)
*/
/*!
- \enum QBluetoothDeviceDiscoveryAgent::InquiryType
-
- This enum describes the inquiry type used while discovering Bluetooth devices.
-
- \value GeneralUnlimitedInquiry A general unlimited inquiry. Discovers all visible Bluetooth
- devices in the local vicinity.
- \value LimitedInquiry A limited inquiry discovers devices that are in limited
- inquiry mode.
-
- LimitedInquiry is not supported on all platforms. If it is requested on a platform that does not
- support it, GeneralUnlimitedInquiry will be used instead. Setting LimitedInquiry is useful
- for multi-player Bluetooth-based games that needs faster communication between the devices.
- The phone scans for devices in LimitedInquiry and Service Discovery is done on one or two devices
- to speed up the service scan. After the game has connected to the device it intended to,
- the device returns to GeneralUnlimitedInquiry.
-*/
-
-/*!
\enum QBluetoothDeviceDiscoveryAgent::DiscoveryMethod
This enum descibes the type of discovery method employed by the QBluetoothDeviceDiscoveryAgent.
@@ -252,30 +234,6 @@ QBluetoothDeviceDiscoveryAgent::~QBluetoothDeviceDiscoveryAgent()
}
/*!
- \property QBluetoothDeviceDiscoveryAgent::inquiryType
- \brief type of inquiry scan to be used while discovering devices
-
- This property affects the type of inquiry scan which is performed while discovering devices.
-
- By default, this property is set to GeneralUnlimitedInquiry.
-
- Not all platforms support LimitedInquiry.
-
- \sa InquiryType
-*/
-QBluetoothDeviceDiscoveryAgent::InquiryType QBluetoothDeviceDiscoveryAgent::inquiryType() const
-{
- Q_D(const QBluetoothDeviceDiscoveryAgent);
- return d->inquiryType;
-}
-
-void QBluetoothDeviceDiscoveryAgent::setInquiryType(QBluetoothDeviceDiscoveryAgent::InquiryType type)
-{
- Q_D(QBluetoothDeviceDiscoveryAgent);
- d->inquiryType = type;
-}
-
-/*!
Returns a list of all discovered Bluetooth devices.
*/
QList<QBluetoothDeviceInfo> QBluetoothDeviceDiscoveryAgent::discoveredDevices() const
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.h b/src/bluetooth/qbluetoothdevicediscoveryagent.h
index e566d895..3278baf9 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent.h
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent.h
@@ -54,8 +54,6 @@ class QBluetoothDeviceDiscoveryAgentPrivate;
class Q_BLUETOOTH_EXPORT QBluetoothDeviceDiscoveryAgent : public QObject
{
Q_OBJECT
- Q_PROPERTY(QBluetoothDeviceDiscoveryAgent::InquiryType inquiryType
- READ inquiryType WRITE setInquiryType)
public:
// FIXME: add more errors
@@ -71,12 +69,6 @@ public:
};
Q_ENUM(Error)
- enum InquiryType {
- GeneralUnlimitedInquiry,
- LimitedInquiry
- };
- Q_ENUM(InquiryType)
-
enum DiscoveryMethod
{
NoMethod = 0x0,
@@ -91,10 +83,6 @@ public:
QObject *parent = nullptr);
~QBluetoothDeviceDiscoveryAgent();
- // TODO Remove inquiry type in Qt 6 -> not really used anywhere
- QBluetoothDeviceDiscoveryAgent::InquiryType inquiryType() const;
- void setInquiryType(QBluetoothDeviceDiscoveryAgent::InquiryType type);
-
bool isActive() const;
Error error() const;
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
index fd17faee..5338a665 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
@@ -59,7 +59,6 @@ enum {
QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(
const QBluetoothAddress &deviceAdapter, QBluetoothDeviceDiscoveryAgent *parent) :
- inquiryType(QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry),
lastError(QBluetoothDeviceDiscoveryAgent::NoError),
receiver(0),
m_adapterAddress(deviceAdapter),
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
index 243be3b2..7053df82 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
@@ -92,7 +92,6 @@ QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(
extendedDiscoveryTimer.setInterval(10000);
extendedDiscoveryTimer.setSingleShot(true);
}
- inquiryType = QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry;
}
QBluetoothDeviceDiscoveryAgentPrivate::~QBluetoothDeviceDiscoveryAgentPrivate()
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_darwin.mm b/src/bluetooth/qbluetoothdevicediscoveryagent_darwin.mm
index 9053e564..283ee631 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_darwin.mm
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_darwin.mm
@@ -94,7 +94,6 @@ using LEInquiryObjC = QT_MANGLE_NAMESPACE(DarwinBTLEDeviceInquiry);
QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(const QBluetoothAddress &adapter,
QBluetoothDeviceDiscoveryAgent *q) :
- inquiryType(QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry),
lastError(QBluetoothDeviceDiscoveryAgent::NoError),
agentState(NonActive),
adapterAddress(adapter),
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
index e3646db9..6d92b2c7 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
@@ -51,8 +51,7 @@ QT_BEGIN_NAMESPACE
QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(
const QBluetoothAddress &deviceAdapter,
QBluetoothDeviceDiscoveryAgent *parent)
- : inquiryType(QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry),
- lastError(QBluetoothDeviceDiscoveryAgent::NoError),
+ : lastError(QBluetoothDeviceDiscoveryAgent::NoError),
lowEnergySearchTimeout(-1),
q_ptr(parent)
{
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
index 0bff7138..6a8d8429 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
@@ -150,7 +150,6 @@ public:
private:
QList<QBluetoothDeviceInfo> discoveredDevices;
- QBluetoothDeviceDiscoveryAgent::InquiryType inquiryType;
QBluetoothDeviceDiscoveryAgent::Error lastError;
QString errorString;
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
index eec76173..c7501bfd 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
@@ -303,8 +303,7 @@ QString QBluetoothDeviceDiscoveryAgentPrivate::discoveredLeDeviceSystemPath(
QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(
const QBluetoothAddress &deviceAdapter,
QBluetoothDeviceDiscoveryAgent *parent)
- : inquiryType(QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry)
- , lastError(QBluetoothDeviceDiscoveryAgent::NoError)
+ : lastError(QBluetoothDeviceDiscoveryAgent::NoError)
, adapterAddress(deviceAdapter)
, pendingCancel(false)
, pendingStart(false)
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
index 01b67921..edc02a28 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
@@ -814,8 +814,7 @@ QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(
const QBluetoothAddress &deviceAdapter,
QBluetoothDeviceDiscoveryAgent *parent)
- : inquiryType(QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry),
- lastError(QBluetoothDeviceDiscoveryAgent::NoError),
+ : lastError(QBluetoothDeviceDiscoveryAgent::NoError),
lowEnergySearchTimeout(25000),
q_ptr(parent),
leScanTimer(0)
diff --git a/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp b/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp
index cbce5042..cf2b1004 100644
--- a/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp
+++ b/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp
@@ -70,13 +70,10 @@ public slots:
private slots:
void initTestCase();
- void tst_properties();
-
void tst_invalidBtAddress();
void tst_startStopDeviceDiscoveries();
- void tst_deviceDiscovery_data();
void tst_deviceDiscovery();
void tst_discoveryTimeout();
@@ -132,7 +129,6 @@ static void myCustomMessageHandler(QtMsgType type,
void tst_QBluetoothDeviceDiscoveryAgent::initTestCase()
{
qRegisterMetaType<QBluetoothDeviceInfo>();
- qRegisterMetaType<QBluetoothDeviceDiscoveryAgent::InquiryType>();
#if QT_CONFIG(bluez)
// To distinguish Bluez 4 and 5 we peek into the debug output
@@ -173,17 +169,6 @@ void tst_QBluetoothDeviceDiscoveryAgent::initTestCase()
delete device;
}
-void tst_QBluetoothDeviceDiscoveryAgent::tst_properties()
-{
- QBluetoothDeviceDiscoveryAgent discoveryAgent;
-
- QCOMPARE(discoveryAgent.inquiryType(), QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry);
- discoveryAgent.setInquiryType(QBluetoothDeviceDiscoveryAgent::LimitedInquiry);
- QCOMPARE(discoveryAgent.inquiryType(), QBluetoothDeviceDiscoveryAgent::LimitedInquiry);
- discoveryAgent.setInquiryType(QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry);
- QCOMPARE(discoveryAgent.inquiryType(), QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry);
-}
-
void tst_QBluetoothDeviceDiscoveryAgent::tst_invalidBtAddress()
{
QBluetoothDeviceDiscoveryAgent *discoveryAgent = new QBluetoothDeviceDiscoveryAgent(QBluetoothAddress("11:11:11:11:11:11"));
@@ -209,7 +194,6 @@ void tst_QBluetoothDeviceDiscoveryAgent::deviceDiscoveryDebug(const QBluetoothDe
void tst_QBluetoothDeviceDiscoveryAgent::tst_startStopDeviceDiscoveries()
{
- QBluetoothDeviceDiscoveryAgent::InquiryType inquiryType = QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry;
QBluetoothDeviceDiscoveryAgent discoveryAgent;
QVERIFY(discoveryAgent.error() == discoveryAgent.NoError);
@@ -222,7 +206,6 @@ void tst_QBluetoothDeviceDiscoveryAgent::tst_startStopDeviceDiscoveries()
QSignalSpy errorSpy(&discoveryAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error)));
// Starting case 1: start-stop, expecting cancel signal
- discoveryAgent.setInquiryType(inquiryType);
// we should have no errors at this point.
QVERIFY(errorSpy.isEmpty());
@@ -372,32 +355,13 @@ void tst_QBluetoothDeviceDiscoveryAgent::finished()
qDebug() << "Finished called";
}
-void tst_QBluetoothDeviceDiscoveryAgent::tst_deviceDiscovery_data()
-{
- QTest::addColumn<QBluetoothDeviceDiscoveryAgent::InquiryType>("inquiryType");
-
- QTest::newRow("general unlimited inquiry") << QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry;
- QTest::newRow("limited inquiry") << QBluetoothDeviceDiscoveryAgent::LimitedInquiry;
-}
-
void tst_QBluetoothDeviceDiscoveryAgent::tst_deviceDiscovery()
{
{
- QFETCH(QBluetoothDeviceDiscoveryAgent::InquiryType, inquiryType);
-
//Run test in case of multiple Bluetooth adapters
QBluetoothLocalDevice localDevice;
//We will use default adapter if there is no other adapter
QBluetoothAddress address = localDevice.address();
- int numberOfAdapters = (localDevice.allDevices()).size();
- QList<QBluetoothAddress> addresses;
- if (numberOfAdapters > 1) {
-
- for (int i=0; i < numberOfAdapters; i++) {
- addresses.append(((QBluetoothHostInfo)localDevice.allDevices().at(i)).address());
- }
- address = (QBluetoothAddress)addresses.at(0);
- }
QBluetoothDeviceDiscoveryAgent discoveryAgent(address);
QVERIFY(discoveryAgent.error() == discoveryAgent.NoError);
@@ -413,7 +377,6 @@ void tst_QBluetoothDeviceDiscoveryAgent::tst_deviceDiscovery()
// connect(&discoveryAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)),
// this, SLOT(deviceDiscoveryDebug(QBluetoothDeviceInfo)));
- discoveryAgent.setInquiryType(inquiryType);
discoveryAgent.start();
if (!errorSpy.isEmpty()) {
QCOMPARE(noOfLocalDevices, 0);
@@ -457,30 +420,12 @@ void tst_QBluetoothDeviceDiscoveryAgent::tst_deviceDiscovery()
if (!remoteDevice.isNull())
QVERIFY(discoveredSpy.count() > 0);
- int counter = 0;
// All returned QBluetoothDeviceInfo should be valid.
while (!discoveredSpy.isEmpty()) {
const QBluetoothDeviceInfo info =
qvariant_cast<QBluetoothDeviceInfo>(discoveredSpy.takeFirst().at(0));
QVERIFY(info.isValid());
- qDebug() << "Discovered device:" << info.address().toString() << info.name();
-
- if (numberOfAdapters > 1) {
- for (int i= 1; i < numberOfAdapters; i++) {
- if (info.address().toString() == addresses[i].toString())
- counter++;
- }
- }
}
-#if defined(Q_OS_IOS) || defined(Q_OS_TVOS) || QT_CONFIG(winrt_bt)
- //On iOS/WinRT, we do not have access to the local device/adapter, numberOfAdapters is 0,
- //so we skip this test at all.
- QSKIP("iOS/WinRT: no local Bluetooth device available. Skipping remaining part of test.");
-#endif
-
- //For multiple Bluetooth adapter do the check only for GeneralUnlimitedInquiry.
- if (!(inquiryType == QBluetoothDeviceDiscoveryAgent::LimitedInquiry))
- QVERIFY((numberOfAdapters-1) == counter);
}
}