summaryrefslogtreecommitdiffstats
path: root/src/bluetoothsettings/bluez/bluetoothdevice_p.h
diff options
context:
space:
mode:
authorTeemu Holappa <teemu.holappa@qt.io>2017-02-27 10:24:53 +0200
committerTeemu Holappa <teemu.holappa@qt.io>2017-05-03 06:32:17 +0000
commit48fb704e64300387f99c4192436728858c8aa4f8 (patch)
tree1891c25100a6cdf0f1260c0c5ca1f469887828c8 /src/bluetoothsettings/bluez/bluetoothdevice_p.h
parent314de829065a3fa411b8fed90ff1289b000e229b (diff)
Fix issue when no Bluetooth device is available
Added async scan of the bluetooth adapter. Done some cleanup to the public class. Task-number: QTBUG-57676 Change-Id: Ia845f2f8c18fb8272160167482e5124c0b43fee7 Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io> Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Diffstat (limited to 'src/bluetoothsettings/bluez/bluetoothdevice_p.h')
-rw-r--r--src/bluetoothsettings/bluez/bluetoothdevice_p.h46
1 files changed, 41 insertions, 5 deletions
diff --git a/src/bluetoothsettings/bluez/bluetoothdevice_p.h b/src/bluetoothsettings/bluez/bluetoothdevice_p.h
index f6892e3..432a7e7 100644
--- a/src/bluetoothsettings/bluez/bluetoothdevice_p.h
+++ b/src/bluetoothsettings/bluez/bluetoothdevice_p.h
@@ -41,19 +41,55 @@
//
#include <QObject>
+#include <QBluetoothLocalDevice>
+#include <QtDBus>
+#include "bluetoothdevice.h"
class OrgBluezDevice1Interface;
+class OrgFreedesktopDBusObjectManagerInterface;
class BluetoothDevicePrivate : public QObject
{
+ Q_OBJECT
+ Q_DECLARE_PUBLIC(BluetoothDevice)
public:
- explicit BluetoothDevicePrivate(const QString& address, QObject *parent = Q_NULLPTR);
- void connectDevice();
- void disconnectDevice();
+ BluetoothDevice *q_ptr;
+ BluetoothDevicePrivate(BluetoothDevice *parent);
+ bool powered() const;
+ void setPowered(const bool& aPowered);
+ bool scanning() const;
+ bool available() const;
+ void setScanning(const bool& aScan);
+ void requestPairing(const QString& address);
+ void requestConnect(const QString& address);
+ void requestDisconnect(const QString& address);
+ DiscoveryModel* deviceModel() const;
+
+public Q_SLOTS:
+ void deviceStateChanged(QBluetoothLocalDevice::HostMode state);
+ void scanFinished();
+ //These are not yet signaled
+ //See bug https://bugreports.qt.io/browse/QTBUG-38401
+ void pairingDisplayConfirmation(const QBluetoothAddress & address, QString pin);
+ void pairingDisplayPinCode(const QBluetoothAddress & address, QString pin);
+ void pairingFinished(const QBluetoothAddress & address, QBluetoothLocalDevice::Pairing pairing);
+ void deviceConnected(const QBluetoothAddress & address);
+ void deviceDisconnected(const QBluetoothAddress & address);
+ void getManagedObjectsFinished(QDBusPendingCallWatcher *watcher);
+
+private:
+ void updateConnectionStatuses();
+ OrgBluezDevice1Interface* findPeerDevice(const QString& address);
private:
- OrgBluezDevice1Interface* findDevice();
- QString m_address;
+ QBluetoothLocalDevice* m_localDevice;
+ bool m_powered;
+ bool m_scanning;
+ QString m_adapter;
+ DiscoveryModel *m_deviceModel;
+ OrgFreedesktopDBusObjectManagerInterface *m_manager;
};
+
+
#endif // BLUETOOTHDEVICE__P_H