diff options
author | Otto Ryynänen <otto.ryynanen@qt.io> | 2017-01-30 16:30:13 +0200 |
---|---|---|
committer | Kari Hautamäki <kari.hautamaki@qt.io> | 2017-01-31 11:15:58 +0000 |
commit | 4a7c0e5841b2bb69ddaef2c9620c443934d194ee (patch) | |
tree | 0997ae3fdb9de74ace3d140724b96fe1fdde386d /tradeshow/iot-sensortag/bluetoothdataprovider.cpp | |
parent | 632e35db6d6ef6bf15891e486da983aabfb740b3 (diff) |
SensorTag changed to broadcasting mode form read-resp mode
Sensortag now sends data according to set intervals and app only
listens to signals.
Timers removed as they are no longer needed.
Both ambient and object temperature read and converted properly.
Cloud data updated with dedicated abient and object temperatures.
Version is now 1.1 (backwards compatible).
Mock data reflects to reality better.
Change-Id: I6a0325a513c1a054322f18e68d2b15c474db3ee5
Reviewed-by: Kari Hautamäki <kari.hautamaki@qt.io>
Diffstat (limited to 'tradeshow/iot-sensortag/bluetoothdataprovider.cpp')
-rw-r--r-- | tradeshow/iot-sensortag/bluetoothdataprovider.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/tradeshow/iot-sensortag/bluetoothdataprovider.cpp b/tradeshow/iot-sensortag/bluetoothdataprovider.cpp index 4737987..c76404f 100644 --- a/tradeshow/iot-sensortag/bluetoothdataprovider.cpp +++ b/tradeshow/iot-sensortag/bluetoothdataprovider.cpp @@ -95,11 +95,10 @@ void BluetoothDataProvider::startServiceScan() activeDevice->scanServices(); } -void BluetoothDataProvider::temperatureReceived(double temperature) +void BluetoothDataProvider::temperatureReceived(double newAmbientTemperature, double newObjectTemperature) { - if (temperature == irTemperature) - return; - irTemperature = temperature; + irAmbientTemperature = newAmbientTemperature; + irObjectTemperature = newObjectTemperature; emit infraredCelsiusTemperatureChanged(); } @@ -137,8 +136,6 @@ float BluetoothDataProvider::countRotationDegrees(double degreesPerSecond, quint void BluetoothDataProvider::motionReceived(MotionSensorData &data) { - qCDebug(boot2QtDemos) << Q_FUNC_INFO << ":" << data.gyroScope_x << "," << data.msSincePreviousData - << "=" << countRotationDegrees(data.gyroScope_x, data.msSincePreviousData); gyroscopeX_degPerSec = data.gyroScope_x; gyroscopeY_degPerSec = data.gyroScope_y; gyroscopeZ_degPerSec = data.gyroScope_z; @@ -163,10 +160,6 @@ void BluetoothDataProvider::motionReceived(MotionSensorData &data) emit rotationXChanged(); emit rotationYChanged(); emit rotationZChanged(); - // Signal that all values have changed, for easier - // value change handling in clients - emit rotationValuesChanged(); - accelometer_mG_xAxis = data.accelometer_x; accelometer_mG_yAxis = data.accelometer_y; accelometer_mG_zAxis = data.accelometer_z; @@ -175,6 +168,9 @@ void BluetoothDataProvider::motionReceived(MotionSensorData &data) magnetometerMicroT_yAxis = data.magnetometer_y; magnetometerMicroT_zAxis = data.magnetometer_z; emit magnetometerMicroTChanged(); + // Signal that all values have changed, for easier + // value change handling in clients + emit rotationValuesChanged(); } QString BluetoothDataProvider::sensorType() const @@ -184,7 +180,7 @@ QString BluetoothDataProvider::sensorType() const QString BluetoothDataProvider::versionString() const { - return QString("1.0"); + return QString("1.1"); } void BluetoothDataProvider::updateState() |