diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-10-16 16:28:27 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-10-16 16:51:17 +0200 |
commit | 4a6d4e8682384887d1b30b9c3107f47c57d7ee3f (patch) | |
tree | 7a744db6d876ea2b3aa593b4f5277310598ac712 | |
parent | 8b42497996549bccbbaabdf35756e1b8f2e6642b (diff) | |
download | qtconnectivity-4a6d4e8682384887d1b30b9c3107f47c57d7ee3f.tar.gz |
Add QBluetoothDeviceInfo::UnknownCoreConfiguration enum value
The value is needed for platforms which do not provide this type
information. An example are Android versions below 18.
The enum was added in Qt 5.4. Therefore we need to add
the missing \since tag too.
Change-Id: I23582e7500d8da6740b281ba9821d028c4f33e05
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
-rw-r--r-- | src/bluetooth/qbluetoothdeviceinfo.cpp | 7 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothdeviceinfo.h | 1 | ||||
-rw-r--r-- | tests/auto/qbluetoothdeviceinfo/tst_qbluetoothdeviceinfo.cpp | 4 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothdeviceinfo.cpp b/src/bluetooth/qbluetoothdeviceinfo.cpp index ffb03c27..c0562c45 100644 --- a/src/bluetooth/qbluetoothdeviceinfo.cpp +++ b/src/bluetooth/qbluetoothdeviceinfo.cpp @@ -242,9 +242,11 @@ QT_BEGIN_NAMESPACE /*! \enum QBluetoothDeviceInfo::CoreConfiguration + \since 5.4 This enum describes the configuration of the device. + \value UnknownCoreConfiguration The type of the Bluetooth device cannot be determined. \value BaseRateCoreConfiguration The device is a standard Bluetooth device. \value BaseRateAndLowEnergyCoreConfiguration The device is a Bluetooth Smart device with support for standard and Low Energy device. @@ -258,7 +260,7 @@ QBluetoothDeviceInfoPrivate::QBluetoothDeviceInfoPrivate() : majorDeviceClass(QBluetoothDeviceInfo::MiscellaneousDevice), minorDeviceClass(0), serviceUuidsCompleteness(QBluetoothDeviceInfo::DataUnavailable), - deviceCoreConfiguration(QBluetoothDeviceInfo::BaseRateCoreConfiguration) + deviceCoreConfiguration(QBluetoothDeviceInfo::UnknownCoreConfiguration) { } @@ -513,6 +515,7 @@ QBluetoothDeviceInfo::DataCompleteness QBluetoothDeviceInfo::serviceUuidsComplet between regular and Low Energy devices. \sa coreConfigurations() + \since 5.4 */ void QBluetoothDeviceInfo::setCoreConfigurations(QBluetoothDeviceInfo::CoreConfigurations coreConfigs) { @@ -522,10 +525,12 @@ void QBluetoothDeviceInfo::setCoreConfigurations(QBluetoothDeviceInfo::CoreConfi } /*! + Returns the configuration of the device. If device configuration is not set, basic rate device configuration will be returned. \sa setCoreConfigurations() + \since 5.4 */ QBluetoothDeviceInfo::CoreConfigurations QBluetoothDeviceInfo::coreConfigurations() const { diff --git a/src/bluetooth/qbluetoothdeviceinfo.h b/src/bluetooth/qbluetoothdeviceinfo.h index d97e54de..ea8b7627 100644 --- a/src/bluetooth/qbluetoothdeviceinfo.h +++ b/src/bluetooth/qbluetoothdeviceinfo.h @@ -189,6 +189,7 @@ public: }; enum CoreConfiguration { + UnknownCoreConfiguration = 0x0, LowEnergyCoreConfiguration = 0x01, BaseRateCoreConfiguration = 0x02, BaseRateAndLowEnergyCoreConfiguration = 0x03 diff --git a/tests/auto/qbluetoothdeviceinfo/tst_qbluetoothdeviceinfo.cpp b/tests/auto/qbluetoothdeviceinfo/tst_qbluetoothdeviceinfo.cpp index ea3c471c..74a27591 100644 --- a/tests/auto/qbluetoothdeviceinfo/tst_qbluetoothdeviceinfo.cpp +++ b/tests/auto/qbluetoothdeviceinfo/tst_qbluetoothdeviceinfo.cpp @@ -250,6 +250,8 @@ void tst_QBluetoothDeviceInfo::tst_construction() QBluetoothDeviceInfo deviceInfo; QVERIFY(!deviceInfo.isValid()); + QVERIFY(deviceInfo.coreConfigurations() + == QBluetoothDeviceInfo::UnknownCoreConfiguration); } { @@ -270,7 +272,7 @@ void tst_QBluetoothDeviceInfo::tst_construction() QCOMPARE(deviceInfo.serviceClasses(), serviceClasses); QCOMPARE(deviceInfo.majorDeviceClass(), majorDeviceClass); QCOMPARE(deviceInfo.minorDeviceClass(), minorDeviceClass); - QCOMPARE(deviceInfo.coreConfigurations(), QBluetoothDeviceInfo::BaseRateCoreConfiguration); + QCOMPARE(deviceInfo.coreConfigurations(), QBluetoothDeviceInfo::UnknownCoreConfiguration); deviceInfo.setCoreConfigurations(coreConfiguration); QCOMPARE(deviceInfo.coreConfigurations(), coreConfiguration); |