summaryrefslogtreecommitdiffstats
path: root/tradeshow/iot-sensortag/bluetoothdataprovider.h
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2017-09-20 09:35:56 +0200
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2017-09-27 06:35:24 +0000
commitcf2ec248f2c8d6fabc539f2acef4df5d3c0e8b6c (patch)
tree01c4feef45ddf310113a7f2f2d5b06e20b443fbe /tradeshow/iot-sensortag/bluetoothdataprovider.h
parent55ce120e6ceccb40f19a941fbda05edefd22d64c (diff)
iot-sensortag: Redesign of example
The updated version switches the focus from having multiple sensors locally towards showing one sensor from a list. This list can display local or remote sensors and switch on runtime. Also incorporated many style fixes and cleanups. Change-Id: If7b8acbb2a784ebba95d467176e76728721c82f7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'tradeshow/iot-sensortag/bluetoothdataprovider.h')
-rw-r--r--tradeshow/iot-sensortag/bluetoothdataprovider.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/tradeshow/iot-sensortag/bluetoothdataprovider.h b/tradeshow/iot-sensortag/bluetoothdataprovider.h
index 5f39b4f..5c28725 100644
--- a/tradeshow/iot-sensortag/bluetoothdataprovider.h
+++ b/tradeshow/iot-sensortag/bluetoothdataprovider.h
@@ -55,12 +55,13 @@
#include <QQmlEngine>
#include <QJSEngine>
#include <QTimer>
+#include <QBluetoothDeviceInfo>
class BluetoothDataProvider : public SensorTagDataProvider
{
Q_OBJECT
public:
- BluetoothDataProvider(QString id, QObject* parent = 0);
+ BluetoothDataProvider(const QBluetoothDeviceInfo &id, QObject *parent = 0);
virtual ~BluetoothDataProvider();
@@ -69,9 +70,8 @@ public:
QString sensorType() const;
QString versionString() const;
- void bindToDevice(BluetoothDevice *device);
void unbindDevice();
- BluetoothDevice* device();
+ BluetoothDevice *device();
public slots:
void startServiceScan();
@@ -80,7 +80,7 @@ public slots:
void barometerReceived(double temperature, double barometer);
void humidityReceived(double humidity);
void lightIntensityReceived(double lightIntensity);
- void motionReceived(MotionSensorData &data);
+ void motionReceived(const MotionSensorData &data);
protected:
void reset() override;
@@ -89,6 +89,7 @@ protected:
private:
void updateState();
float countRotationDegrees(double degreesPerSecond, quint64 milliseconds);
+ QBluetoothDeviceInfo m_info;
BluetoothDevice *m_btDevice;
int m_smaSamples;
int m_zeroAltitudeSamples;