diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2018-08-21 11:11:56 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2018-08-23 07:44:35 +0000 |
commit | 4a20dda27259fad1468370860162b8f22ca53072 (patch) | |
tree | baec5a21ea788b55a97ee1128f674f660df3531a /src/bluetooth/qbluetoothdevicediscoveryagent.cpp | |
parent | b9e3ca7c32da3fdc4bfb6e4c7c540e66229f86ce (diff) |
Add QBluetoothDeviceDiscoveryAgent::deviceUpdated signal
For iBeacons and such, it's normal to keep discovering indefinitely,
while the advertisement can sometimes carry changing payload data.
This signal helps keep the UI up-to-date.
Changed setManufacturerData to return a bool indicating whether the
data was really modified or not, to avoid sending deviceUpdated
in case it was not changed.
For convenience QBluetoothDeviceInfo::manufacturerData() was added.
WinRT and Apple platforms do not emit the new signal yet and relevant
TODO items were added.
Done-with: Shawn Rutledge <shawn.rutledge@qt.io>
Task-number: QTBUG-46008
Task-number: QTBUG-69747
Change-Id: I6d6b373f6cc5ee3dd6af2ad05d8640dbd25c5d6a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp index a9e35960..ac978349 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp @@ -155,6 +155,26 @@ Q_DECLARE_LOGGING_CATEGORY(QT_BT) */ /*! + \fn void QBluetoothDeviceDiscoveryAgent::deviceUpdated(const QBluetoothDeviceInfo &info, QBluetoothDeviceInfo::Fields updatedFields) + + This signal is emitted when the agent receives additional information about + the Bluetooth device described by \a info. The \l updatedFields flags tell + which information has been updated. + + During discovery, some information can change dynamically, such as + \l {signal strength}{QBluetoothDeviceInfo::rssi()} and + \l {manufacturerData}{QBluetoothDeviceInfo::manufacturerData()}. + This signal informs you that if your application is displaying this data, it + can be updated, rather than waiting until the discovery has finished. + + \note This signal is only emitted on Android and BlueZ 5.x. + + \sa QBluetoothDeviceInfo::rssi(), lowEnergyDiscoveryTimeout() +*/ + +// TODO deviceUpdated() signal not implemented on WinRT and Apple platforms + +/*! \fn void QBluetoothDeviceDiscoveryAgent::finished() This signal is emitted when Bluetooth device discovery completes. |