diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-04-08 17:48:23 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-06 16:00:53 +0200 |
commit | 74449f1b0b2952dcbad9525c167b36fbf908696f (patch) | |
tree | 6e1a3f807ca07d678c6c340f4621039c8d5ac3af /src/bluetooth/qbluetoothlocaldevice_p.h | |
parent | 0e60ecb374b15d488cc0e10b73458e550698aec6 (diff) |
Add Bluez5 support for QBluetoothLocalDevice
The pairing signals are not yet implemented. For details
see QTBUG-38401.
Task-number: QTBUG-32085
Change-Id: I2b4e9a97b880801ebbffe367a8ab98320dd7ef2f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice_p.h')
-rw-r--r-- | src/bluetooth/qbluetoothlocaldevice_p.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h index 24b42670..7fc82e2f 100644 --- a/src/bluetooth/qbluetoothlocaldevice_p.h +++ b/src/bluetooth/qbluetoothlocaldevice_p.h @@ -52,10 +52,15 @@ #include <QDBusObjectPath> #include <QDBusMessage> #include <QSet> +#include "bluez/bluez5_helper_p.h" class OrgBluezAdapterInterface; +class OrgBluezAdapter1Interface; +class OrgFreedesktopDBusPropertiesInterface; +class OrgFreedesktopDBusObjectManagerInterface; class OrgBluezAgentAdaptor; class OrgBluezDeviceInterface; +class OrgBluezDevice1Interface; QT_BEGIN_NAMESPACE class QDBusPendingCallWatcher; @@ -126,7 +131,11 @@ public: QSet<OrgBluezDeviceInterface *> devices; QSet<QBluetoothAddress> connectedDevicesSet; - OrgBluezAdapterInterface *adapter; + OrgBluezAdapterInterface *adapter; //Bluez 4 + OrgBluezAdapter1Interface *adapterBluez5; //Bluez 5 + OrgFreedesktopDBusPropertiesInterface *adapterProperties; //Bluez 5 + OrgFreedesktopDBusObjectManagerInterface *managerBluez5; //Bluez 5 + QMap<QString, OrgFreedesktopDBusPropertiesInterface *> deviceChangeMonitors; //Bluez 5 OrgBluezAgentAdaptor *agent; QList<QBluetoothAddress> connectedDevices() const; @@ -135,6 +144,9 @@ public: QBluetoothAddress localAddress; QBluetoothAddress address; QBluetoothLocalDevice::Pairing pairing; + OrgBluezDevice1Interface *pairingTarget; + QTimer *pairingDiscoveryTimer; + bool discoveryWasAlreadyActive; QBluetoothLocalDevice::HostMode currentMode; int pendingHostModeChange; @@ -157,6 +169,21 @@ public slots: void _q_devicePropertyChanged(const QString &property, const QDBusVariant &value); bool isValid() const; + void requestPairingBluez5(const QBluetoothAddress &address, + QBluetoothLocalDevice::Pairing targetPairing); + +private Q_SLOTS: + void PropertiesChanged(const QString &interface, + const QVariantMap &changed_properties, + const QStringList &invalidated_properties); + void InterfacesAdded(const QDBusObjectPath &object_path, + InterfaceList interfaces_and_properties); + void InterfacesRemoved(const QDBusObjectPath &object_path, + const QStringList &interfaces); + void processPairingBluez5(const QString &objectPath, + QBluetoothLocalDevice::Pairing target); + void pairingDiscoveryTimedOut(); + private: void createCache(); void connectDeviceChanges(); @@ -169,6 +196,7 @@ private: bool connectedCached; void initializeAdapter(); + void initializeAdapterBluez5(); }; #elif defined(QT_QNX_BLUETOOTH) |