diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-05-09 11:46:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-22 09:07:49 +0200 |
commit | 291a62a8150164c8b848b8dd5c6f26ef19a51246 (patch) | |
tree | 99873d7f38f1ef44353fd480e913e186f25e37ff /src/bluetooth/qbluetoothdevicediscoveryagent_p.h | |
parent | 26e9cf5bc608c7b50fc27a73442966b3880f0825 (diff) |
Bluez5: Ensure device discovery returns meaningfull RSSI data
If the discovery process was started by QBluetoothDeviceDiscoveryAgent
and Bluez wasn't already in discovery mode then the RSSI values
are 0. The retrieval of RSSI data takes a bit more time.
To find a compromise between speedy return of device scan information
and the delayed RSSI information we continue to monitor the device scan
and update RSSI information as the values are propagated by Bluez.
However the deviceDiscovered() signal is not emitted again after an
update. Only re-calling discoveredDevices() will return the most
up-to-date RSSI values.
Task-number: QTBUG-32085
Change-Id: Icb6566d51503a6004fa3f25c499fc7f941bd7fee
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_p.h')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_p.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h index 1e20f92e..168b6c0c 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h @@ -59,6 +59,7 @@ class OrgBluezManagerInterface; class OrgBluezAdapterInterface; class OrgFreedesktopDBusObjectManagerInterface; +class OrgFreedesktopDBusPropertiesInterface; class OrgBluezAdapter1Interface; class OrgBluezDevice1Interface; @@ -94,9 +95,13 @@ public: #ifdef QT_BLUEZ_BLUETOOTH void _q_deviceFound(const QString &address, const QVariantMap &dict); void _q_propertyChanged(const QString &name, const QDBusVariant &value); - void _q_InterfacesAdded(const QDBusObjectPath &object_path, InterfaceList interfaces_and_properties); + void _q_InterfacesAdded(const QDBusObjectPath &object_path, + InterfaceList interfaces_and_properties); void _q_discoveryFinished(); void _q_discoveryInterrupted(const QString &path); + void _q_PropertiesChanged(const QString &interface, + const QVariantMap &changed_properties, + const QStringList &invalidated_properties); #endif private: @@ -127,6 +132,7 @@ private: OrgFreedesktopDBusObjectManagerInterface *managerBluez5; OrgBluezAdapter1Interface *adapterBluez5; QTimer *discoveryTimer; + QList<OrgFreedesktopDBusPropertiesInterface *> propertyMonitors; void deviceFoundBluez5(const QString& devicePath); void startBluez5(); |