summaryrefslogtreecommitdiff
path: root/src/plugins/sensors
diff options
context:
space:
mode:
authorBernd Weimer <bweimer@blackberry.com>2013-10-24 10:19:04 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-28 10:48:06 +0100
commit6348938a792b83374829ea09482539855cf2e56d (patch)
treeabc4582729badebdac37936640deee6b4dc3962b /src/plugins/sensors
parent4682c6c1fddbf364d428d5b1b1b052e7781905e0 (diff)
downloadqtsensors-6348938a792b83374829ea09482539855cf2e56d.tar.gz
BlackBerry: Disabled "returnGeoValues" feature
Elimination of interference is not supported on BlackBerry, so returnGeoValues property will be ignored. Change-Id: I5c6e3a80ec18f9e0d349d3c4040bfb8067a72291 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins/sensors')
-rw-r--r--src/plugins/sensors/blackberry/bbmagnetometer.cpp43
-rw-r--r--src/plugins/sensors/blackberry/bbsensorbackend.cpp8
2 files changed, 15 insertions, 36 deletions
diff --git a/src/plugins/sensors/blackberry/bbmagnetometer.cpp b/src/plugins/sensors/blackberry/bbmagnetometer.cpp
index a58dfe9..19619d6 100644
--- a/src/plugins/sensors/blackberry/bbmagnetometer.cpp
+++ b/src/plugins/sensors/blackberry/bbmagnetometer.cpp
@@ -55,39 +55,22 @@ bool BbMagnetometer::updateReadingFromEvent(const sensor_event_t &event, QMagnet
{
float x, y, z;
- QMagnetometer * const magnetometer = qobject_cast<QMagnetometer *>(sensor());
- if (magnetometer && magnetometer->returnGeoValues()) {
- switch (event.accuracy) {
- case SENSOR_ACCURACY_UNRELIABLE: reading->setCalibrationLevel(0.0f); break;
- case SENSOR_ACCURACY_LOW: reading->setCalibrationLevel(0.1f); break;
+ switch (event.accuracy) {
+ case SENSOR_ACCURACY_UNRELIABLE: reading->setCalibrationLevel(0.0f); break;
+ case SENSOR_ACCURACY_LOW: reading->setCalibrationLevel(0.1f); break;
- // We determined that MEDIUM should map to 1.0, because existing code samples
- // show users should pop a calibration screen when seeing < 1.0. The MEDIUM accuracy
- // is actually good enough not to require calibration, so we don't want to make it seem
- // like it is required artificially.
- case SENSOR_ACCURACY_MEDIUM: reading->setCalibrationLevel(1.0f); break;
- case SENSOR_ACCURACY_HIGH: reading->setCalibrationLevel(1.0f); break;
- }
-
- x = convertValue(event.motion.dsp.x);
- y = convertValue(event.motion.dsp.y);
- z = convertValue(event.motion.dsp.z);
-
- } else {
- reading->setCalibrationLevel(1.0f);
-
-#ifndef Q_OS_BLACKBERRY_TABLET
- x = convertValue(event.motion.raw.x);
- y = convertValue(event.motion.raw.y);
- z = convertValue(event.motion.raw.z);
-#else
- // Blackberry Tablet OS does not support raw reading values
- x = convertValue(event.motion.dsp.x);
- y = convertValue(event.motion.dsp.y);
- z = convertValue(event.motion.dsp.z);
-#endif
+ // We determined that MEDIUM should map to 1.0, because existing code samples
+ // show users should pop a calibration screen when seeing < 1.0. The MEDIUM accuracy
+ // is actually good enough not to require calibration, so we don't want to make it seem
+ // like it is required artificially.
+ case SENSOR_ACCURACY_MEDIUM: reading->setCalibrationLevel(1.0f); break;
+ case SENSOR_ACCURACY_HIGH: reading->setCalibrationLevel(1.0f); break;
}
+ x = convertValue(event.motion.dsp.x);
+ y = convertValue(event.motion.dsp.y);
+ z = convertValue(event.motion.dsp.z);
+
remapAxes(&x, &y, &z);
reading->setX(x);
reading->setY(y);
diff --git a/src/plugins/sensors/blackberry/bbsensorbackend.cpp b/src/plugins/sensors/blackberry/bbsensorbackend.cpp
index 7822dd8..89f564d 100644
--- a/src/plugins/sensors/blackberry/bbsensorbackend.cpp
+++ b/src/plugins/sensors/blackberry/bbsensorbackend.cpp
@@ -215,7 +215,8 @@ void BbSensorBackendBase::remapMatrix(const float inputMatrix[], float outputMat
void BbSensorBackendBase::remapAxes(float *x, float *y, float *z)
{
- Q_ASSERT(x && y && z);
+ Q_UNUSED(z);
+ Q_ASSERT(x && y);
if (!isAutoAxisRemappingEnabled() || orientationForRemapping() == 0)
return;
@@ -306,11 +307,6 @@ bool BbSensorBackendBase::isFeatureSupported(QSensor::Feature feature) const
case QSensor::PressureSensorTemperature:
return true;
case QSensor::GeoValues:
-#ifndef Q_OS_BLACKBERRY_TABLET
- return (sensorType() == SENSOR_TYPE_MAGNETOMETER);
-#else
- return false;
-#endif
case QSensor::Reserved:
case QSensor::FieldOfView:
break;