diff options
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent.cpp | 8 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_ios.mm | 5 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm | 5 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp index b90f6b01..60af0e7e 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp @@ -40,9 +40,12 @@ #include "qbluetoothdevicediscoveryagent.h" #include "qbluetoothdevicediscoveryagent_p.h" +#include <QtCore/qloggingcategory.h> QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(QT_BT) + /*! \class QBluetoothDeviceDiscoveryAgent \inmodule QtBluetooth @@ -253,8 +256,11 @@ void QBluetoothDeviceDiscoveryAgent::setLowEnergyDiscoveryTimeout(int timeout) Q_D(QBluetoothDeviceDiscoveryAgent); // cannot deliberately turn it off - if (d->lowEnergySearchTimeout < 0 || timeout < 0) + if (d->lowEnergySearchTimeout < 0 || timeout < 0) { + qCDebug(QT_BT) << "The Bluetooth Low Energy device discovery timeout cannot be negative " + "or set on a backend which does not support this feature."; return; + } d->lowEnergySearchTimeout = timeout; } diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_ios.mm b/src/bluetooth/qbluetoothdevicediscoveryagent_ios.mm index f2611602..aac4f7d5 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_ios.mm +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_ios.mm @@ -390,8 +390,11 @@ int QBluetoothDeviceDiscoveryAgent::lowEnergyDiscoveryTimeout() const void QBluetoothDeviceDiscoveryAgent::setLowEnergyDiscoveryTimeout(int timeout) { // cannot deliberately turn it off - if (d_ptr->lowEnergySearchTimeout < 0 || timeout < 0) + if (d_ptr->lowEnergySearchTimeout < 0 || timeout < 0) { + qCDebug(QT_BT_OSX) << "The Bluetooth Low Energy device discovery timeout cannot be negative " + "or set on a backend which does not support this feature."; return; + } d_ptr->lowEnergySearchTimeout = timeout; return; diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm b/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm index eedeebb5..48f84357 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm @@ -588,8 +588,11 @@ QString QBluetoothDeviceDiscoveryAgent::errorString() const void QBluetoothDeviceDiscoveryAgent::setLowEnergyDiscoveryTimeout(int timeout) { // cannot deliberately turn it off - if (d_ptr->lowEnergySearchTimeout < 0 || timeout < 0) + if (d_ptr->lowEnergySearchTimeout < 0 || timeout < 0) { + qCDebug(QT_BT_OSX) << "The Bluetooth Low Energy device discovery timeout cannot be negative " + "or set on a backend which does not support this feature."; return; + } d_ptr->lowEnergySearchTimeout = timeout; return; |