summaryrefslogtreecommitdiffstats
path: root/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@jollamobile.com>2013-10-12 17:19:44 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-23 06:12:42 +0200
commit8aabcf1eb258aedc9c268d6c1de191747f4f4400 (patch)
treef7a2a8a23f400fc8c8eae4a533b07067923f0e28 /src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp
parente4ff58731699e1202396f9ef5863f462fa1d9456 (diff)
make sensorfw plugin handle the sensord restarting.
This way, clients that are connected will continue to receive updates after the sensord has restarted, without the need to restart the sensor. Task-number: QTBUG-34050 Change-Id: I4a8fbca189764cf23a1453feae5c1fd9ed6911e7 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp')
-rw-r--r--src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp b/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp
index a2e23493..0714e5f0 100644
--- a/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp
+++ b/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp
@@ -43,14 +43,12 @@
#define RM680_PS "/dev/bh1770glc_ps"
char const * const SensorfwIrProximitySensor::id("sensorfw.irproximitysensor");
-bool SensorfwIrProximitySensor::m_initDone = false;
-
-
SensorfwIrProximitySensor::SensorfwIrProximitySensor(QSensor *sensor)
: SensorfwSensorBase(sensor)
+ , m_initDone(false)
{
- initSensor<ProximitySensorChannelInterface>(m_initDone);
+ init();
setReading<QIRProximityReading>(&m_reading);
setDescription(QLatin1String("reflectance as percentage (%) of maximum"));
addOutputRange(0, 100, 1);
@@ -80,3 +78,8 @@ QString SensorfwIrProximitySensor::sensorName() const
}
+void SensorfwIrProximitySensor::init()
+{
+ m_initDone = false;
+ initSensor<ProximitySensorChannelInterface>(m_initDone);
+}