void testsensorimpl::start() { QVariant _exclusive = sensor()->property("exclusive"); bool exclusive = _exclusive.isValid()?_exclusive.toBool():false; if (exclusive) { if (!exclusiveHandle) { exclusiveHandle = this; } else { // Hook up the busyChanged signal connect(exclusiveHandle, SIGNAL(emitBusyChanged()), sensor(), SIGNAL(busyChanged())); sensorBusy(); // report the busy condition return; } } QString doThis = sensor()->property("doThis").toString(); if (doThis == "stop") sensorStopped(); else if (doThis == "error") sensorError(1); else if (doThis == "setOne") { m_reading.setTimestamp(1); m_reading.setTest(1); newReadingAvailable(); } else { m_reading.setTimestamp(2); m_reading.setTest(2); newReadingAvailable(); } }
void genericalssensor::start() { lightSensor->setDataRate(sensor()->dataRate()); lightSensor->start(); if (!lightSensor->isActive()) sensorStopped(); if (lightSensor->isBusy()) sensorBusy(); }
void GenericTiltSensor::start() { accelerometer->setDataRate(sensor()->dataRate()); accelerometer->setAlwaysOn(sensor()->isAlwaysOn()); accelerometer->start(); if (!accelerometer->isActive()) sensorStopped(); if (accelerometer->isBusy()) sensorBusy(); }