summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdeviceinfo.h
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2018-08-21 11:11:56 +0200
committerAlex Blasche <alexander.blasche@qt.io>2018-08-23 07:44:35 +0000
commit4a20dda27259fad1468370860162b8f22ca53072 (patch)
treebaec5a21ea788b55a97ee1128f674f660df3531a /src/bluetooth/qbluetoothdeviceinfo.h
parentb9e3ca7c32da3fdc4bfb6e4c7c540e66229f86ce (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/qbluetoothdeviceinfo.h')
-rw-r--r--src/bluetooth/qbluetoothdeviceinfo.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothdeviceinfo.h b/src/bluetooth/qbluetoothdeviceinfo.h
index 88b477d8..d59eb27d 100644
--- a/src/bluetooth/qbluetoothdeviceinfo.h
+++ b/src/bluetooth/qbluetoothdeviceinfo.h
@@ -198,6 +198,14 @@ public:
DataUnavailable
};
+ enum class Field {
+ None = 0x0000,
+ RSSI = 0x0001,
+ ManufacturerData = 0x0002,
+ All = 0x7fff
+ };
+ Q_DECLARE_FLAGS(Fields, Field)
+
enum CoreConfiguration {
UnknownCoreConfiguration = 0x0,
LowEnergyCoreConfiguration = 0x01,
@@ -239,7 +247,8 @@ public:
QVector<quint16> manufacturerIds() const;
QByteArray manufacturerData(quint16 manufacturerId) const;
- void setManufacturerData(quint16 manufacturerId, const QByteArray &data);
+ bool setManufacturerData(quint16 manufacturerId, const QByteArray &data);
+ QHash<quint16, QByteArray> manufacturerData() const;
void setCoreConfigurations(QBluetoothDeviceInfo::CoreConfigurations coreConfigs);
QBluetoothDeviceInfo::CoreConfigurations coreConfigurations() const;