From 59ae3cc2ac7baee7e9df1e6ceffcfc882fbe6121 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Tue, 24 Oct 2017 16:46:03 +0200 Subject: Introduce Base class for QLowEnergyControllerPrivate This permits alternative implementations selectable at runtime. Currently this is only used by Bluez. Change-Id: I3ddeb7f888f3b09bdc62f10d5b9a36320500f329 Reviewed-by: Timur Pocheptsov --- src/bluetooth/qlowenergycontroller_p.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/bluetooth/qlowenergycontroller_p.cpp') diff --git a/src/bluetooth/qlowenergycontroller_p.cpp b/src/bluetooth/qlowenergycontroller_p.cpp index 27d16093..5c82c1fe 100644 --- a/src/bluetooth/qlowenergycontroller_p.cpp +++ b/src/bluetooth/qlowenergycontroller_p.cpp @@ -45,9 +45,7 @@ QT_BEGIN_NAMESPACE QLowEnergyControllerPrivate::QLowEnergyControllerPrivate() - : QObject(), - state(QLowEnergyController::UnconnectedState), - error(QLowEnergyController::NoError), + : QLowEnergyControllerPrivateBase(), lastLocalHandle(0) { #ifndef QT_IOS_BLUETOOTH -- cgit v1.2.3 From fbf36811672de79f2a648af97ca73d6c0e3b1608 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 25 Oct 2017 14:49:47 +0200 Subject: Rename various QLEControllerPrivate classes The base class is renamed to QLEControllerPrivate and the existing QLEControllerPrivate becomes QLEControllerPrivateCommon. This is necessary to re-enable Q_DECLARE_PRIVATE. The macro uses by convention the "Private" class prefix which is currently broken because not every implementation uses QLEControllerPrivate as d-pointer type. This also avoids a SC/BC break in qlowenergycontroller.h as the d-pointer remains the same and the functions declared via Q_DECLARE_PRIVATE still return the same type. Change-Id: I84890b06280b2c473a4d370606d3bbc58a258eea Reviewed-by: Oliver Wolff --- src/bluetooth/qlowenergycontroller_p.cpp | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/bluetooth/qlowenergycontroller_p.cpp') diff --git a/src/bluetooth/qlowenergycontroller_p.cpp b/src/bluetooth/qlowenergycontroller_p.cpp index 5c82c1fe..f75c92e2 100644 --- a/src/bluetooth/qlowenergycontroller_p.cpp +++ b/src/bluetooth/qlowenergycontroller_p.cpp @@ -44,8 +44,8 @@ QT_BEGIN_NAMESPACE -QLowEnergyControllerPrivate::QLowEnergyControllerPrivate() - : QLowEnergyControllerPrivateBase(), +QLowEnergyControllerPrivateCommon::QLowEnergyControllerPrivateCommon() + : QLowEnergyControllerPrivate(), lastLocalHandle(0) { #ifndef QT_IOS_BLUETOOTH @@ -54,15 +54,15 @@ QLowEnergyControllerPrivate::QLowEnergyControllerPrivate() registerQLowEnergyControllerMetaType(); } -QLowEnergyControllerPrivate::~QLowEnergyControllerPrivate() +QLowEnergyControllerPrivateCommon::~QLowEnergyControllerPrivateCommon() { } -void QLowEnergyControllerPrivate::init() +void QLowEnergyControllerPrivateCommon::init() { } -void QLowEnergyControllerPrivate::connectToDevice() +void QLowEnergyControllerPrivateCommon::connectToDevice() { // required to pass unit test on default backend if (remoteDevice.isNull()) { @@ -71,39 +71,39 @@ void QLowEnergyControllerPrivate::connectToDevice() return; } - qWarning() << "QLowEnergyControllerPrivate::connectToDevice(): Not implemented"; + qWarning() << "QLowEnergyControllerPrivateCommon::connectToDevice(): Not implemented"; setError(QLowEnergyController::UnknownError); } -void QLowEnergyControllerPrivate::disconnectFromDevice() +void QLowEnergyControllerPrivateCommon::disconnectFromDevice() { } -void QLowEnergyControllerPrivate::discoverServices() +void QLowEnergyControllerPrivateCommon::discoverServices() { } -void QLowEnergyControllerPrivate::discoverServiceDetails(const QBluetoothUuid &/*service*/) +void QLowEnergyControllerPrivateCommon::discoverServiceDetails(const QBluetoothUuid &/*service*/) { } -void QLowEnergyControllerPrivate::readCharacteristic(const QSharedPointer /*service*/, +void QLowEnergyControllerPrivateCommon::readCharacteristic(const QSharedPointer /*service*/, const QLowEnergyHandle /*charHandle*/) { } -void QLowEnergyControllerPrivate::readDescriptor(const QSharedPointer /*service*/, +void QLowEnergyControllerPrivateCommon::readDescriptor(const QSharedPointer /*service*/, const QLowEnergyHandle /*charHandle*/, const QLowEnergyHandle /*descriptorHandle*/) { } -void QLowEnergyControllerPrivate::writeCharacteristic(const QSharedPointer /*service*/, +void QLowEnergyControllerPrivateCommon::writeCharacteristic(const QSharedPointer /*service*/, const QLowEnergyHandle /*charHandle*/, const QByteArray &/*newValue*/, QLowEnergyService::WriteMode /*writeMode*/) @@ -111,7 +111,7 @@ void QLowEnergyControllerPrivate::writeCharacteristic(const QSharedPointer /*service*/, const QLowEnergyHandle /*charHandle*/, const QLowEnergyHandle /*descriptorHandle*/, @@ -120,21 +120,21 @@ void QLowEnergyControllerPrivate::writeDescriptor( } -void QLowEnergyControllerPrivate::startAdvertising(const QLowEnergyAdvertisingParameters &/* params */, +void QLowEnergyControllerPrivateCommon::startAdvertising(const QLowEnergyAdvertisingParameters &/* params */, const QLowEnergyAdvertisingData &/* advertisingData */, const QLowEnergyAdvertisingData &/* scanResponseData */) { } -void QLowEnergyControllerPrivate::stopAdvertising() +void QLowEnergyControllerPrivateCommon::stopAdvertising() { } -void QLowEnergyControllerPrivate::requestConnectionUpdate(const QLowEnergyConnectionParameters & /* params */) +void QLowEnergyControllerPrivateCommon::requestConnectionUpdate(const QLowEnergyConnectionParameters & /* params */) { } -void QLowEnergyControllerPrivate::addToGenericAttributeList(const QLowEnergyServiceData &/* service */, +void QLowEnergyControllerPrivateCommon::addToGenericAttributeList(const QLowEnergyServiceData &/* service */, QLowEnergyHandle /* startHandle */) { } -- cgit v1.2.3 From e1c4f25ab12892baaf43b0476fe669a48b2c58d0 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Thu, 26 Oct 2017 13:23:35 +0200 Subject: Provide own header for QLowEnergyControllerPrivate instance on Bluez This utilizes the new QLowEnergyController interface and separates the existing Bluez implementation more clearly from other platforms. The existing addServiceHelper() class is moved out into the individual backends to avoid compiling the class into the new dbus backend. Change-Id: I1eea99e493958c61cb1fae830c08a3eb26bda9c3 Reviewed-by: Oliver Wolff --- src/bluetooth/qlowenergycontroller_p.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/bluetooth/qlowenergycontroller_p.cpp') diff --git a/src/bluetooth/qlowenergycontroller_p.cpp b/src/bluetooth/qlowenergycontroller_p.cpp index f75c92e2..3a004b69 100644 --- a/src/bluetooth/qlowenergycontroller_p.cpp +++ b/src/bluetooth/qlowenergycontroller_p.cpp @@ -139,4 +139,11 @@ void QLowEnergyControllerPrivateCommon::addToGenericAttributeList(const QLowEner { } +QLowEnergyService *QLowEnergyControllerPrivateCommon::addServiceHelper( + const QLowEnergyServiceData &/*service*/) +{ + return nullptr; +} + + QT_END_NAMESPACE -- cgit v1.2.3 From 37ef963092460be6cf51dda81bffcd068a875165 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Fri, 27 Oct 2017 13:16:15 +0200 Subject: Various cleanups following the recent QLEControllerPrivate header splits Change-Id: Ia98a7a16c3e1e478d1c6e30d9e70dc703c1fe091 Reviewed-by: Oliver Wolff --- src/bluetooth/qlowenergycontroller_p.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/bluetooth/qlowenergycontroller_p.cpp') diff --git a/src/bluetooth/qlowenergycontroller_p.cpp b/src/bluetooth/qlowenergycontroller_p.cpp index 3a004b69..3d1ea1e9 100644 --- a/src/bluetooth/qlowenergycontroller_p.cpp +++ b/src/bluetooth/qlowenergycontroller_p.cpp @@ -45,8 +45,7 @@ QT_BEGIN_NAMESPACE QLowEnergyControllerPrivateCommon::QLowEnergyControllerPrivateCommon() - : QLowEnergyControllerPrivate(), - lastLocalHandle(0) + : QLowEnergyControllerPrivate() { #ifndef QT_IOS_BLUETOOTH printDummyWarning(); -- cgit v1.2.3 From 40214a8c8d35bb15cbe6874cc33d90344f4c533c Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Fri, 27 Oct 2017 13:28:14 +0200 Subject: Reorder the qlowenergycontroller_p.h includes qlowenergycontroller_p.cpp and qlowenergycontroller_p.h are no longer universally included by all builds. The project includes the universal qlowenergycontroller* files across all platforms. To accomplish this the macOS/iOS specific QLowEnergyControllerPrivate interface moved to the common qlownergycontrollerbase_p.h. From this point onwards qlowenergycontroller_p.[cpp|h] contains the dummy backend only. Change-Id: If2893a32adfb14f47cf85622e943d5f683ad38da Reviewed-by: Oliver Wolff --- src/bluetooth/qlowenergycontroller_p.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/bluetooth/qlowenergycontroller_p.cpp') diff --git a/src/bluetooth/qlowenergycontroller_p.cpp b/src/bluetooth/qlowenergycontroller_p.cpp index 3d1ea1e9..b9f825af 100644 --- a/src/bluetooth/qlowenergycontroller_p.cpp +++ b/src/bluetooth/qlowenergycontroller_p.cpp @@ -38,18 +38,14 @@ ****************************************************************************/ #include "qlowenergycontroller_p.h" -#ifndef QT_IOS_BLUETOOTH #include "dummy/dummy_helper_p.h" -#endif QT_BEGIN_NAMESPACE QLowEnergyControllerPrivateCommon::QLowEnergyControllerPrivateCommon() : QLowEnergyControllerPrivate() { -#ifndef QT_IOS_BLUETOOTH printDummyWarning(); -#endif registerQLowEnergyControllerMetaType(); } -- cgit v1.2.3 From 770c06092a493417ddf2a3e5555e06fe0f788bc0 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Thu, 2 Nov 2017 16:25:17 +0100 Subject: Merge all QLEConrollerPrivate::addServiceHelper() implementation Change-Id: Id346f2f98e63c5c7ea9e2cd3fb7e68e4573ac1e5 Reviewed-by: Oliver Wolff --- src/bluetooth/qlowenergycontroller_p.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/bluetooth/qlowenergycontroller_p.cpp') diff --git a/src/bluetooth/qlowenergycontroller_p.cpp b/src/bluetooth/qlowenergycontroller_p.cpp index b9f825af..c3605f05 100644 --- a/src/bluetooth/qlowenergycontroller_p.cpp +++ b/src/bluetooth/qlowenergycontroller_p.cpp @@ -134,11 +134,4 @@ void QLowEnergyControllerPrivateCommon::addToGenericAttributeList(const QLowEner { } -QLowEnergyService *QLowEnergyControllerPrivateCommon::addServiceHelper( - const QLowEnergyServiceData &/*service*/) -{ - return nullptr; -} - - QT_END_NAMESPACE -- cgit v1.2.3