diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-11-27 18:28:25 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-11-27 18:28:25 +0100 |
commit | 3964a4a29d1237404bf554bb0b64d7de1d49155c (patch) | |
tree | 927c389d624826e08a1e293ef3fa3d2d4dc39ee1 /src | |
parent | 0e3046f29b0e86affeb33c8f6687618cfd1dfae2 (diff) | |
parent | 73563f571e6dfd37a0e4cf90f4679d9901b9233c (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: I6c1eabeea1b3397803e285d13cef147220ff5aa4
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/bluez/hcimanager.cpp | 1 | ||||
-rw-r--r-- | src/bluetooth/qbluetooth.cpp | 1 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothtransferreply.cpp | 3 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothuuid.cpp | 7 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycontroller_bluez.cpp | 11 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycontroller_p.h | 2 |
6 files changed, 23 insertions, 2 deletions
diff --git a/src/bluetooth/bluez/hcimanager.cpp b/src/bluetooth/bluez/hcimanager.cpp index 449f0825..17d54a4b 100644 --- a/src/bluetooth/bluez/hcimanager.cpp +++ b/src/bluetooth/bluez/hcimanager.cpp @@ -150,6 +150,7 @@ bool HciManager::monitorEvent(HciManager::HciEvent event) return false; // this event is already enabled + // TODO runningEvents does not seem to be used if (runningEvents.contains(event)) return true; diff --git a/src/bluetooth/qbluetooth.cpp b/src/bluetooth/qbluetooth.cpp index d418adc1..ea3900e1 100644 --- a/src/bluetooth/qbluetooth.cpp +++ b/src/bluetooth/qbluetooth.cpp @@ -72,6 +72,7 @@ namespace QBluetooth { /*! \typedef QLowEnergyHandle \relates QBluetooth + \since 5.4 Typedef for Bluetooth Low Energy ATT attribute handles. */ diff --git a/src/bluetooth/qbluetoothtransferreply.cpp b/src/bluetooth/qbluetoothtransferreply.cpp index 6c5c83a2..af1bf828 100644 --- a/src/bluetooth/qbluetoothtransferreply.cpp +++ b/src/bluetooth/qbluetoothtransferreply.cpp @@ -64,7 +64,8 @@ QT_BEGIN_NAMESPACE \value UserCanceledTransferError User terminated the transfer. \value IODeviceNotReadableError File was not open before initiating the sending command. \value ResourceBusyError Unable to access the resource.. - \value SessionError An error occurred during the handling of the session. + \value SessionError An error occurred during the handling of the session. This enum was + introduced by Qt 5.4. */ diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp index 3883b47b..f4840428 100644 --- a/src/bluetooth/qbluetoothuuid.cpp +++ b/src/bluetooth/qbluetoothuuid.cpp @@ -99,7 +99,8 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34 it can be used as a value for either of the above service attributes. Such a dual use has historical reasons but is no longer permissible for newer UUIDs. - The list below explicitly states as what type each UUID shall be used. + The list below explicitly states as what type each UUID shall be used. Bluetooth Low Energy related values + starting with 0x18 were introduced by Qt 5.4 \value ServiceDiscoveryServer Service discovery server UUID (service) \value BrowseGroupDescriptor Browser group descriptor (service) @@ -214,6 +215,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34 /*! \enum QBluetoothUuid::CharacteristicType + \since 5.4 This enum is a convienience type for Bluetooth low energy service characteristics class UUIDs. Values of this type will be implicitly converted into a QBluetoothUuid when necessary. @@ -369,6 +371,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34 /*! \enum QBluetoothUuid::DescriptorType + \since 5.4 Descriptors are attributes that describe Bluetooth Low Energy characteristic values. @@ -437,6 +440,7 @@ QBluetoothUuid::QBluetoothUuid(ServiceClassUuid uuid) /*! Constructs a new Bluetooth UUID from the characteristic type \a uuid. + \since 5.4 */ QBluetoothUuid::QBluetoothUuid(CharacteristicType uuid) : QUuid(uuid, baseUuid()->data2, baseUuid()->data3, baseUuid()->data4[0], baseUuid()->data4[1], @@ -447,6 +451,7 @@ QBluetoothUuid::QBluetoothUuid(CharacteristicType uuid) /*! Constructs a new Bluetooth UUID from the descriptor type \a uuid. + \since 5.4 */ QBluetoothUuid::QBluetoothUuid(DescriptorType uuid) : QUuid(uuid, baseUuid()->data2, baseUuid()->data3, baseUuid()->data4[0], baseUuid()->data4[1], diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp index 51855889..55acfc36 100644 --- a/src/bluetooth/qlowenergycontroller_bluez.cpp +++ b/src/bluetooth/qlowenergycontroller_bluez.cpp @@ -277,6 +277,7 @@ void QLowEnergyControllerPrivate::disconnectFromDevice() { setState(QLowEnergyController::ClosingState); l2cpSocket->close(); + resetController(); } void QLowEnergyControllerPrivate::l2cpDisconnected() @@ -312,9 +313,19 @@ void QLowEnergyControllerPrivate::l2cpErrorChanged(QBluetoothSocket::SocketError } invalidateServices(); + resetController(); setState(QLowEnergyController::UnconnectedState); } + +void QLowEnergyControllerPrivate::resetController() +{ + openRequests.clear(); + requestPending = false; + encryptionChangePending = false; + securityLevelValue = -1; +} + void QLowEnergyControllerPrivate::l2cpReadyRead() { const QByteArray reply = l2cpSocket->readAll(); diff --git a/src/bluetooth/qlowenergycontroller_p.h b/src/bluetooth/qlowenergycontroller_p.h index add92b43..6234b57f 100644 --- a/src/bluetooth/qlowenergycontroller_p.h +++ b/src/bluetooth/qlowenergycontroller_p.h @@ -183,6 +183,8 @@ private: const QByteArray &newValue, quint16 offset); bool increaseEncryptLevelfRequired(quint8 errorCode); + void resetController(); + private slots: void l2cpConnected(); void l2cpDisconnected(); |