diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-07-08 14:27:00 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-07-13 09:50:41 +0000 |
commit | 1de888375e3bafb44c9cc8dafce68e2b6b4f7a48 (patch) | |
tree | d7245429a761fb8ed744c6187d3a4c6706368a38 /src/bluetooth/qbluetoothdevicediscoveryagent.h | |
parent | 5ce6ed270db4a693f62c14347203d7b367a56488 (diff) |
Permit selection of discovery mode (btle vs classic)
This change introduces the new API but does not yet implement the specific selection.
In any case BlueZ does not need any specific implementation as classic and BTLE
devices are found using the same method. iOS does not need any specific implementation
as it only supports BTLE discovery.
Task-number: QTBUG-46253
Change-Id: Ie6365966091effe5f3a68f8a283657c7cb43b692
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent.h')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.h b/src/bluetooth/qbluetoothdevicediscoveryagent.h index 39b558af..84087605 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent.h +++ b/src/bluetooth/qbluetoothdevicediscoveryagent.h @@ -65,6 +65,7 @@ public: PoweredOffError, InvalidBluetoothAdapterError, UnsupportedPlatformError, + UnsupportedDiscoveryMethod, UnknownError = 100 // New errors must be added before Unknown error }; Q_ENUM(Error) @@ -75,6 +76,15 @@ public: }; Q_ENUM(InquiryType) + enum DiscoveryMethod + { + NoMethod = 0x0, + ClassicMethod = 0x01, + LowEnergyMethod = 0x02, + }; + Q_DECLARE_FLAGS(DiscoveryMethods, DiscoveryMethod) + Q_FLAG(DiscoveryMethods) + explicit QBluetoothDeviceDiscoveryAgent(QObject *parent = Q_NULLPTR); explicit QBluetoothDeviceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent = Q_NULLPTR); @@ -94,8 +104,10 @@ public: void setLowEnergyDiscoveryTimeout(int msTimeout); int lowEnergyDiscoveryTimeout() const; + static DiscoveryMethods supportedDiscoveryMethods(); public Q_SLOTS: void start(); + void start(DiscoveryMethods method); void stop(); Q_SIGNALS: @@ -119,6 +131,8 @@ private: #endif }; +Q_DECLARE_OPERATORS_FOR_FLAGS(QBluetoothDeviceDiscoveryAgent::DiscoveryMethods) + QT_END_NAMESPACE #endif |