summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-10-30 12:36:58 +0100
committerAlex Blasche <alexander.blasche@digia.com>2014-10-30 15:17:30 +0100
commitca3dc0a8d296c82f584c4c028d8dbc586c896300 (patch)
tree5705fee106c7ec1663cac0a4cd0ec93acf823564 /src
parenta6c18d1babb2b38ade3d7a67c0a903701ef3ebf2 (diff)
Add QBLuetoothDeviceDiscoveryAgent::UnsupportedPlatformError
iOS does not support classic Bluetooth device discovery. However since iOS 5.0 it is possible to search for Bluetooth Low Energy devices. On pre 5.0 devices tLE scan is not possible and this error enum is going to be used. In addition the enum is utilized by the default backend which is used on unsupported Bluetooth platforms. [ChangeLog][QtBluetooth][QBluetoothDeviceDiscoveryAgent] A new UnsupportedPlatformError enum value added. Change-Id: I74b85782ba1e8ac55798171151b364d5dc0aa79f Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent.cpp4
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent.h1
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp1
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp13
4 files changed, 12 insertions, 7 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
index b92e9c72..ca8e701c 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
@@ -68,6 +68,10 @@ QT_BEGIN_NAMESPACE
\value InputOutputError Writing or reading from the device resulted in an error.
\value InvalidBluetoothAdapterError The passed local adapter address does not match the physical
adapter address of any local Bluetooth device.
+ \value UnsupportedPlatformError Device discovery is not possible or implemented on the current
+ platform. The error is set in response to a call to \l start().
+ An example for such cases are iOS versions below 5.0 which do not support
+ Bluetooth device search at all. This value was introduced by Qt 5.5.
\value UnknownError An unknown error has occurred.
*/
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.h b/src/bluetooth/qbluetoothdevicediscoveryagent.h
index 4638a4f2..f516bcec 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent.h
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent.h
@@ -58,6 +58,7 @@ public:
InputOutputError,
PoweredOffError,
InvalidBluetoothAdapterError,
+ UnsupportedPlatformError,
UnknownError = 100 // New errors must be added before Unknown error
};
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
index 28865d9c..93b7c7d4 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_android.cpp
@@ -54,7 +54,6 @@ QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(
const QBluetoothAddress &deviceAdapter, QBluetoothDeviceDiscoveryAgent *parent) :
inquiryType(QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry),
lastError(QBluetoothDeviceDiscoveryAgent::NoError),
- errorString(QStringLiteral()),
receiver(0),
m_adapterAddress(deviceAdapter),
m_active(NoScanActive),
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
index c89c2d37..bacfeee1 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp
@@ -43,11 +43,11 @@ QT_BEGIN_NAMESPACE
QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(
const QBluetoothAddress &deviceAdapter,
QBluetoothDeviceDiscoveryAgent *parent)
- : q_ptr(parent)
+ : inquiryType(QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry),
+ lastError(QBluetoothDeviceDiscoveryAgent::NoError),
+ q_ptr(parent)
{
Q_UNUSED(deviceAdapter);
- inquiryType = QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry;
- lastError = QBluetoothDeviceDiscoveryAgent::NoError;
}
QBluetoothDeviceDiscoveryAgentPrivate::~QBluetoothDeviceDiscoveryAgentPrivate()
@@ -62,9 +62,10 @@ bool QBluetoothDeviceDiscoveryAgentPrivate::isActive() const
void QBluetoothDeviceDiscoveryAgentPrivate::start()
{
Q_Q(QBluetoothDeviceDiscoveryAgent);
- lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError;
- errorString = QBluetoothDeviceDiscoveryAgent::tr("No Bluetooth device available");
- emit q->error(QBluetoothDeviceDiscoveryAgent::InputOutputError);
+ lastError = QBluetoothDeviceDiscoveryAgent::UnsupportedPlatformError;
+ errorString = QBluetoothDeviceDiscoveryAgent::tr("Device discovery on this platform not support");
+
+ emit q->error(lastError);
}
void QBluetoothDeviceDiscoveryAgentPrivate::stop()