summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothlocaldevice.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-02-10 15:37:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-13 09:47:27 +0100
commit173d16efb54ccc152f19afb9b1c2a87915fb414b (patch)
treef07ce85ba2cb973e3c08f3ed84252d92ee1c16de /src/bluetooth/qbluetoothlocaldevice.cpp
parentdd75b1f776695006ca96fd43f995c3ba0549b968 (diff)
Port QtBluetooth to Android
This is a feature merge to dev targeting Qt 5.3. Known issues: -QTBUG-36754: QBluetoothServer::close() crashes -QTBUG-36763: QBluetothTransferManager port to Android not possible -QTBUG-36764: Improve QBluetoothLocalDevice::connectedDevices() -QTBUG-36810: Remove direct use of Android action strings The above issues and some other minor TODO's will be addressed until final release time. Task-number: QTBUG-33792 [ChangeLog][QtBluetooth][Android] QtBluetooth has been ported to Android. Change-Id: I31ba83e3b7d6aa68e7258b7e43235de7d1a6e68a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice.cpp')
-rw-r--r--src/bluetooth/qbluetoothlocaldevice.cpp39
1 files changed, 32 insertions, 7 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice.cpp b/src/bluetooth/qbluetoothlocaldevice.cpp
index fe13a2de..e299ab71 100644
--- a/src/bluetooth/qbluetoothlocaldevice.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice.cpp
@@ -92,12 +92,13 @@ QT_BEGIN_NAMESPACE
if they have previously been paired with it or otherwise know its address. This powers up the
device if it was powered off.
\value HostDiscoverable Remote Bluetooth devices can discover the presence of the local
- Bluetooth device. The device will also be connectable, and powered on.
+ Bluetooth device. The device will also be connectable, and powered on. On Android, this mode can only be active
+ for a maximum of 5 minutes.
\value HostDiscoverableLimitedInquiry Remote Bluetooth devices can discover the presence of the local
Bluetooth device when performing a limited inquiry. This should be used for locating services that are
only made discoverable for a limited period of time. This can speed up discovery between gaming devices,
as service discovery can be skipped on devices not in LimitedInquiry mode. In this mode, the device will
- be connectable and powered on, if required.
+ be connectable and powered on, if required. This mode is is not supported on Android.
*/
@@ -190,21 +191,36 @@ bool QBluetoothLocalDevice::isValid() const
\fn QBluetoothLocalDevice::deviceConnected(const QBluetoothAddress &address)
\since 5.3
- A device with \a address is connected with this device.
+ This signal is emitted when the local device establishes a connection to a remote device
+ with \a address.
+
+ \sa deviceDisconnected(), connectedDevices()
*/
/*!
\fn QBluetoothLocalDevice::deviceDisconnected(const QBluetoothAddress &address)
\since 5.3
- A device with \a address is disconnected from this device.
+ This signal is emitted when the local device disconnects from a remote Bluetooth device
+ with \a address.
+
+ \sa deviceConnected(), connectedDevices()
*/
/*!
\fn QList<QBluetoothAddress> QBluetoothLocalDevice::connectedDevices() const
\since 5.3
- Returns the list of connected devices.
+ Returns the list of connected devices. This list is different from the list of currently
+ paired devices.
+
+ On Android it is not possible to retrieve a list of connected devices. It is only possible to
+ listen to (dis)connect changes. For convenience, this class monitors all connect
+ and disconnect events since its instanciation and returns the current list when calling this function.
+ Therefore it is possible that this function returns an empty list shortly after creating an
+ instance.
+
+ \sa deviceConnected(), deviceDisconnected()
*/
/*!
@@ -218,8 +234,12 @@ bool QBluetoothLocalDevice::isValid() const
\fn QBluetoothLocalDevice::pairingDisplayConfirmation(const QBluetoothAddress &address, QString pin)
Signal by some platforms to display a pairing confirmation dialog for \a address. The user
- is asked to confirm the \a pin is the same on both devices. QBluetoothLocalDevice::pairingConfirmation(bool)
+ is asked to confirm the \a pin is the same on both devices. The \l pairingConfirmation() function
must be called to indicate if the user accepts or rejects the displayed pin.
+
+ This signal is only emitted for pairing requests issues by calling \l requestPairing().
+
+ \sa pairingConfirmation()
*/
/*!
@@ -227,6 +247,8 @@ bool QBluetoothLocalDevice::isValid() const
To be called after getting a pairingDisplayConfirmation(). The \a accept parameter either
accepts the pairing or rejects it.
+
+ Accepting a pairing always refers to the last pairing request issued via \l requestPairing().
*/
/*!
@@ -234,6 +256,8 @@ bool QBluetoothLocalDevice::isValid() const
Signal by some platforms to display the \a pin to the user for \a address. The pin is automatically
generated, and does not need to be confirmed.
+
+ This signal is only emitted for pairing requests issues by calling \l requestPairing().
*/
/*!
@@ -249,7 +273,8 @@ bool QBluetoothLocalDevice::isValid() const
Pairing or unpairing has completed with \a address. Current pairing status is in \a pairing.
If the pairing request was not successful, this signal will not be emitted. The error() signal
- is emitted if the pairing request failed.
+ is emitted if the pairing request failed. The signal is only ever emitted for pairing requests
+ which have previously requested by calling \l requestPairing() of the current object instance.
*/
/*!