[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-hybris.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://git.merproject.org/mer-core/sensorfw.git</param>
<param name="branch">master</param>
- <param name="revision">HEAD</param>
+ <param name="revision">0.8.30</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/TODO
^
|
@@ -1,8 +0,0 @@
-Just a rough todo for myself:
-
-sensorfw needs new sensors:
-
-* humidity
-* holster (hal)
-* ir distance
-* pressure (w/altitude property)
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/humidityadaptor/humidityadaptor.cpp
^
|
@@ -1,142 +0,0 @@
-/**
- @file alsevdevadaptor.cpp
- @brief Plugin for HumidityAdaptor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#include "humidityadaptor.h"
-#include "config.h"
-#include "logging.h"
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/input.h>
-#include <unistd.h>
-#include <QMap>
-
-#include "datatypes/utils.h"
-
-HumidityAdaptor::HumidityAdaptor(const QString& id) :
- InputDevAdaptor(id, 1)
-{
- humidityBuffer_ = new DeviceAdaptorRingBuffer<TimedUnsigned>(1);
- setAdaptedSensor("humidity", "Relative Humidity values", humidityBuffer_);
- setDescription("Input device humidity adaptor");
- powerStatePath_ = Config::configuration()->value("humidity/powerstate_path").toByteArray();
- introduceAvailableDataRange(DataRange(0, 4095, 1));
- setDefaultInterval(10);
-}
-
-HumidityAdaptor::~HumidityAdaptor()
-{
-}
-
-void HumidityAdaptor::interpretEvent(int src, struct input_event *ev)
-{
- Q_UNUSED(src);
-
- switch (ev->type) {
- case EV_ABS:
- switch (ev->code) {
- case ABS_X:
- case ABS_MISC:
- humidityValue_ = ev->value;
- break;
- }
- break;
- }
-}
-
-void HumidityAdaptor::interpretSync(int src, struct input_event *ev)
-{
- Q_UNUSED(src);
- commitOutput(ev);
-}
-
-void HumidityAdaptor::commitOutput(struct input_event *ev)
-{
- TimedUnsigned* rh = humidityBuffer_->nextSlot();
- rh->value_ = humidityValue_;
-
- rh->timestamp_ = Utils::getTimeStamp(&(ev->time));
-
- humidityBuffer_->commit();
- humidityBuffer_->wakeUpReaders();
-}
-
-unsigned int HumidityAdaptor::evaluateIntervalRequests(int& sessionId) const
-{
- unsigned int highestValue = 0;
- int winningSessionId = -1;
-
- if (m_intervalMap.size() == 0) {
- sessionId = winningSessionId;
- return defaultInterval();
- }
-
- // Get the smallest positive request, 0 is reserved for HW wakeup
- QMap<int, unsigned int>::const_iterator it;
- it = m_intervalMap.begin();
- highestValue = it.value();
- winningSessionId = it.key();
-
- for (++it; it != m_intervalMap.constEnd(); ++it) {
- if ((it.value() < highestValue) && (it.value() > 0)) {
- highestValue = it.value();
- winningSessionId = it.key();
- }
- }
-
- sessionId = winningSessionId;
- return highestValue > 0 ? highestValue : defaultInterval();
-}
-
-bool HumidityAdaptor::startSensor()
-{
- if (!powerStatePath_.isEmpty()) {
- writeToFile(powerStatePath_, "1");
- }
- if (SysfsAdaptor::startSensor()) {
- return true;
- }
- return false;
-}
-
-void HumidityAdaptor::stopSensor()
-{
- if (!powerStatePath_.isEmpty()) {
- writeToFile(powerStatePath_, "0");
- }
-
- SysfsAdaptor::stopSensor();
-}
-
-bool HumidityAdaptor::standby()
-{
- stopSensor();
- return true;
-}
-
-bool HumidityAdaptor::resume()
-{
- startSensor();
- return true;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/humidityadaptor/humidityadaptor.h
^
|
@@ -1,79 +0,0 @@
-/**
- @file humidityadaptor.h
- @brief Contains HumidityAdaptorPlugin.
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-#ifndef HUMIDITYEVDEVADAPTOR_H
-#define HUMIDITYEVDEVADAPTOR_H
-
-#include "inputdevadaptor.h"
-#include "deviceadaptorringbuffer.h"
-#include "datatypes/orientationdata.h"
-#include <QTime>
-
-class HumidityAdaptor : public InputDevAdaptor
-{
- Q_OBJECT
-public:
- /**
- * Factory method for gaining a new instance of AccelerometerAdaptor class.
- * @param id Identifier for the adaptor.
- */
- static DeviceAdaptor* factoryMethod(const QString& id)
- {
- return new HumidityAdaptor(id);
- }
-
- virtual bool startSensor();
-
- virtual void stopSensor();
-
- virtual bool standby();
-
- virtual bool resume();
-
-protected:
- /**
- * Constructor.
- * @param id Identifier for the adaptor.
- */
- HumidityAdaptor(const QString& id);
- ~HumidityAdaptor();
-
- /**
- * Reimplement to allow for 0 interval to be the slowest entry.
- */
- virtual unsigned int evaluateIntervalRequests(int& sessionId) const;
-
-private:
- DeviceAdaptorRingBuffer<TimedUnsigned>* humidityBuffer_;
-
- unsigned humidityValue_;
-
- void interpretEvent(int src, struct input_event *ev);
- void commitOutput(struct input_event *ev);
- void interpretSync(int src, struct input_event *ev);
- QByteArray powerStatePath_;
-
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/humidityadaptor/humidityadaptor.pro
^
|
@@ -1,9 +0,0 @@
-TARGET = humidityadaptor
-
-HEADERS += humidityadaptor.h \
- humidityadaptorplugin.h
-
-SOURCES += humidityadaptor.cpp \
- humidityadaptorplugin.cpp
-
-include( ../adaptor-config.pri )
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/humidityadaptor/humidityadaptorplugin.cpp
^
|
@@ -1,40 +0,0 @@
-/**
- @file humidityadaptor.cpp
- @brief Plugin for HumidityAdaptorPlugin
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#include "humidityadaptorplugin.h"
-#include "humidityadaptor.h"
-#include "sensormanager.h"
-#include "logging.h"
-
-void HumidityAdaptorPlugin::Register(class Loader&)
-{
- sensordLogD() << "registering humidityadaptor";
- SensorManager& sm = SensorManager::instance();
- sm.registerDeviceAdaptor<HumidityAdaptor>("humidityadaptor");
-}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-Q_EXPORT_PLUGIN2(humidityadaptor, HumidityAdaptorPlugin)
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/humidityadaptor/humidityadaptorplugin.h
^
|
@@ -1,42 +0,0 @@
-/**
- @file alsadaptor-evdevplugin.h
- @brief Plugin for HumidityAdaptorPlugin
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#ifndef HUMIDITYADAPTOR_PLUGIN_H
-#define HUMIDITYADAPTOR_PLUGIN_H
-
-#include "plugin.h"
-
-class HumidityAdaptorPlugin : public Plugin
-{
- Q_OBJECT
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
- Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
-#endif
-
-private:
- void Register(class Loader& l);
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/iioadaptor/README.md
^
|
@@ -1,9 +0,0 @@
-sensorfw-iioadaptor
-===================
-
-Industrial I/O plugin for SensorFW
-
-WIP.
- * working accelerometer
- - data is wrong
-
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/iioadaptor/iioadaptor.cpp
^
|
@@ -1,519 +0,0 @@
-/**
-
-// http://www.apache.org/licenses/LICENSE-2.0
-
- @file iioadaptor.cpp
- @brief IioAdaptor based on SysfsAdaptor
-
- <p>
- Copyright (C) 2009-2010 Nokia Corporation
- Copyright (C) 2012 Tuomas Kulve
- Copyright (C) 2012 Srdjan Markovic
- Copyright (C) 2016 Canonical
-
- @author Tuomas Kulve <tuomas@kulve.fi>
- @author Lorn Potter <lorn.potter@canonical.com>
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-#include <errno.h>
-
-#include <libudev.h>
-
-#include <logging.h>
-#include <config.h>
-#include <datatypes/utils.h>
-#include <unistd.h>
-#include <time.h>
-
-#include "iioadaptor.h"
-#include <sensord-qt5/sysfsadaptor.h>
-#include <sensord-qt5/deviceadaptorringbuffer.h>
-#include <QTextStream>
-#include <QDir>
-#include <QTimer>
-#include <QDirIterator>
-#include <qmath.h>
-
-#include <sensord-qt5/deviceadaptor.h>
-#include "datatypes/orientationdata.h"
-
-#define GRAVITY 9.80665
-#define REV_GRAVITY 0.101936799
-
-/* Conversion of acceleration data to SI units (m/s^2) */
-#define CONVERT_A_X(x) ((float(x) / 1000) * (GRAVITY * -1.0))
-#define CONVERT_A_Y(x) ((float(x) / 1000) * (GRAVITY * 1.0))
-#define CONVERT_A_Z(x) ((float(x) / 1000) * (GRAVITY * 1.0))
-
-IioAdaptor::IioAdaptor(const QString &id) :
- SysfsAdaptor(id, SysfsAdaptor::IntervalMode, true),
- deviceId(id)
-{
- sensordLogD() << "Creating IioAdaptor with id: " << id;
- setup();
-}
-
-IioAdaptor::~IioAdaptor()
-{
- if (iioXyzBuffer_)
- delete iioXyzBuffer_;
- if (alsBuffer_)
- delete alsBuffer_;
- if (magnetometerBuffer_)
- delete magnetometerBuffer_;
-}
-
-void IioAdaptor::setup()
-{
- qDebug() << Q_FUNC_INFO << deviceId;
-
- if (deviceId.startsWith("accel")) {
- const QString name = "accelerometer";
- const QString inputMatch = Config::configuration()->value<QString>(name + "/input_match");
- qDebug() << "input_match" << inputMatch;
-
- devNodeNumber = findSensor(inputMatch);
- if (devNodeNumber!= -1) {
- const QString desc = "Industrial I/O accelerometer (" + iioDevice.name +")";
- qDebug() << Q_FUNC_INFO << "Accelerometer found";
- iioXyzBuffer_ = new DeviceAdaptorRingBuffer<TimedXyzData>(1);
- setAdaptedSensor(name, desc, iioXyzBuffer_);
-
- iioDevice.sensorType = IioAdaptor::IIO_ACCELEROMETER;
- }
- }
- else if (deviceId.startsWith("gyro")) {
- const QString name = "gyroscope";
- const QString inputMatch = Config::configuration()->value<QString>(name + "/input_match");
- qDebug() << "input_match" << inputMatch;
-
- devNodeNumber = findSensor(inputMatch);
- if (devNodeNumber!= -1) {
- const QString desc = "Industrial I/O gyroscope (" + iioDevice.name +")";
- iioXyzBuffer_ = new DeviceAdaptorRingBuffer<TimedXyzData>(1);
- setAdaptedSensor(name, desc, iioXyzBuffer_);
-
- iioDevice.sensorType = IioAdaptor::IIO_GYROSCOPE;
- }
- }
- else if (deviceId.startsWith("mag")) {
- const QString name = "magnetometer";
- const QString inputMatch = Config::configuration()->value<QString>(name + "/input_match");
- qDebug() << "input_match" << inputMatch;
-
- devNodeNumber = findSensor(inputMatch);
-
- if (devNodeNumber!= -1) {
- const QString desc = "Industrial I/O magnetometer (" + iioDevice.name +")";
- magnetometerBuffer_ = new DeviceAdaptorRingBuffer<CalibratedMagneticFieldData>(1);
- setAdaptedSensor(name, desc, magnetometerBuffer_);
-
- iioDevice.sensorType = IioAdaptor::IIO_MAGNETOMETER;
- }
- }
- else if (deviceId.startsWith("als")) {
- const QString name = "als";
- const QString inputMatch = Config::configuration()->value<QString>(name + "/input_match");
-
- devNodeNumber = findSensor(inputMatch);
- if (devNodeNumber!= -1) {
- QString desc = "Industrial I/O light sensor (" + iioDevice.name +")";
- qDebug() << desc;
- alsBuffer_ = new DeviceAdaptorRingBuffer<TimedUnsigned>(1);
- setAdaptedSensor(name, desc, alsBuffer_);
- iioDevice.sensorType = IioAdaptor::IIO_ALS;
- }
- }
-
- if (devNodeNumber == -1) {
- qDebug() << Q_FUNC_INFO << "sensor is invalid";
-// setValid(false);
- return;
- }
- iioDevice.channels = scanElementsEnable(devNodeNumber,1);
- scanElementsEnable(devNodeNumber,0);
-
- introduceAvailableDataRange(DataRange(0, 65535, 1));
- introduceAvailableInterval(DataRange(0, 586, 0));
- setDefaultInterval(10);
-}
-
-int IioAdaptor::findSensor(const QString &sensorName)
-{
- udev_list_entry *devices;
- udev_list_entry *dev_list_entry;
- udev_device *dev;
- struct udev *udevice = 0;
- struct udev_enumerate *enumerate = 0;
-
- if (!udevice)
- udevice = udev_new();
-
- enumerate = udev_enumerate_new(udevice);
- udev_enumerate_add_match_subsystem(enumerate, "iio");
-
- udev_enumerate_scan_devices(enumerate);
- devices = udev_enumerate_get_list_entry(enumerate);
-
- bool ok2;
-
- udev_list_entry_foreach(dev_list_entry, devices) {
- const char *path;
- path = udev_list_entry_get_name(dev_list_entry);
-
- dev = udev_device_new_from_syspath(udevice, path);
- if (qstrcmp(udev_device_get_subsystem(dev), "iio") == 0) {
- iioDevice.name = QString::fromLatin1(udev_device_get_sysattr_value(dev,"name"));
- if (iioDevice.name == sensorName) {
- struct udev_list_entry *sysattr;
- int j = 0;
- QString eventName = QString::fromLatin1(udev_device_get_sysname(dev));
- iioDevice.devicePath = QString::fromLatin1(udev_device_get_syspath(dev)) +"/";
- iioDevice.index = eventName.right(1).toInt(&ok2);
- qDebug() << Q_FUNC_INFO << "syspath" << iioDevice.devicePath;
-
- udev_list_entry_foreach(sysattr, udev_device_get_sysattr_list_entry(dev)) {
- const char *name;
- const char *value;
- bool ok;
- name = udev_list_entry_get_name(sysattr);
- value = udev_device_get_sysattr_value(dev, name);
- if (value == NULL)
- continue;
- qDebug() << "attr" << name << value;
-
- QString attributeName(name);
- if (attributeName.endsWith("scale")) {
- iioDevice.scale = QString(value).toDouble(&ok);
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/iioadaptor/iioadaptor.h
^
|
@@ -1,148 +0,0 @@
-/**
- @file iioadaptor.h
- @brief IioAdaptor based on SysfsAdaptor
-
- <p>
- Copyright (C) 2009-2010 Nokia Corporation
- Copyright (C) 2012 Tuomas Kulve
- Copyright (C) 2016 Canonical
-
- @author Tuomas Kulve <tuomas@kulve.fi>
- @author Lorn Potter <lorn.potter@canonical.com>
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#ifndef IIOADAPTOR_H
-#define IIOADAPTOR_H
-
-#include <sysfsadaptor.h>
-#include <datatypes/orientationdata.h>
-
-// FIXME: shouldn't assume any number of channels per device
-#define IIO_MAX_DEVICE_CHANNELS 20
-
-// FIXME: no idea what would be reasonable length
-#define IIO_BUFFER_LEN 256
-
-/**
- * @brief Adaptor for Industrial I/O.
- *
- * Adaptor for Industrial I/O. Uses SysFs driver interface in
- * polling mode, i.e. values are read with given constant interval.
- *
- * Driver interface is located in @e /sys/bus/iio/devices/iio:deviceX/ .
- * <ul><li>@e angular_rate filehandle provides measurement values.</li></ul>
- * No other filehandles are currently in use by this adaptor.
- */
-class IioAdaptor : public SysfsAdaptor
-{
- Q_OBJECT
- enum IioSensorType {
- IIO_ACCELEROMETER = 1, // accel_3d
- IIO_GYROSCOPE, // gyro_3d
- IIO_MAGNETOMETER, // magn_3d
- IIO_ROTATION, // dev_rotation, quaternion
- IIO_ALS, // als
- IIO_TILT // incli_3d
- };
-
- struct iio_device {
- QString name;
- int channels;
- int channel_bytes[IIO_MAX_DEVICE_CHANNELS];
- qreal scale;
- qreal offset;
- int frequency;
- QString devicePath;
- int index;
- IioSensorType sensorType;
- };
-
-public:
- /**
- * Factory method for gaining a new instance of this adaptor class.
- *
- * @param id Identifier for the adaptor.
- * @return A pointer to created adaptor with base class type.
- */
- static DeviceAdaptor *factoryMethod(const QString& id)
- {
- return new IioAdaptor(id);
- }
-
- virtual bool startSensor();
- virtual void stopSensor();
-// virtual bool standby();
-// virtual bool resume();
-
-protected:
-
- /**
- * Constructor. Protected to force externals to use factory method.
- *
- * @param id Identifier for the adaptor.
- */
- IioAdaptor(const QString &id);
-
- /**
- * Destructor.
- */
- ~IioAdaptor();
-
-
- bool setInterval(const unsigned int value, const int sessionId);
- // unsigned int interval() const;
-
-private:
-
- /**
- * Read and process data. Run when sysfsadaptor has detected new
- * available data.
- *
- * @param pathId PathId for the file that had event.
- * @param fd Open file descriptor with new data. See
- * #SysfsAdaptor::processSample()
- */
- void processSample(int pathId, int fd);
-
- int findSensor(const QString &name);
- bool deviceEnable(int device, int enable);
-
- bool sysfsWriteInt(QString filename, int val);
- QString sysfsReadString(QString filename);
- int sysfsReadInt(QString filename);
- int scanElementsEnable(int device, int enable);
- int deviceChannelParseBytes(QString filename);
-
- // Device number for the sensor (-1 if not found)
- int devNodeNumber;
-
- DeviceAdaptorRingBuffer<TimedXyzData>* iioXyzBuffer_;
- DeviceAdaptorRingBuffer<TimedUnsigned>* alsBuffer_;
- DeviceAdaptorRingBuffer<CalibratedMagneticFieldData>* magnetometerBuffer_;
-
- iio_device iioDevice;
-
- QString deviceId;
-
- TimedXyzData* timedData;
- CalibratedMagneticFieldData *calData;
- TimedUnsigned *uData;
-
-private slots:
- void setup();
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/iioadaptor/iioadaptor.pro
^
|
@@ -1,21 +0,0 @@
-TARGET = iioaccelerometeradaptor
-#TARGET = iiosensorsadaptor
-
-HEADERS += iioadaptor.h \
- iioadaptorplugin.h
-
-SOURCES += iioadaptor.cpp \
- iioadaptorplugin.cpp
-
-CONFIG += qt debug warn_on link_prl link_pkgconfig plugin
-
-PKGCONFIG += sensord-qt5
-for(PKG, $$list($$unique(PKGCONFIG))) {
- !system(pkg-config --exists $$PKG):error($$PKG development files are missing)
-}
-
-CONFIG += link_pkgconfig
-PKGCONFIG += udev
-LIBS += -ludev
-
-include( ../adaptor-config.pri )
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/iioadaptor/iioadaptorplugin.cpp
^
|
@@ -1,43 +0,0 @@
-/**
- @file iioadaptorplugin.cpp
- @brief Plugin for IioAdaptor
-
- <p>
- Copyright (C) 2009-2010 Nokia Corporation
- Copyright (C) 2012 Tuomas Kulve
- Copyright (C) 2016 Canonical
-
- @author Tuomas Kulve <tuomas@kulve.fi>
- @author Lorn Potter <lorn.potter@canonical.com>
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#include "iioadaptorplugin.h"
-#include "iioadaptor.h"
-#include <sensormanager.h>
-
-void IioAdaptorPlugin::Register(class Loader&)
-{
- sensordLogD() << "registering iioaccelerometeradaptor";
- SensorManager& sm = SensorManager::instance();
- sm.registerDeviceAdaptor<IioAdaptor>("accelerometeradaptor");
- sm.registerDeviceAdaptor<IioAdaptor>("gyroscopeadaptor");
- sm.registerDeviceAdaptor<IioAdaptor>("magnetometeradaptor");
- sm.registerDeviceAdaptor<IioAdaptor>("alsadaptor");
-}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-Q_EXPORT_PLUGIN2(iioadaptor, IioAdaptorPlugin)
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/iioadaptor/iioadaptorplugin.h
^
|
@@ -1,43 +0,0 @@
-/**
- @file iioadaptorplugin.h
- @brief Plugin for IioAdaptor
-
- <p>
- Copyright (C) 2009-2010 Nokia Corporation
- Copyright (C) 2012 Tuomas Kulve
- Copyright (C) 2016 Canonical
-
- @author Tuomas Kulve <tuomas@kulve.fi>
- @author Lorn Potte
-r <lorn.potter@canonical.com>
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#ifndef IIOADAPTORPLUGIN_H
-#define IIOADAPTORPLUGIN_H
-
-#include <plugin.h>
-
-class IioAdaptorPlugin : public Plugin
-{
- Q_OBJECT
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
- Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
-#endif
-
-private:
- void Register(class Loader& l);
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/lidsensoradaptor-evdev/lidsensoradaptor-evdev.cpp
^
|
@@ -1,172 +0,0 @@
-/**
- @file lidsensoradaptor-evdev.cpp
- @brief LidSensorAdaptor utilizing evdev kernel interface
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/input.h>
-#include <string.h>
-#include <logging.h>
-#include "datatypes/utils.h"
-#include "config.h"
-
-#include "lidsensoradaptor-evdev.h"
-
-#define SELFDEF_SW_LID 0
-#define SELFDEF_EV_SW 5
-#define SELFDEF_EV_DISTANCE 25
-
-LidSensorAdaptorEvdev::LidSensorAdaptorEvdev(const QString& id) :
- InputDevAdaptor(id, 2),
- currentType_(LidData::UnknownLid),
- lastType(LidData::UnknownLid),
- currentValue_(-1),
- lastValue(-1),
- usingFront(false)
-{
- lidBuffer_ = new DeviceAdaptorRingBuffer<LidData>(1);
- setAdaptedSensor("lidsensor", "Lid state", lidBuffer_);
- powerStatePath_ = Config::configuration()->value("lidsensor/powerstate_path").toByteArray();
-
-}
-
-LidSensorAdaptorEvdev::~LidSensorAdaptorEvdev()
-{
- delete lidBuffer_;
-}
-
-/* Dell event0 Lid Switch
- * type EV_SW code EV_LID value 1 closed
- * */
-
-/* Dell event8 Virtual Button Driver (happens with front lid too)
- * back closed:
- * type (4) EV_MSC code (4) MSC_SCAN value cb
- * EV_MSC MSC_SCAN value cc
- *
- * back open:
- * EV_MSC MSC_SCAN value ca
- * EV_MSC MSC_SCAN value cd
- *
- *
- * */
-
-// there can be two lid sensors, so try and use both
-void LidSensorAdaptorEvdev::init()
-{
- qDebug() << Q_FUNC_INFO << name();
- QStringList strList = Config::configuration()->value<QStringList>(name() + "/input_match");
- qDebug() << strList;
- for (const QString str : strList) {
- if (!getInputDevices(str)) {
- sensordLogW() << "Input device not found.";
- SysfsAdaptor::init();
- }
- }
-}
-
-void LidSensorAdaptorEvdev::interpretEvent(int src, struct input_event *ev)
-{
- Q_UNUSED(src);
-
- if (ev->type == SELFDEF_EV_SW && ev->code == SELFDEF_SW_LID) {
- currentValue_ = ev->value;
- currentType_ = LidData::FrontLid;
- if (currentValue_ == 1)
- usingFront = true;
- else
- usingFront = false;
- }
- if (ev->type == EV_MSC && ev->code == MSC_SCAN && !usingFront) {
-
- switch (ev->value) {
- case 0xCC: // closed
- currentValue_ = 1;
- break;
- case 0xCD: // open
- currentValue_ = 0;
- break;
- };
- currentType_ = LidData::BackLid;
- }
-}
-
-void LidSensorAdaptorEvdev::interpretSync(int /*src*/, struct input_event *ev)
-{
- commitOutput(ev);
-}
-
-void LidSensorAdaptorEvdev::commitOutput(struct input_event *ev)
-{
- if (lastValue != currentValue_
- && ((currentType_ == LidData::FrontLid)
- || (!usingFront && currentType_ == LidData::BackLid))) {
-
- LidData *lidData = lidBuffer_->nextSlot();
-
- lidData->timestamp_ = Utils::getTimeStamp(&(ev->time));
- lidData->value_ = currentValue_;
- lidData->type_ = currentType_;
- sensordLogD() << "Lid state change detected: "
- << (currentType_ == 0 ? "front" : "back")
- << (currentValue_ == 0 ? "OPEN": "CLOSED");
-
- lidBuffer_->commit();
- lidBuffer_->wakeUpReaders();
- lastValue = currentValue_;
- lastType = currentType_;
- }
-}
-
-bool LidSensorAdaptorEvdev::startSensor()
-{
- if (!powerStatePath_.isEmpty()) {
- // writeToFile(powerStatePath_, "1");
- }
- if (SysfsAdaptor::startSensor()) {
- return true;
- }
- return false;
-}
-
-void LidSensorAdaptorEvdev::stopSensor()
-{
- if (!powerStatePath_.isEmpty()) {
- // writeToFile(powerStatePath_, "0");
- }
-
- SysfsAdaptor::stopSensor();
-}
-
-bool LidSensorAdaptorEvdev::standby()
-{
- stopSensor();
- return true;
-}
-
-bool LidSensorAdaptorEvdev::resume()
-{
- startSensor();
- return true;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/lidsensoradaptor-evdev/lidsensoradaptor-evdev.h
^
|
@@ -1,90 +0,0 @@
-/**
- @file lidsensoradaptor-evdev.h
- @brief LidSensorAdaptor utilizing evdev kernel interface
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#ifndef LIDADAPTOR_EVDEV_H
-#define LIDADAPTOR_EVDEV_H
-
-#include "inputdevadaptor.h"
-#include "deviceadaptorringbuffer.h"
-#include "datatypes/liddata.h"
-
-/**
- * @brief Adaptor for lid sensor.
- *
- * Events are received through @e evdev kernel interface.
- *
- * Listening clients are notified whenever the state has changed.
- */
-class LidSensorAdaptorEvdev : public InputDevAdaptor
-{
- Q_OBJECT
-public:
-// /* Enumerates the possible states for proximity */
-// enum ProximityState {
-// ProximityStateUnknown = -1, /**< Proximity state unknown */
-// ProximityStateOpen = 0, /**< Proximity open (no target detected)*/
-// ProximityStateClosed = 1 /**< Proximity closed (target nearby)*/
-// };
-
- /**
- * Factory method for gaining a new instance of LidsensorAdaptorEvdev class.
- * @param id Identifier for the adaptor.
- */
- static DeviceAdaptor* factoryMethod(const QString& id)
- {
- return new LidSensorAdaptorEvdev(id);
- }
- virtual bool startSensor();
-
- virtual void stopSensor();
-
- virtual bool standby();
-
- virtual bool resume();
- virtual void init();
-protected:
- /**
- * Constructor.
- * @param id Identifier for the adaptor.
- */
- LidSensorAdaptorEvdev(const QString& id);
- ~LidSensorAdaptorEvdev();
-
-private:
-
- DeviceAdaptorRingBuffer<LidData> *lidBuffer_;
- LidData::Type currentType_;
- LidData::Type lastType;
- qreal currentValue_;
- qreal lastValue;
- bool usingFront;
-
- void interpretEvent(int src, struct input_event *ev);
- void commitOutput(struct input_event *ev);
- void interpretSync(int src, struct input_event *ev);
- QByteArray powerStatePath_;
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/lidsensoradaptor-evdev/lidsensoradaptor-evdev.pro
^
|
@@ -1,9 +0,0 @@
-TARGET = lidsensoradaptor-evdev
-
-HEADERS += lidsensoradaptor-evdev.h \
- lidsensoradaptor-evdevplugin.h
-
-SOURCES += lidsensoradaptor-evdev.cpp \
- lidsensoradaptor-evdevplugin.cpp
-
-include( ../adaptor-config.pri )
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/lidsensoradaptor-evdev/lidsensoradaptor-evdev.pro.user
^
|
@@ -1,270 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 3.4.1, 2016-10-26T11:47:56. -->
-<qtcreator>
- <data>
- <variable>EnvironmentId</variable>
- <value type="QByteArray">{272d5cea-eec6-4d5f-9f49-7f2059a976c7}</value>
- </data>
- <data>
- <variable>ProjectExplorer.Project.ActiveTarget</variable>
- <value type="int">0</value>
- </data>
- <data>
- <variable>ProjectExplorer.Project.EditorSettings</variable>
- <valuemap type="QVariantMap">
- <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
- <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
- <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
- <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
- <value type="QString" key="language">Cpp</value>
- <valuemap type="QVariantMap" key="value">
- <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
- </valuemap>
- </valuemap>
- <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
- <value type="QString" key="language">QmlJS</value>
- <valuemap type="QVariantMap" key="value">
- <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
- </valuemap>
- </valuemap>
- <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
- <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
- <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
- <value type="int" key="EditorConfiguration.IndentSize">4</value>
- <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
- <value type="int" key="EditorConfiguration.MarginColumn">80</value>
- <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
- <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
- <value type="int" key="EditorConfiguration.PaddingMode">1</value>
- <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
- <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
- <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
- <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
- <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
- <value type="int" key="EditorConfiguration.TabSize">8</value>
- <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
- <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
- <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
- <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
- <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
- <value type="bool" key="EditorConfiguration.inEntireDocument">true</value>
- </valuemap>
- </data>
- <data>
- <variable>ProjectExplorer.Project.PluginSettings</variable>
- <valuemap type="QVariantMap"/>
- </data>
- <data>
- <variable>ProjectExplorer.Project.Target.0</variable>
- <valuemap type="QVariantMap">
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.4.2 GCC 64bit</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.4.2 GCC 64bit</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.54.gcc_64_kit</value>
- <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
- <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
- <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
- <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
- <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lpotter/builds/build-lidsensoradaptor-evdev-Desktop_Qt_5_4_2_GCC_64bit-Debug</value>
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
- <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
- <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
- <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
- <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
- <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
- <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
- <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
- </valuemap>
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
- <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
- <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
- <value type="QString">-w</value>
- <value type="QString">-r</value>
- </valuelist>
- <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
- <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
- <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
- </valuemap>
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
- <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
- <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
- <value type="QString">-w</value>
- <value type="QString">-r</value>
- </valuelist>
- <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
- <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
- <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
- <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
- <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
- <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
- <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
- </valuemap>
- <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
- <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/lpotter/builds/build-lidsensoradaptor-evdev-Desktop_Qt_5_4_2_GCC_64bit-Release</value>
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
- <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
- <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
- <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
- <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
- <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
- <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
- <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
- </valuemap>
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
- <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
- <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
- <value type="QString">-w</value>
- <value type="QString">-r</value>
- </valuelist>
- <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
- <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
- <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
- </valuemap>
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
- <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
- <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
- <value type="QString">-w</value>
- <value type="QString">-r</value>
- </valuelist>
- <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
- <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
- <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
- <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
- <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
- <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
- <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
- <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
- <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/lidsensoradaptor-evdev/lidsensoradaptor-evdevplugin.cpp
^
|
@@ -1,40 +0,0 @@
-/**
- @file lidsensoradaptor-evdevplugin.cpp
- @brief Plugin for LidSensorAdaptorEvdev
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#include "lidsensoradaptor-evdevplugin.h"
-#include "lidsensoradaptor-evdev.h"
-#include "sensormanager.h"
-#include "logging.h"
-
-void LidsensorAdaptorEvdevPlugin::Register(class Loader&)
-{
- sensordLogD() << "registering lidsensoradaptor-evdev";
- SensorManager& sm = SensorManager::instance();
- sm.registerDeviceAdaptor<LidSensorAdaptorEvdev>("lidsensoradaptor");
-}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-Q_EXPORT_PLUGIN2(lidsensoradaptor-evdev, LidsensorAdaptorEvdevPlugin)
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/lidsensoradaptor-evdev/lidsensoradaptor-evdevplugin.h
^
|
@@ -1,41 +0,0 @@
-/**
- @file lidsensoradaptor-evdevplugin.h
- @brief Plugin for LidSensorAdaptorEvdev
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#ifndef LIDADAPTOR_EVDEVPLUGIN_H
-#define LIDADAPTOR_EVDEVPLUGIN_H
-
-#include "plugin.h"
-
-class LidsensorAdaptorEvdevPlugin : public Plugin
-{
- Q_OBJECT
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
- Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
-#endif
-private:
- void Register(class Loader& l);
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/pressureadaptor/pressureadaptor.cpp
^
|
@@ -1,142 +0,0 @@
-/**
- @file pressureadaptor.cpp
- @brief Plugin for PressureAdaptor
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#include "pressureadaptor.h"
-#include "config.h"
-#include "logging.h"
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/input.h>
-#include <unistd.h>
-#include <QMap>
-
-#include "datatypes/utils.h"
-
-PressureAdaptor::PressureAdaptor(const QString& id) :
- InputDevAdaptor(id, 1)
-{
- pressureBuffer_ = new DeviceAdaptorRingBuffer<TimedUnsigned>(1);
- setAdaptedSensor("pressure", "Pressure values", pressureBuffer_);
- setDescription("Input device pressure adaptor");
- powerStatePath_ = Config::configuration()->value("pressure/powerstate_path").toByteArray();
- introduceAvailableDataRange(DataRange(0, 4095, 1));
- setDefaultInterval(10);
-}
-
-PressureAdaptor::~PressureAdaptor()
-{
-}
-
-void PressureAdaptor::interpretEvent(int src, struct input_event *ev)
-{
- Q_UNUSED(src);
-
- switch (ev->type) {
- case EV_ABS:
- switch (ev->code) {
- case ABS_X:
- case ABS_MISC:
- pressureValue_ = ev->value;
- break;
- }
- break;
- }
-}
-
-void PressureAdaptor::interpretSync(int src, struct input_event *ev)
-{
- Q_UNUSED(src);
- commitOutput(ev);
-}
-
-void PressureAdaptor::commitOutput(struct input_event *ev)
-{
- TimedUnsigned* lux = pressureBuffer_->nextSlot();
- lux->value_ = pressureValue_;
-
- lux->timestamp_ = Utils::getTimeStamp(&(ev->time));
-
- pressureBuffer_->commit();
- pressureBuffer_->wakeUpReaders();
-}
-
-unsigned int PressureAdaptor::evaluateIntervalRequests(int& sessionId) const
-{
- unsigned int highestValue = 0;
- int winningSessionId = -1;
-
- if (m_intervalMap.size() == 0) {
- sessionId = winningSessionId;
- return defaultInterval();
- }
-
- // Get the smallest positive request, 0 is reserved for HW wakeup
- QMap<int, unsigned int>::const_iterator it;
- it = m_intervalMap.begin();
- highestValue = it.value();
- winningSessionId = it.key();
-
- for (++it; it != m_intervalMap.constEnd(); ++it) {
- if ((it.value() < highestValue) && (it.value() > 0)) {
- highestValue = it.value();
- winningSessionId = it.key();
- }
- }
-
- sessionId = winningSessionId;
- return highestValue > 0 ? highestValue : defaultInterval();
-}
-
-bool PressureAdaptor::startSensor()
-{
- if (!powerStatePath_.isEmpty()) {
- writeToFile(powerStatePath_, "1");
- }
- if (SysfsAdaptor::startSensor()) {
- return true;
- }
- return false;
-}
-
-void PressureAdaptor::stopSensor()
-{
- if (!powerStatePath_.isEmpty()) {
- writeToFile(powerStatePath_, "0");
- }
-
- SysfsAdaptor::stopSensor();
-}
-
-bool PressureAdaptor::standby()
-{
- stopSensor();
- return true;
-}
-
-bool PressureAdaptor::resume()
-{
- startSensor();
- return true;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/pressureadaptor/pressureadaptor.h
^
|
@@ -1,79 +0,0 @@
-/**
- @file pressureadaptor.h
- @brief Contains PressureAdaptor.
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-#ifndef PRESSUREEVDEVADAPTOR_H
-#define PRESSUREEVDEVADAPTOR_H
-
-#include "inputdevadaptor.h"
-#include "deviceadaptorringbuffer.h"
-#include "datatypes/orientationdata.h"
-#include <QTime>
-
-class PressureAdaptor : public InputDevAdaptor
-{
- Q_OBJECT
-public:
- /**
- * Factory method for gaining a new instance of AccelerometerAdaptor class.
- * @param id Identifier for the adaptor.
- */
- static DeviceAdaptor* factoryMethod(const QString& id)
- {
- return new PressureAdaptor(id);
- }
-
- virtual bool startSensor();
-
- virtual void stopSensor();
-
- virtual bool standby();
-
- virtual bool resume();
-
-protected:
- /**
- * Constructor.
- * @param id Identifier for the adaptor.
- */
- PressureAdaptor(const QString& id);
- ~PressureAdaptor();
-
- /**
- * Reimplement to allow for 0 interval to be the slowest entry.
- */
- virtual unsigned int evaluateIntervalRequests(int& sessionId) const;
-
-private:
- DeviceAdaptorRingBuffer<TimedUnsigned>* pressureBuffer_;
-
- unsigned pressureValue_;
-
- void interpretEvent(int src, struct input_event *ev);
- void commitOutput(struct input_event *ev);
- void interpretSync(int src, struct input_event *ev);
- QByteArray powerStatePath_;
-
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/pressureadaptor/pressureadaptor.pro
^
|
@@ -1,9 +0,0 @@
-TARGET = pressureadaptor
-
-HEADERS += pressureadaptor.h \
- pressureadaptorplugin.h
-
-SOURCES += pressureadaptor.cpp \
- pressureadaptorplugin.cpp
-
-include( ../adaptor-config.pri )
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/pressureadaptor/pressureadaptorplugin.cpp
^
|
@@ -1,43 +0,0 @@
-/**
- @file alsadaptorplugin-sysfs.cpp
- @brief Plugin for ALSAdaptorSysfs
-
- <p>
- Copyright (C) 2009-2010 Nokia Corporation
- Copyright (C) 2015 Jolla
-
- @author Lorn Potter <lorn.potter@jolla.com>
- @author Timo Rongas <ext-timo.2.rongas@nokia.com>
- @author Markus Lehtonen <markus.lehtonen@nokia.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#include "pressureadaptorplugin.h"
-#include "pressureadaptor.h"
-#include "sensormanager.h"
-#include "logging.h"
-
-void PressureAdaptorPlugin::Register(class Loader&)
-{
- sensordLogD() << "registering pressureadaptor";
- SensorManager& sm = SensorManager::instance();
- sm.registerDeviceAdaptor<PressureAdaptor>("pressureadaptor");
-}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-Q_EXPORT_PLUGIN2(pressureadaptor, PressureAdaptorPlugin)
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/pressureadaptor/pressureadaptorplugin.h
^
|
@@ -1,42 +0,0 @@
-/**
- @file pressureadaptor.h
- @brief Plugin for PressureAdaptorPlugin
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#ifndef ALSADAPTOR_EVDEVPLUGIN_H
-#define ALSADAPTOR_EVDEVPLUGIN_H
-
-#include "plugin.h"
-
-class PressureAdaptorPlugin : public Plugin
-{
- Q_OBJECT
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
- Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
-#endif
-
-private:
- void Register(class Loader& l);
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/temperatureadaptor/temperatureadaptor.cpp
^
|
@@ -1,142 +0,0 @@
-/**
- @file temperatureadaptor.cpp
- @brief Plugin for TemperatureAdaptor
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#include "temperatureadaptor.h"
-#include "config.h"
-#include "logging.h"
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/input.h>
-#include <unistd.h>
-#include <QMap>
-
-#include "datatypes/utils.h"
-
-TemperatureAdaptor::TemperatureAdaptor(const QString& id) :
- InputDevAdaptor(id, 1)
-{
- temperatureBuffer_ = new DeviceAdaptorRingBuffer<TimedUnsigned>(1);
- setAdaptedSensor("temperature", "Temperature values", temperatureBuffer_);
- setDescription("Input device temperature adaptor");
- powerStatePath_ = Config::configuration()->value("temperature/powerstate_path").toByteArray();
- introduceAvailableDataRange(DataRange(0, 4095, 1));
- setDefaultInterval(10);
-}
-
-TemperatureAdaptor::~TemperatureAdaptor()
-{
-}
-
-void TemperatureAdaptor::interpretEvent(int src, struct input_event *ev)
-{
- Q_UNUSED(src);
-
- switch (ev->type) {
- case EV_ABS:
- switch (ev->code) {
- case ABS_X:
- case ABS_MISC:
- temperatureValue_ = ev->value;
- break;
- }
- break;
- }
-}
-
-void TemperatureAdaptor::interpretSync(int src, struct input_event *ev)
-{
- Q_UNUSED(src);
- commitOutput(ev);
-}
-
-void TemperatureAdaptor::commitOutput(struct input_event *ev)
-{
- TimedUnsigned* temp = temperatureBuffer_->nextSlot();
- temp->value_ = temperatureValue_;
-
- temp->timestamp_ = Utils::getTimeStamp(&(ev->time));
-
- temperatureBuffer_->commit();
- temperatureBuffer_->wakeUpReaders();
-}
-
-unsigned int TemperatureAdaptor::evaluateIntervalRequests(int& sessionId) const
-{
- unsigned int highestValue = 0;
- int winningSessionId = -1;
-
- if (m_intervalMap.size() == 0) {
- sessionId = winningSessionId;
- return defaultInterval();
- }
-
- // Get the smallest positive request, 0 is reserved for HW wakeup
- QMap<int, unsigned int>::const_iterator it;
- it = m_intervalMap.begin();
- highestValue = it.value();
- winningSessionId = it.key();
-
- for (++it; it != m_intervalMap.constEnd(); ++it) {
- if ((it.value() < highestValue) && (it.value() > 0)) {
- highestValue = it.value();
- winningSessionId = it.key();
- }
- }
-
- sessionId = winningSessionId;
- return highestValue > 0 ? highestValue : defaultInterval();
-}
-
-bool TemperatureAdaptor::startSensor()
-{
- if (!powerStatePath_.isEmpty()) {
- writeToFile(powerStatePath_, "1");
- }
- if (SysfsAdaptor::startSensor()) {
- return true;
- }
- return false;
-}
-
-void TemperatureAdaptor::stopSensor()
-{
- if (!powerStatePath_.isEmpty()) {
- writeToFile(powerStatePath_, "0");
- }
-
- SysfsAdaptor::stopSensor();
-}
-
-bool TemperatureAdaptor::standby()
-{
- stopSensor();
- return true;
-}
-
-bool TemperatureAdaptor::resume()
-{
- startSensor();
- return true;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/temperatureadaptor/temperatureadaptor.h
^
|
@@ -1,78 +0,0 @@
-/**
- @file temperatureadaptor.h
- @brief Contains TemperatureAdaptor.
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-#ifndef TEMPERATUREADAPTOR_H
-#define TEMPERATUREADAPTOR_H
-
-#include "inputdevadaptor.h"
-#include "deviceadaptorringbuffer.h"
-#include "datatypes/orientationdata.h"
-#include <QTime>
-
-class TemperatureAdaptor : public InputDevAdaptor
-{
- Q_OBJECT
-public:
- /**
- * Factory method for gaining a new instance of AccelerometerAdaptor class.
- * @param id Identifier for the adaptor.
- */
- static DeviceAdaptor* factoryMethod(const QString& id)
- {
- return new TemperatureAdaptor(id);
- }
-
- virtual bool startSensor();
-
- virtual void stopSensor();
-
- virtual bool standby();
-
- virtual bool resume();
-
-protected:
- /**
- * Constructor.
- * @param id Identifier for the adaptor.
- */
- TemperatureAdaptor(const QString& id);
- ~TemperatureAdaptor();
-
- /**
- * Reimplement to allow for 0 interval to be the slowest entry.
- */
- virtual unsigned int evaluateIntervalRequests(int& sessionId) const;
-
-private:
- DeviceAdaptorRingBuffer<TimedUnsigned>* temperatureBuffer_;
-
- unsigned temperatureValue_;
-
- void interpretEvent(int src, struct input_event *ev);
- void commitOutput(struct input_event *ev);
- void interpretSync(int src, struct input_event *ev);
- QByteArray powerStatePath_;
-
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/temperatureadaptor/temperatureadaptor.pro
^
|
@@ -1,9 +0,0 @@
-TARGET = temperatureadaptor
-
-HEADERS += temperatureadaptor.h \
- temperatureadaptorplugin.h
-
-SOURCES += temperatureadaptor.cpp \
- temperatureadaptorplugin.cpp
-
-include( ../adaptor-config.pri )
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/temperatureadaptor/temperatureadaptorplugin.cpp
^
|
@@ -1,40 +0,0 @@
-/**
- @file temperatureadaptorplugin.cpp
- @brief Plugin for TemperatureAdaptorPlugin
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#include "temperatureadaptorplugin.h"
-#include "temperatureadaptor.h"
-#include "sensormanager.h"
-#include "logging.h"
-
-void TemperatureAdaptorPlugin::Register(class Loader&)
-{
- sensordLogD() << "registering temperatureadaptor";
- SensorManager& sm = SensorManager::instance();
- sm.registerDeviceAdaptor<TemperatureAdaptor>("temperatureadaptor");
-}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-Q_EXPORT_PLUGIN2(temperatureadaptor, TemperatureAdaptorPlugin)
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/adaptors/temperatureadaptor/temperatureadaptorplugin.h
^
|
@@ -1,45 +0,0 @@
-/**
- @file alsadaptor-evdevplugin.h
- @brief Plugin for TemperatureAdaptorPlugin
-
- <p>
- Copyright (C) 2009-2010 Nokia Corporation
- Copyright (C) 2015 Jolla
-
- @author Lorn Potter <lorn.potter@jolla.com>
- @author Timo Rongas <ext-timo.2.rongas@nokia.com>
- @author Markus Lehtonen <markus.lehtonen@nokia.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
-*/
-
-#ifndef TEMPERATUREADAPTOR_PLUGIN_H
-#define TEMPERATUREADAPTOR_PLUGIN_H
-
-#include "plugin.h"
-
-class TemperatureAdaptorPlugin : public Plugin
-{
- Q_OBJECT
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
- Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
-#endif
-
-private:
- void Register(class Loader& l);
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/config/sensord-ubuntu.conf
^
|
@@ -1,17 +0,0 @@
-[plugins]
-accelerometeradaptor = iioaccelerometeradaptor
-#alsadaptor = iioaccelerometeradaptor
-#proximityadaptor = iioaccelerometeradaptor
-#magnetometeradaptor = iioaccelerometeradaptor
-#gyroscopeadaptor = iioaccelerometeradaptor
-lidadaptor = lidsensoradaptor-evdev
-
-[lidsensor]
-input_match = Lid,Virtual Button
-#poll_file = /sys/bus/i2c/devices/3-000f/poll
-#powerstate_path = /sys/bus/i2c/devices/3-0068/enable
-
-
-[global]
-device_sys_path = /dev/input/event%1
-#device_poll_file_path = /sys/class/input/input%1/poll
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/datatypes/lid.cpp
^
|
@@ -1,36 +0,0 @@
-/**
- @file lid.cpp
- @brief QObject based datatype for LidData
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "lid.h"
-
-Lid::Lid(const LidData& lidData)
- : QObject(), data_(lidData.timestamp_, lidData.type_, lidData.value_)
-{
-}
-
-Lid::Lid(const Lid& lid)
- : QObject(), data_(lid.lidData().timestamp_, lid.lidData().type_, lid.lidData().value_)
-{
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/datatypes/lid.h
^
|
@@ -1,120 +0,0 @@
-/**
- @file lid.h
- @brief QObject based datatype for LidData
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef LID_H
-#define LID_H
-
-#include <QDBusArgument>
-
-#include <datatypes/liddata.h>
-
-/**
- * QObject facade for #LidData.
- */
-class Lid : public QObject
-{
- Q_OBJECT
-
- // Q_PROPERTY(uint value READ value)
- Q_PROPERTY(int type READ type)
-
-public:
- /**
- * Default constructor.
- */
- Lid() {}
-
- /**
- * Constructor.
- *
- * @param LidData Source object.
- */
- Lid(const LidData& lidData);
-
- /**
- * Copy constructor.
- *
- * @param Lid Source object.
- */
- Lid(const Lid& lid);
-
- /**
- * Returns the contained #LidData.
- * @return LidData
- */
- const LidData& lidData() const { return data_; }
-
- /**
- * Returns Lid type.
- * @return Lid type.
- */
- LidData::Type type() const { return data_.type_; }
-
- unsigned value_;
-
-private:
- LidData data_; /**< Contained Lid data */
-
- friend const QDBusArgument &operator>>(const QDBusArgument &argument, Lid& lid);
-};
-
-Q_DECLARE_METATYPE( Lid )
-
-/**
- * Marshall the Lid data into a D-Bus argument
- *
- * @param argument dbus argument.
- * @param Lid data to marshall.
- * @return dbus argument.
- */
-inline QDBusArgument &operator<<(QDBusArgument &argument, const Lid &lid)
-{
- argument.beginStructure();
- argument << lid.lidData().timestamp_ << (int)(lid.lidData().value_) << (int)(lid.lidData().type_);
- argument.endStructure();
- return argument;
-}
-
-/**
- * Unmarshall Lid data from the D-Bus argument
- *
- * @param argument dbus argument.
- * @param Lid unmarshalled data.
- * @return dbus argument.
- */
-inline const QDBusArgument &operator>>(const QDBusArgument &argument, Lid &lid)
-{
- int tmp;
- argument.beginStructure();
- argument >> lid.data_.timestamp_;
- argument >> tmp;
- lid.data_.value_ = (unsigned)tmp;
- argument >> tmp;
- lid.data_.type_ = (LidData::Type)tmp;
- argument.endStructure();
- return argument;
-}
-
-#endif // LID_H
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/datatypes/liddata.h
^
|
@@ -1,66 +0,0 @@
-/**
- @file LidData.h
- @brief Datatype for device tap events
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef LIDDATA_H
-#define LIDDATA_H
-
-#include <datatypes/genericdata.h>
-
-/**
- * @brief Datatype for device lid events.
- *
- * Contains enumerated values for different types of lid events.
- */
-class LidData : public TimedData {
-public:
-
- /**
- * Type of lid.
- */
- enum Type {
- UnknownLid = -1,
- FrontLid = 0, /**< Front lid. */
- BackLid /**< Back lid. */
- };
-
- LidData::Type type_; /**< Type of lid */
- unsigned value_; /**< Measurement value. */
-
- /**
- * Constructor.
- */
- LidData() : TimedData(0), type_(FrontLid), value_(0) {}
-
- /**
- * Constructor.
- * @param timestamp Timestamp of lid event.
- * @param type Type of lid.
- */
- LidData(const quint64& timestamp, Type type, unsigned value_) :
- TimedData(timestamp), type_(type), value_(0) {}
-};
-
-Q_DECLARE_METATYPE(LidData)
-#endif // LidData_H
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/qt-api/humiditysensor_i.cpp
^
|
@@ -1,76 +0,0 @@
-/**
- @file humiditysensor_i.cpp
- @brief Interface for HumiditySensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "sensormanagerinterface.h"
-#include "humiditysensor_i.h"
-#include "socketreader.h"
-
-const char* HumiditySensorChannelInterface::staticInterfaceName = "local.HumiditySensor";
-
-AbstractSensorChannelInterface* HumiditySensorChannelInterface::factoryMethod(const QString& id, int sessionId)
-{
- return new HumiditySensorChannelInterface(OBJECT_PATH + "/" + id, sessionId);
-}
-
-HumiditySensorChannelInterface::HumiditySensorChannelInterface(const QString& path, int sessionId)
- : AbstractSensorChannelInterface(path, HumiditySensorChannelInterface::staticInterfaceName, sessionId)
-{
-}
-
-const HumiditySensorChannelInterface* HumiditySensorChannelInterface::listenInterface(const QString& id)
-{
- return dynamic_cast<const HumiditySensorChannelInterface*> (interface(id));
-}
-
-HumiditySensorChannelInterface* HumiditySensorChannelInterface::controlInterface(const QString& id)
-{
- return interface(id);
-}
-
-
-HumiditySensorChannelInterface* HumiditySensorChannelInterface::interface(const QString& id)
-{
- SensorManagerInterface& sm = SensorManagerInterface::instance();
- if ( !sm.registeredAndCorrectClassName( id, HumiditySensorChannelInterface::staticMetaObject.className())) {
- return 0;
- }
-
- return dynamic_cast<HumiditySensorChannelInterface*>(sm.interface(id));
-}
-
-bool HumiditySensorChannelInterface::dataReceivedImpl()
-{
- QVector<TimedUnsigned> values;
- if(!read<TimedUnsigned>(values))
- return false;
- foreach(const TimedUnsigned& data, values)
- emit relativeHumidityChanged(data);
- return true;
-}
-
-Unsigned HumiditySensorChannelInterface::relativeHumidity()
-{
- return getAccessor<Unsigned>("relativeHumidity");
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/qt-api/humiditysensor_i.h
^
|
@@ -1,118 +0,0 @@
-/**
- @file humiditysensor_i.h
- @brief Interface for HumiditySensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef HUMIDITYSENSOR_I_H
-#define HUMIDITYSENSOR_I_H
-
-#include <QtDBus/QtDBus>
-
-#include "datatypes/unsigned.h"
-#include "abstractsensor_i.h"
-
-/**
- * Client interface for accessing ambient light sensor.
- * Provides signal on change of measured ambient light intensity level.
- * Previous measured intensity level can be queried any time. Provided
- * values are in \e lux.
- */
-class HumiditySensorChannelInterface : public AbstractSensorChannelInterface
-{
- Q_OBJECT
- Q_DISABLE_COPY(HumiditySensorChannelInterface)
- Q_PROPERTY(Unsigned relativeHumidity READ relativeHumidity NOTIFY relativeHumidityChanged)
-
-public:
- /**
- * Name of the D-Bus interface for this class.
- */
- static const char* staticInterfaceName;
-
- /**
- * Create new instance of the class.
- *
- * @param id Sensor ID.
- * @param sessionId Session ID.
- * @return Pointer to new instance of the class.
- */
- static AbstractSensorChannelInterface* factoryMethod(const QString& id, int sessionId);
-
- /**
- * Get latest relative humidity reading from sensor daemon.
- *
- * @return relative humidity reading.
- */
- Unsigned relativeHumidity();
-
- /**
- * Constructor.
- *
- * @param path path.
- * @param sessionId session ID.
- */
- HumiditySensorChannelInterface(const QString& path, int sessionId);
-
- /**
- * Request a listening interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- * @deprecated use interface(const QString&) instead.
- */
- static const HumiditySensorChannelInterface* listenInterface(const QString& id);
-
- /**
- * Request a control interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- * @deprecated use interface(const QString&) instead.
- */
- static HumiditySensorChannelInterface* controlInterface(const QString& id);
-
- /**
- * Request an interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- */
- static HumiditySensorChannelInterface* interface(const QString& id);
-
-protected:
- virtual bool dataReceivedImpl();
-
-Q_SIGNALS:
- /**
- * Sent when measured relative humidity has changed.
- *
- * @param value relative humidity reading.
- */
- void relativeHumidityChanged(const Unsigned& value);
-};
-
-namespace local {
- typedef ::HumiditySensorChannelInterface HumiditySensor;
-}
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/qt-api/lidsensor_i.cpp
^
|
@@ -1,76 +0,0 @@
-/**
- @file lidsensor_i.cpp
- @brief Interface for LidSensor
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "sensormanagerinterface.h"
-#include "lidsensor_i.h"
-#include "socketreader.h"
-
-const char* LidSensorChannelInterface::staticInterfaceName = "local.LidSensor";
-
-AbstractSensorChannelInterface* LidSensorChannelInterface::factoryMethod(const QString& id, int sessionId)
-{
- return new LidSensorChannelInterface(OBJECT_PATH + "/" + id, sessionId);
-}
-
-LidSensorChannelInterface::LidSensorChannelInterface(const QString& path, int sessionId)
- : AbstractSensorChannelInterface(path, LidSensorChannelInterface::staticInterfaceName, sessionId)
-{
-}
-
-const LidSensorChannelInterface* LidSensorChannelInterface::listenInterface(const QString& id)
-{
- return dynamic_cast<const LidSensorChannelInterface*> (interface(id));
-}
-
-LidSensorChannelInterface* LidSensorChannelInterface::controlInterface(const QString& id)
-{
- return interface(id);
-}
-
-
-LidSensorChannelInterface* LidSensorChannelInterface::interface(const QString& id)
-{
- SensorManagerInterface& sm = SensorManagerInterface::instance();
- if (!sm.registeredAndCorrectClassName(id, LidSensorChannelInterface::staticMetaObject.className())) {
- return 0;
- }
-
- return dynamic_cast<LidSensorChannelInterface*>(sm.interface(id));
-}
-
-bool LidSensorChannelInterface::dataReceivedImpl()
-{
- QVector<LidData> values;
- if (!read<LidData>(values))
- return false;
- foreach(const LidData &data, values)
- emit lidChanged(data);
- return true;
-}
-
-LidData LidSensorChannelInterface::closed()
-{
- return getAccessor<LidData>("closed");
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/qt-api/lidsensor_i.h
^
|
@@ -1,115 +0,0 @@
-/**
- @file alssensor_i.h
- @brief Interface for ALSSensor
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef LIDSENSOR_I_H
-#define LIDSENSOR_I_H
-
-#include <QtDBus/QtDBus>
-
-#include "datatypes/liddata.h"
-#include "abstractsensor_i.h"
-
-/**
- * Client interface for listening to lid sensor state changes.
- */
-class LidSensorChannelInterface : public AbstractSensorChannelInterface
-{
- Q_OBJECT
- Q_DISABLE_COPY(LidSensorChannelInterface)
- Q_PROPERTY(LidData closed READ closed)
-
-public:
- /**
- * Name of the D-Bus interface for this class.
- */
- static const char* staticInterfaceName;
-
- /**
- * Create new instance of the class.
- *
- * @param id Sensor ID.
- * @param sessionId Session ID.
- * @return Pointer to new instance of the class.
- */
- static AbstractSensorChannelInterface* factoryMethod(const QString& id, int sessionId);
-
- /**
- * Get latest lid reading from sensor daemon.
- *
- * @return lid reading.
- */
- LidData closed();
-
- /**
- * Constructor.
- *
- * @param path path.
- * @param sessionId session ID.
- */
- LidSensorChannelInterface(const QString& path, int sessionId);
-
- /**
- * Request a listening interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- * @deprecated use interface(const QString&) instead.
- */
- static const LidSensorChannelInterface* listenInterface(const QString& id);
-
- /**
- * Request a control interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- * @deprecated use interface(const QString&) instead.
- */
- static LidSensorChannelInterface* controlInterface(const QString& id);
-
- /**
- * Request an interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- */
- static LidSensorChannelInterface* interface(const QString& id);
-
-protected:
- virtual bool dataReceivedImpl();
-
-Q_SIGNALS:
- /**
- * Sent when measured ambient light intensity has changed.
- *
- * @param value ambient light reading.
- */
- void lidChanged(const LidData& value);
-};
-
-namespace local {
- typedef ::LidSensorChannelInterface LidSensor;
-}
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/qt-api/pressuresensor_i.cpp
^
|
@@ -1,76 +0,0 @@
-/**
- @file pressuresensor_i.cpp
- @brief Interface for PressureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "sensormanagerinterface.h"
-#include "pressuresensor_i.h"
-#include "socketreader.h"
-
-const char* PressureSensorChannelInterface::staticInterfaceName = "local.PressureSensor";
-
-AbstractSensorChannelInterface* PressureSensorChannelInterface::factoryMethod(const QString& id, int sessionId)
-{
- return new PressureSensorChannelInterface(OBJECT_PATH + "/" + id, sessionId);
-}
-
-PressureSensorChannelInterface::PressureSensorChannelInterface(const QString& path, int sessionId)
- : AbstractSensorChannelInterface(path, PressureSensorChannelInterface::staticInterfaceName, sessionId)
-{
-}
-
-const PressureSensorChannelInterface* PressureSensorChannelInterface::listenInterface(const QString& id)
-{
- return dynamic_cast<const PressureSensorChannelInterface*> (interface(id));
-}
-
-PressureSensorChannelInterface* PressureSensorChannelInterface::controlInterface(const QString& id)
-{
- return interface(id);
-}
-
-
-PressureSensorChannelInterface* PressureSensorChannelInterface::interface(const QString& id)
-{
- SensorManagerInterface& sm = SensorManagerInterface::instance();
- if ( !sm.registeredAndCorrectClassName( id, PressureSensorChannelInterface::staticMetaObject.className())) {
- return 0;
- }
-
- return dynamic_cast<PressureSensorChannelInterface*>(sm.interface(id));
-}
-
-bool PressureSensorChannelInterface::dataReceivedImpl()
-{
- QVector<TimedUnsigned> values;
- if(!read<TimedUnsigned>(values))
- return false;
- foreach(const TimedUnsigned& data, values)
- emit pressureChanged(data);
- return true;
-}
-
-Unsigned PressureSensorChannelInterface::pressure()
-{
- return getAccessor<Unsigned>("pressure");
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/qt-api/pressuresensor_i.h
^
|
@@ -1,118 +0,0 @@
-/**
- @file pressuresensor_i.h
- @brief Interface for PressureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef PRESSURESENSOR_I_H
-#define PRESSURESENSOR_I_H
-
-#include <QtDBus/QtDBus>
-
-#include "datatypes/unsigned.h"
-#include "abstractsensor_i.h"
-
-/**
- * Client interface for accessing pressure sensor.
- * Provides signal on change of measured pressure level.
- * Previous measured pressure level can be queried any time. Provided
- * values are in \e pascals.
- */
-class PressureSensorChannelInterface : public AbstractSensorChannelInterface
-{
- Q_OBJECT
- Q_DISABLE_COPY(PressureSensorChannelInterface)
- Q_PROPERTY(Unsigned pressure READ pressure NOTIFY pressureChanged)
-
-public:
- /**
- * Name of the D-Bus interface for this class.
- */
- static const char* staticInterfaceName;
-
- /**
- * Create new instance of the class.
- *
- * @param id Sensor ID.
- * @param sessionId Session ID.
- * @return Pointer to new instance of the class.
- */
- static AbstractSensorChannelInterface* factoryMethod(const QString& id, int sessionId);
-
- /**
- * Get latest pressure from sensor daemon.
- *
- * @return pressure reading.
- */
- Unsigned pressure();
-
- /**
- * Constructor.
- *
- * @param path path.
- * @param sessionId session ID.
- */
- PressureSensorChannelInterface(const QString& path, int sessionId);
-
- /**
- * Request a listening interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- * @deprecated use interface(const QString&) instead.
- */
- static const PressureSensorChannelInterface* listenInterface(const QString& id);
-
- /**
- * Request a control interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- * @deprecated use interface(const QString&) instead.
- */
- static PressureSensorChannelInterface* controlInterface(const QString& id);
-
- /**
- * Request an interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- */
- static PressureSensorChannelInterface* interface(const QString& id);
-
-protected:
- virtual bool dataReceivedImpl();
-
-Q_SIGNALS:
- /**
- * Sent when measured ambient light intensity has changed.
- *
- * @param value ambient light reading.
- */
- void pressureChanged(const Unsigned& value);
-};
-
-namespace local {
- typedef ::PressureSensorChannelInterface PressureSensor;
-}
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/qt-api/temperaturesensor_i.cpp
^
|
@@ -1,76 +0,0 @@
-/**
- @file temperaturesensor_i.cpp
- @brief Interface for TemperatureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "sensormanagerinterface.h"
-#include "temperaturesensor_i.h"
-#include "socketreader.h"
-
-const char* TemperatureSensorChannelInterface::staticInterfaceName = "local.TemperatureSensor";
-
-AbstractSensorChannelInterface* TemperatureSensorChannelInterface::factoryMethod(const QString& id, int sessionId)
-{
- return new TemperatureSensorChannelInterface(OBJECT_PATH + "/" + id, sessionId);
-}
-
-TemperatureSensorChannelInterface::TemperatureSensorChannelInterface(const QString& path, int sessionId)
- : AbstractSensorChannelInterface(path, TemperatureSensorChannelInterface::staticInterfaceName, sessionId)
-{
-}
-
-const TemperatureSensorChannelInterface* TemperatureSensorChannelInterface::listenInterface(const QString& id)
-{
- return dynamic_cast<const TemperatureSensorChannelInterface*> (interface(id));
-}
-
-TemperatureSensorChannelInterface* TemperatureSensorChannelInterface::controlInterface(const QString& id)
-{
- return interface(id);
-}
-
-
-TemperatureSensorChannelInterface* TemperatureSensorChannelInterface::interface(const QString& id)
-{
- SensorManagerInterface& sm = SensorManagerInterface::instance();
- if ( !sm.registeredAndCorrectClassName( id, TemperatureSensorChannelInterface::staticMetaObject.className())) {
- return 0;
- }
-
- return dynamic_cast<TemperatureSensorChannelInterface*>(sm.interface(id));
-}
-
-bool TemperatureSensorChannelInterface::dataReceivedImpl()
-{
- QVector<TimedUnsigned> values;
- if(!read<TimedUnsigned>(values))
- return false;
- foreach(const TimedUnsigned& data, values)
- emit temperatureChanged(data);
- return true;
-}
-
-Unsigned TemperatureSensorChannelInterface::temperature()
-{
- return getAccessor<Unsigned>("temperature");
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/qt-api/temperaturesensor_i.h
^
|
@@ -1,118 +0,0 @@
-/**
- @file temperaturesensor_i.h
- @brief Interface for TemperatureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef TEMPERATURESENSOR_I_H
-#define TEMPERATURESENSOR_I_H
-
-#include <QtDBus/QtDBus>
-
-#include "datatypes/unsigned.h"
-#include "abstractsensor_i.h"
-
-/**
- * Client interface for accessing temperature sensor.
- * Provides signal on change of measured temperature level.
- * Previous measured intensity level can be queried any time. Provided
- * values are in \e celcius.
- */
-class TemperatureSensorChannelInterface : public AbstractSensorChannelInterface
-{
- Q_OBJECT
- Q_DISABLE_COPY(TemperatureSensorChannelInterface)
- Q_PROPERTY(Unsigned temperature READ temperature NOTIFY temperatureChanged)
-
-public:
- /**
- * Name of the D-Bus interface for this class.
- */
- static const char* staticInterfaceName;
-
- /**
- * Create new instance of the class.
- *
- * @param id Sensor ID.
- * @param sessionId Session ID.
- * @return Pointer to new instance of the class.
- */
- static AbstractSensorChannelInterface* factoryMethod(const QString& id, int sessionId);
-
- /**
- * Get latest temperature reading from sensor daemon.
- *
- * @return temperature reading.
- */
- Unsigned temperature();
-
- /**
- * Constructor.
- *
- * @param path path.
- * @param sessionId session ID.
- */
- TemperatureSensorChannelInterface(const QString& path, int sessionId);
-
- /**
- * Request a listening interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- * @deprecated use interface(const QString&) instead.
- */
- static const TemperatureSensorChannelInterface* listenInterface(const QString& id);
-
- /**
- * Request a control interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- * @deprecated use interface(const QString&) instead.
- */
- static TemperatureSensorChannelInterface* controlInterface(const QString& id);
-
- /**
- * Request an interface to the sensor.
- *
- * @param id sensor ID.
- * @return Pointer to interface, or NULL on failure.
- */
- static TemperatureSensorChannelInterface* interface(const QString& id);
-
-protected:
- virtual bool dataReceivedImpl();
-
-Q_SIGNALS:
- /**
- * Sent when measured temperature has changed.
- *
- * @param value ambient light reading.
- */
- void temperatureChanged(const Unsigned& value);
-};
-
-namespace local {
- typedef ::TemperatureSensorChannelInterface TemperatureSensor;
-}
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/humiditysensor/humidityplugin.cpp
^
|
@@ -1,50 +0,0 @@
-/**
- @file HumidityPlugin.cpp
- @brief Plugin for HumiditySensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "humidityplugin.h"
-#include "humiditysensor.h"
-#include "sensormanager.h"
-#include "logging.h"
-
-void HumidityPlugin::Register(class Loader&)
-{
- sensordLogD() << "registering humiditysensor";
- SensorManager& sm = SensorManager::instance();
- sm.registerSensor<HumiditySensorChannel>("humiditysensor");
-}
-
-void HumidityPlugin::Init(class Loader& l)
-{
- Q_UNUSED(l);
- SensorManager::instance().requestSensor("humiditysensor");
-}
-
-QStringList HumidityPlugin::Dependencies() {
- return QString("humidityadaptor").split(":", QString::SkipEmptyParts);
-}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-Q_EXPORT_PLUGIN2(humiditysensor, HumidityPlugin)
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/humiditysensor/humidityplugin.h
^
|
@@ -1,43 +0,0 @@
-/**
- @file humidityplugin.h
- @brief Plugin for HumiditySensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef HUMIDITYPLUGIN_H
-#define HUMIDITYPLUGIN_H
-
-#include "plugin.h"
-
-class HumidityPlugin : public Plugin
-{
- Q_OBJECT
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
- Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
-#endif
-private:
- void Register(class Loader& l);
- void Init(class Loader& l);
- QStringList Dependencies();
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/humiditysensor/humiditysensor.cpp
^
|
@@ -1,122 +0,0 @@
-/**
- @file humiditysensor.cpp
- @brief humiditySensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "humiditysensor.h"
-
-#include "sensormanager.h"
-#include "bin.h"
-#include "bufferreader.h"
-#include "datatypes/orientation.h"
-
-HumiditySensorChannel::HumiditySensorChannel(const QString& id) :
- AbstractSensorChannel(id),
- DataEmitter<TimedUnsigned>(1),
- previousRelativeValue_(0,0)
-{
- SensorManager& sm = SensorManager::instance();
-
- humidityAdaptor_ = sm.requestDeviceAdaptor("humidityadaptor");
- if (!humidityAdaptor_) {
- setValid(false);
- return;
- }
-
- humidityReader_ = new BufferReader<TimedUnsigned>(1);
-
- outputBuffer_ = new RingBuffer<TimedUnsigned>(1);
-
- // Create buffers for filter chain
- filterBin_ = new Bin;
-
- filterBin_->add(humidityReader_, "humidity");
- filterBin_->add(outputBuffer_, "buffer");
-
- filterBin_->join("humidity", "source", "buffer", "sink");
-
- // Join datasources to the chain
- connectToSource(humidityAdaptor_, "humidity", humidityReader_);
-
- marshallingBin_ = new Bin;
- marshallingBin_->add(this, "sensorchannel");
-
- outputBuffer_->join(this);
-
-
- setDescription("relative humidity in percentage");
- setRangeSource(humidityAdaptor_);
- addStandbyOverrideSource(humidityAdaptor_);
- setIntervalSource(humidityAdaptor_);
-
- setValid(true);
-}
-
-HumiditySensorChannel::~HumiditySensorChannel()
-{
- if (isValid()) {
- SensorManager& sm = SensorManager::instance();
-
- disconnectFromSource(humidityAdaptor_, "humidity", humidityReader_);
-
- sm.releaseDeviceAdaptor("humidityadaptor");
-
- delete humidityReader_;
- delete outputBuffer_;
- delete marshallingBin_;
- delete filterBin_;
- }
-}
-
-bool HumiditySensorChannel::start()
-{
- sensordLogD() << "Starting HumiditySensorChannel";
-
- if (AbstractSensorChannel::start()) {
- marshallingBin_->start();
- filterBin_->start();
- humidityAdaptor_->startSensor();
- }
- return true;
-}
-
-bool HumiditySensorChannel::stop()
-{
- sensordLogD() << "Stopping HumiditySensorChannel";
-
- if (AbstractSensorChannel::stop()) {
- humidityAdaptor_->stopSensor();
- filterBin_->stop();
- marshallingBin_->stop();
- }
- return true;
-}
-
-void HumiditySensorChannel::emitData(const TimedUnsigned& value)
-{
- if (value.value_ != previousRelativeValue_.value_) {
- previousRelativeValue_.value_ = value.value_;
-
- writeToClients((const void*)(&value), sizeof(value));
- }
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/humiditysensor/humiditysensor.h
^
|
@@ -1,101 +0,0 @@
-/**
- @file humiditysensor.h
- @brief humiditysensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef HUMIDITY_SENSOR_CHANNEL_H
-#define HUMIDITY_SENSOR_CHANNEL_H
-
-#include <QObject>
-
-#include "deviceadaptor.h"
-#include "abstractsensor.h"
-#include "humiditysensor_a.h"
-#include "dataemitter.h"
-#include "datatypes/timedunsigned.h"
-#include "datatypes/unsigned.h"
-
-class Bin;
-template <class TYPE> class BufferReader;
-class FilterBase;
-
-/**
- * @brief Sensor for accessing the relative humidity sensor measurements.
- *
- * Signals listeners whenever observed relative humidity level has
- * changed.
- */
-class HumiditySensorChannel :
- public AbstractSensorChannel,
- public DataEmitter<TimedUnsigned>
-{
- Q_OBJECT
- Q_PROPERTY(Unsigned relativeHumidity READ relativeHumidity NOTIFY relativeHumidityChanged)
-
-public:
- /**
- * Factory method for HumiditySensorChannel.
- * @return New HumiditySensorChannel as AbstractSensorChannel*
- */
- static AbstractSensorChannel* factoryMethod(const QString& id)
- {
- HumiditySensorChannel* sc = new HumiditySensorChannel(id);
- new HumiditySensorChannelAdaptor(sc);
-
- return sc;
- }
-
- /**
- * Property for accessing the measured value.
- * @return Last measured value.
- */
- Unsigned relativeHumidity() const { return previousRelativeValue_; }
-
-public Q_SLOTS:
- bool start();
- bool stop();
-
-signals:
- /**
- * Sent when a change in measured data is observed.
- * @param value Measured value.
- */
- void relativeHumidityChanged(const Unsigned& value);
-
-protected:
- HumiditySensorChannel(const QString& id);
- virtual ~HumiditySensorChannel();
-
-private:
- TimedUnsigned previousRelativeValue_;
- TimedUnsigned previousAbsoluteValue_;
- Bin* filterBin_;
- Bin* marshallingBin_;
- DeviceAdaptor* humidityAdaptor_;
- BufferReader<TimedUnsigned>* humidityReader_;
- RingBuffer<TimedUnsigned>* outputBuffer_;
-
- void emitData(const TimedUnsigned& value);
-};
-
-#endif // HUMIDITY_SENSOR_CHANNEL_H
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/humiditysensor/humiditysensor.pro
^
|
@@ -1,19 +0,0 @@
-CONFIG += link_pkgconfig
-
-TARGET = humiditysensor
-
-HEADERS += humiditysensor.h \
- humiditysensor_a.h \
- humidityplugin.h
-
-SOURCES += humiditysensor.cpp \
- humiditysensor_a.cpp \
- humidityplugin.cpp
-
-include( ../sensor-config.pri )
-
-contextprovider {
- DEFINES += PROVIDE_CONTEXT_INFO
- PKGCONFIG += contextprovider-1.0
-}
-
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/humiditysensor/humiditysensor_a.cpp
^
|
@@ -1,36 +0,0 @@
-/**
- @file humiditysensor_a.cpp
- @brief D-Bus adaptor for HumiditySensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "humiditysensor_a.h"
-
-HumiditySensorChannelAdaptor::HumiditySensorChannelAdaptor(QObject* parent) :
- AbstractSensorChannelAdaptor(parent)
-{
-}
-
-Unsigned HumiditySensorChannelAdaptor::relativeHumidity() const
-{
- return qvariant_cast<Unsigned>(parent()->property("relativeHumidity"));
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/humiditysensor/humiditysensor_a.h
^
|
@@ -1,52 +0,0 @@
-/**
- @file humiditysensor_a.h
- @brief D-Bus adaptor for ALSSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef HUMIDITY_SENSOR_H
-#define HUMIDITY_SENSOR_H
-
-#include <QtDBus/QtDBus>
-#include <QObject>
-
-#include "datatypes/unsigned.h"
-#include "abstractsensor_a.h"
-
-class HumiditySensorChannelAdaptor : public AbstractSensorChannelAdaptor
-{
- Q_OBJECT
- Q_DISABLE_COPY(HumiditySensorChannelAdaptor)
- Q_CLASSINFO("D-Bus Interface", "local.HumiditySensor")
- Q_PROPERTY(Unsigned relativeHumidity READ relativeHumidity NOTIFY relativeHumidityChanged)
-
-public:
- HumiditySensorChannelAdaptor(QObject* parent);
-
-public Q_SLOTS:
- Unsigned relativeHumidity() const;
-
-Q_SIGNALS:
- void relativeHumidityChanged(const Unsigned& value);
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/lidsensor/lidplugin.cpp
^
|
@@ -1,50 +0,0 @@
-/**
- @file LidPlugin.cpp
- @brief Plugin for ALSSensor
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "lidplugin.h"
-#include "lidsensor.h"
-#include "sensormanager.h"
-#include "logging.h"
-
-void LidPlugin::Register(class Loader&)
-{
- sensordLogD() << "registering lidsensor";
- SensorManager& sm = SensorManager::instance();
- sm.registerSensor<LidSensorChannel>("lidsensor");
-}
-
-void LidPlugin::Init(class Loader& l)
-{
- Q_UNUSED(l);
- SensorManager::instance().requestSensor("lidsensor");
-}
-
-QStringList LidPlugin::Dependencies() {
- return QString("lidsensoradaptor").split(":", QString::SkipEmptyParts);
-}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-Q_EXPORT_PLUGIN2(lidsensor, LidPlugin)
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/lidsensor/lidplugin.h
^
|
@@ -1,42 +0,0 @@
-/**
- @file lidplugin.h
- @brief Plugin for lidSensor
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef LIDPLUGIN_H
-#define LIDPLUGIN_H
-
-#include "plugin.h"
-
-class LidPlugin : public Plugin
-{
- Q_OBJECT
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
- Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
-#endif
-private:
- void Register(class Loader& l);
- void Init(class Loader& l);
- QStringList Dependencies();
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/lidsensor/lidsensor.cpp
^
|
@@ -1,122 +0,0 @@
-/**
- @file lidsensor.cpp
- @brief LidSensor
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "lidsensor.h"
-
-#include "sensormanager.h"
-#include "bin.h"
-#include "bufferreader.h"
-#include "datatypes/orientation.h"
-#include "datatypes/lid.h"
-
-LidSensorChannel::LidSensorChannel(const QString& id) :
- AbstractSensorChannel(id),
- DataEmitter<LidData>(1),
- previousValue_(0, LidData::FrontLid, 0)
-{
- SensorManager& sm = SensorManager::instance();
-
- lidAdaptor_ = sm.requestDeviceAdaptor("lidsensoradaptor");
- if (!lidAdaptor_) {
- setValid(false);
- return;
- }
-
- lidReader_ = new BufferReader<LidData>(1);
-
- outputBuffer_ = new RingBuffer<LidData>(1);
-
- // Create buffers for filter chain
- filterBin_ = new Bin;
-
- filterBin_->add(lidReader_, "lid");
- filterBin_->add(outputBuffer_, "buffer");
-
- filterBin_->join("lid", "source", "buffer", "sink");
-
- // Join datasources to the chain
- connectToSource(lidAdaptor_, "lid", lidReader_);
-
- marshallingBin_ = new Bin;
- marshallingBin_->add(this, "sensorchannel");
-
- outputBuffer_->join(this);
-
- setDescription("lid closed");
- setRangeSource(lidAdaptor_);
- addStandbyOverrideSource(lidAdaptor_);
- setIntervalSource(lidAdaptor_);
-
- setValid(true);
-}
-
-LidSensorChannel::~LidSensorChannel()
-{
- if (isValid()) {
- SensorManager& sm = SensorManager::instance();
-
- disconnectFromSource(lidAdaptor_, "lid", lidReader_);
-
- sm.releaseDeviceAdaptor("lidadaptor");
-
- delete lidReader_;
- delete outputBuffer_;
- delete marshallingBin_;
- delete filterBin_;
- }
-}
-
-bool LidSensorChannel::start()
-{
- sensordLogD() << "Starting LidSensorChannel";
-
- if (AbstractSensorChannel::start()) {
- marshallingBin_->start();
- filterBin_->start();
- lidAdaptor_->startSensor();
- }
- return true;
-}
-
-bool LidSensorChannel::stop()
-{
- sensordLogD() << "Stopping LidSensorChannel";
-
- if (AbstractSensorChannel::stop()) {
- lidAdaptor_->stopSensor();
- filterBin_->stop();
- marshallingBin_->stop();
- }
- return true;
-}
-
-void LidSensorChannel::emitData(const LidData& value)
-{
- if (value.value_ != previousValue_.value_) {
- previousValue_.value_ = value.value_;
-
- writeToClients((const void*)(&value), sizeof(value));
- }
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/lidsensor/lidsensor.h
^
|
@@ -1,101 +0,0 @@
-/**
- @file lidsensor.h
- @brief LidSensor
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef LID_SENSOR_CHANNEL_H
-#define LID_SENSOR_CHANNEL_H
-
-#include <QObject>
-
-#include "deviceadaptor.h"
-#include "abstractsensor.h"
-#include "lidsensor_a.h"
-#include "dataemitter.h"
-#include "datatypes/liddata.h"
-#include "datatypes/lid.h"
-class Bin;
-template <class TYPE> class BufferReader;
-class FilterBase;
-
-
-/**
- * @brief Sensor for accessing the internal ambient light sensor measurements.
- *
- * Signals listeners whenever observed ambient light intensity level has
- * changed.
- */
-class LidSensorChannel :
- public AbstractSensorChannel,
- public DataEmitter<LidData>
-{
- Q_OBJECT
- Q_PROPERTY(LidData closed READ closed)
-
-public:
- /**
- * Factory method for LidSensorChannel.
- * @return New LidSensorChannel as AbstractSensorChannel*
- */
- static AbstractSensorChannel* factoryMethod(const QString& id)
- {
- LidSensorChannel* sc = new LidSensorChannel(id);
- new LidSensorChannelAdaptor(sc);
-
- return sc;
- }
-
- /**
- * Property for accessing the measured value.
- * @return Last measured value.
- */
- LidData closed() const { return previousValue_; }
-
-public Q_SLOTS:
- bool start();
- bool stop();
-
-signals:
- /**
- * Sent when a change in measured data is observed.
- * @param value Measured value.
- */
- void lidChanged(const Lid& value);
-
-protected:
- LidSensorChannel(const QString& id);
- virtual ~LidSensorChannel();
-
-private:
- LidData previousValue_;
- Bin* filterBin_;
- Bin* marshallingBin_;
- DeviceAdaptor* lidAdaptor_;
- BufferReader<LidData>* lidReader_;
- RingBuffer<LidData>* outputBuffer_;
-
- void emitData(const LidData& value);
-
-};
-
-#endif // LID_SENSOR_CHANNEL_H
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/lidsensor/lidsensor.pro
^
|
@@ -1,13 +0,0 @@
-CONFIG += link_pkgconfig
-
-TARGET = lidsensor
-
-HEADERS += lidsensor.h \
- lidsensor_a.h \
- lidplugin.h
-
-SOURCES += lidsensor.cpp \
- lidsensor_a.cpp \
- lidplugin.cpp
-
-include( ../sensor-config.pri )
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/lidsensor/lidsensor_a.cpp
^
|
@@ -1,36 +0,0 @@
-/**
- @file lidsensor_a.cpp
- @brief D-Bus adaptor for LidSensor
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "lidsensor_a.h"
-
-LidSensorChannelAdaptor::LidSensorChannelAdaptor(QObject* parent) :
- AbstractSensorChannelAdaptor(parent)
-{
-}
-
-Unsigned LidSensorChannelAdaptor::closed() const
-{
- return qvariant_cast<Unsigned>(parent()->property("closed"));
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/lidsensor/lidsensor_a.h
^
|
@@ -1,52 +0,0 @@
-/**
- @file lidsensor_a.h
- @brief D-Bus adaptor for LidSensor
-
- <p>
- Copyright (C) 2016 Canonical, Ltd.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensord.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef LID_SENSOR_H
-#define LID_SENSOR_H
-
-#include <QtDBus/QtDBus>
-#include <QObject>
-
-#include "datatypes/unsigned.h"
-#include "abstractsensor_a.h"
-
-class LidSensorChannelAdaptor : public AbstractSensorChannelAdaptor
-{
- Q_OBJECT
- Q_DISABLE_COPY(LidSensorChannelAdaptor)
- Q_CLASSINFO("D-Bus Interface", "local.LidSensor")
- Q_PROPERTY(Unsigned closed READ closed)
-
-public:
- LidSensorChannelAdaptor(QObject* parent);
-
-public Q_SLOTS:
- Unsigned closed() const;
-
-Q_SIGNALS:
- void lidChanged(bool value);
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/pressuresensor/pressureplugin.cpp
^
|
@@ -1,50 +0,0 @@
-/**
- @file PressurePlugin.cpp
- @brief Plugin for ALSSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "pressureplugin.h"
-#include "pressuresensor.h"
-#include "sensormanager.h"
-#include "logging.h"
-
-void PressurePlugin::Register(class Loader&)
-{
- sensordLogD() << "registering pressuresensor";
- SensorManager& sm = SensorManager::instance();
- sm.registerSensor<PressureSensorChannel>("pressuresensor");
-}
-
-void PressurePlugin::Init(class Loader& l)
-{
- Q_UNUSED(l);
- SensorManager::instance().requestSensor("pressuresensor");
-}
-
-QStringList PressurePlugin::Dependencies() {
- return QString("pressureadaptor").split(":", QString::SkipEmptyParts);
-}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-Q_EXPORT_PLUGIN2(pressuresensor, PressurePlugin)
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/pressuresensor/pressureplugin.h
^
|
@@ -1,43 +0,0 @@
-/**
- @file alsplugin.h
- @brief Plugin for ALSSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef PRESSUREPLUGIN_H
-#define PRESSUREPLUGIN_H
-
-#include "plugin.h"
-
-class PressurePlugin : public Plugin
-{
- Q_OBJECT
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
- Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
-#endif
-private:
- void Register(class Loader& l);
- void Init(class Loader& l);
- QStringList Dependencies();
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/pressuresensor/pressuresensor.cpp
^
|
@@ -1,120 +0,0 @@
-/**
- @file pressuresensor.cpp
- @brief PressureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "pressuresensor.h"
-
-#include "sensormanager.h"
-#include "bin.h"
-#include "bufferreader.h"
-
-PressureSensorChannel::PressureSensorChannel(const QString& id) :
- AbstractSensorChannel(id),
- DataEmitter<TimedUnsigned>(1),
- previousValue_(0,0)
-{
- SensorManager& sm = SensorManager::instance();
-
- pressureAdaptor_ = sm.requestDeviceAdaptor("alsadaptor");
- if (!pressureAdaptor_) {
- setValid(false);
- return;
- }
-
- pressureReader_ = new BufferReader<TimedUnsigned>(1);
-
- outputBuffer_ = new RingBuffer<TimedUnsigned>(1);
-
- // Create buffers for filter chain
- filterBin_ = new Bin;
-
- filterBin_->add(pressureReader_, "als");
- filterBin_->add(outputBuffer_, "buffer");
-
- filterBin_->join("als", "source", "buffer", "sink");
-
- // Join datasources to the chain
- connectToSource(pressureAdaptor_, "als", pressureReader_);
-
- marshallingBin_ = new Bin;
- marshallingBin_->add(this, "sensorchannel");
-
- outputBuffer_->join(this);
-
- setDescription("ambient light intensity in lux");
- setRangeSource(pressureAdaptor_);
- addStandbyOverrideSource(pressureAdaptor_);
- setIntervalSource(pressureAdaptor_);
-
- setValid(true);
-}
-
-PressureSensorChannel::~PressureSensorChannel()
-{
- if (isValid()) {
- SensorManager& sm = SensorManager::instance();
-
- disconnectFromSource(pressureAdaptor_, "pressure", pressureReader_);
-
- sm.releaseDeviceAdaptor("alsadaptor");
-
- delete pressureReader_;
- delete outputBuffer_;
- delete marshallingBin_;
- delete filterBin_;
- }
-}
-
-bool PressureSensorChannel::start()
-{
- sensordLogD() << "Starting PressureSensorChannel";
-
- if (AbstractSensorChannel::start()) {
- marshallingBin_->start();
- filterBin_->start();
- pressureAdaptor_->startSensor();
- }
- return true;
-}
-
-bool PressureSensorChannel::stop()
-{
- sensordLogD() << "Stopping PressureSensorChannel";
-
- if (AbstractSensorChannel::stop()) {
- pressureAdaptor_->stopSensor();
- filterBin_->stop();
- marshallingBin_->stop();
- }
- return true;
-}
-
-void PressureSensorChannel::emitData(const TimedUnsigned& value)
-{
- if (value.value_ != previousValue_.value_) {
- previousValue_.value_ = value.value_;
-
- writeToClients((const void*)(&value), sizeof(value));
- }
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/pressuresensor/pressuresensor.h
^
|
@@ -1,100 +0,0 @@
-/**
- @file pressuresensor.h
- @brief PressureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef PRESSURE_SENSOR_CHANNEL_H
-#define PRESSURE_SENSOR_CHANNEL_H
-
-#include <QObject>
-
-#include "deviceadaptor.h"
-#include "abstractsensor.h"
-#include "pressuresensor_a.h"
-#include "dataemitter.h"
-#include "datatypes/timedunsigned.h"
-#include "datatypes/unsigned.h"
-
-class Bin;
-template <class TYPE> class BufferReader;
-class FilterBase;
-
-/**
- * @brief Sensor for accessing the internal ambient light sensor measurements.
- *
- * Signals listeners whenever observed ambient light intensity level has
- * changed.
- */
-class PressureSensorChannel :
- public AbstractSensorChannel,
- public DataEmitter<TimedUnsigned>
-{
- Q_OBJECT
- Q_PROPERTY(Unsigned pressure READ pressure NOTIFY pressureChanged)
-
-public:
- /**
- * Factory method for PressureSensorChannel.
- * @return New PressureSensorChannel as AbstractSensorChannel*
- */
- static AbstractSensorChannel* factoryMethod(const QString& id)
- {
- PressureSensorChannel* sc = new PressureSensorChannel(id);
- new PressureSensorChannelAdaptor(sc);
-
- return sc;
- }
-
- /**
- * Property for accessing the measured value.
- * @return Last measured value.
- */
- Unsigned pressure() const { return previousValue_; }
-
-public Q_SLOTS:
- bool start();
- bool stop();
-
-signals:
- /**
- * Sent when a change in measured data is observed.
- * @param value Measured value.
- */
- void pressureChanged(const Unsigned& value);
-
-protected:
- PressureSensorChannel(const QString& id);
- virtual ~PressureSensorChannel();
-
-private:
- TimedUnsigned previousValue_;
- Bin* filterBin_;
- Bin* marshallingBin_;
- DeviceAdaptor* pressureAdaptor_;
- BufferReader<TimedUnsigned>* pressureReader_;
- RingBuffer<TimedUnsigned>* outputBuffer_;
-
- void emitData(const TimedUnsigned& value);
-};
-
-#endif // PRESSURE_SENSOR_CHANNEL_H
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/pressuresensor/pressuresensor.pro
^
|
@@ -1,19 +0,0 @@
-CONFIG += link_pkgconfig
-
-TARGET = pressuresensor
-
-HEADERS += pressuresensor.h \
- pressuresensor_a.h \
- pressureplugin.h
-
-SOURCES += pressuresensor.cpp \
- pressuresensor_a.cpp \
- pressureplugin.cpp
-
-include( ../sensor-config.pri )
-
-contextprovider {
- DEFINES += PROVIDE_CONTEXT_INFO
- PKGCONFIG += contextprovider-1.0
-}
-
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/pressuresensor/pressuresensor_a.cpp
^
|
@@ -1,36 +0,0 @@
-/**
- @file pressuresensor_a.cpp
- @brief D-Bus adaptor for PressureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "pressuresensor_a.h"
-
-PressureSensorChannelAdaptor::PressureSensorChannelAdaptor(QObject* parent) :
- AbstractSensorChannelAdaptor(parent)
-{
-}
-
-Unsigned PressureSensorChannelAdaptor::pressure() const
-{
- return qvariant_cast<Unsigned>(parent()->property("pressure"));
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/pressuresensor/pressuresensor_a.h
^
|
@@ -1,52 +0,0 @@
-/**
- @file pressuresensor_a.h
- @brief D-Bus adaptor for PressureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef ALS_SENSOR_H
-#define ALS_SENSOR_H
-
-#include <QtDBus/QtDBus>
-#include <QObject>
-
-#include "datatypes/unsigned.h"
-#include "abstractsensor_a.h"
-
-class PressureSensorChannelAdaptor : public AbstractSensorChannelAdaptor
-{
- Q_OBJECT
- Q_DISABLE_COPY(PressureSensorChannelAdaptor)
- Q_CLASSINFO("D-Bus Interface", "local.PressureSensor")
- Q_PROPERTY(Unsigned pressure READ pressure NOTIFY pressureChanged)
-
-public:
- PressureSensorChannelAdaptor(QObject* parent);
-
-public Q_SLOTS:
- Unsigned pressure() const;
-
-Q_SIGNALS:
- void pressureChanged(const Unsigned& value);
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/temperaturesensor/temperatureplugin.cpp
^
|
@@ -1,50 +0,0 @@
-/**
- @file temperatureplugin.cpp
- @brief Plugin for TemperatureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "temperatureplugin.h"
-#include "temperaturesensor.h"
-#include "sensormanager.h"
-#include "logging.h"
-
-void TemperaturePlugin::Register(class Loader&)
-{
- sensordLogD() << "registering temperaturesensor";
- SensorManager& sm = SensorManager::instance();
- sm.registerSensor<TemperatureSensorChannel>("temperaturesensor");
-}
-
-void TemperaturePlugin::Init(class Loader& l)
-{
- Q_UNUSED(l);
- SensorManager::instance().requestSensor("temperaturesensor");
-}
-
-QStringList TemperaturePlugin::Dependencies() {
- return QString("temperatureadaptor").split(":", QString::SkipEmptyParts);
-}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-Q_EXPORT_PLUGIN2(temperaturesensor, TemperaturePlugin)
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/temperaturesensor/temperatureplugin.h
^
|
@@ -1,43 +0,0 @@
-/**
- @file temperatureplugin.h
- @brief Plugin for TemperatureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef TEMPERATUREPLUGIN_H
-#define TEMPERATUREPLUGIN_H
-
-#include "plugin.h"
-
-class TemperaturePlugin : public Plugin
-{
- Q_OBJECT
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
- Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
-#endif
-private:
- void Register(class Loader& l);
- void Init(class Loader& l);
- QStringList Dependencies();
-};
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/temperaturesensor/temperaturesensor.cpp
^
|
@@ -1,121 +0,0 @@
-/**
- @file temperaturesensor.cpp
- @brief TemperatureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "temperaturesensor.h"
-
-#include "sensormanager.h"
-#include "bin.h"
-#include "bufferreader.h"
-#include "datatypes/orientation.h"
-
-TemperatureSensorChannel::TemperatureSensorChannel(const QString& id) :
- AbstractSensorChannel(id),
- DataEmitter<TimedUnsigned>(1),
- previousValue_(0,0)
-{
- SensorManager& sm = SensorManager::instance();
-
- temperatureAdaptor_ = sm.requestDeviceAdaptor("temperatureadaptor");
- if (!temperatureAdaptor_) {
- setValid(false);
- return;
- }
-
- temperatureReader_ = new BufferReader<TimedUnsigned>(1);
-
- outputBuffer_ = new RingBuffer<TimedUnsigned>(1);
-
- // Create buffers for filter chain
- filterBin_ = new Bin;
-
- filterBin_->add(temperatureReader_, "temperature");
- filterBin_->add(outputBuffer_, "buffer");
-
- filterBin_->join("als", "source", "buffer", "sink");
-
- // Join datasources to the chain
- connectToSource(temperatureAdaptor_, "temperature", temperatureReader_);
-
- marshallingBin_ = new Bin;
- marshallingBin_->add(this, "sensorchannel");
-
- outputBuffer_->join(this);
-
- setDescription("ambient temperature in celcious");
- setRangeSource(temperatureAdaptor_);
- addStandbyOverrideSource(temperatureAdaptor_);
- setIntervalSource(temperatureAdaptor_);
-
- setValid(true);
-}
-
-TemperatureSensorChannel::~TemperatureSensorChannel()
-{
- if (isValid()) {
- SensorManager& sm = SensorManager::instance();
-
- disconnectFromSource(temperatureAdaptor_, "temperature", temperatureReader_);
-
- sm.releaseDeviceAdaptor("alsadaptor");
-
- delete temperatureReader_;
- delete outputBuffer_;
- delete marshallingBin_;
- delete filterBin_;
- }
-}
-
-bool TemperatureSensorChannel::start()
-{
- sensordLogD() << "Starting TemperatureSensorChannel";
-
- if (AbstractSensorChannel::start()) {
- marshallingBin_->start();
- filterBin_->start();
- temperatureAdaptor_->startSensor();
- }
- return true;
-}
-
-bool TemperatureSensorChannel::stop()
-{
- sensordLogD() << "Stopping TemperatureSensorChannel";
-
- if (AbstractSensorChannel::stop()) {
- temperatureAdaptor_->stopSensor();
- filterBin_->stop();
- marshallingBin_->stop();
- }
- return true;
-}
-
-void TemperatureSensorChannel::emitData(const TimedUnsigned& value)
-{
- if (value.value_ != previousValue_.value_) {
- previousValue_.value_ = value.value_;
-
- writeToClients((const void*)(&value), sizeof(value));
- }
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/temperaturesensor/temperaturesensor.h
^
|
@@ -1,100 +0,0 @@
-/**
- @file temperaturesensor.h
- @brief TemperatureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef TEMPERATURE_SENSOR_CHANNEL_H
-#define TEMPERATURE_SENSOR_CHANNEL_H
-
-#include <QObject>
-
-#include "deviceadaptor.h"
-#include "abstractsensor.h"
-#include "temperaturesensor_a.h"
-#include "dataemitter.h"
-#include "datatypes/timedunsigned.h"
-#include "datatypes/unsigned.h"
-
-class Bin;
-template <class TYPE> class BufferReader;
-class FilterBase;
-
-/**
- * @brief Sensor for accessing the internal ambient light sensor measurements.
- *
- * Signals listeners whenever observed ambient light intensity level has
- * changed.
- */
-class TemperatureSensorChannel :
- public AbstractSensorChannel,
- public DataEmitter<TimedUnsigned>
-{
- Q_OBJECT
- Q_PROPERTY(Unsigned temperature READ temperature NOTIFY temperatureChanged)
-
-public:
- /**
- * Factory method for TemperatureSensorChannel.
- * @return New TemperatureSensorChannel as AbstractSensorChannel*
- */
- static AbstractSensorChannel* factoryMethod(const QString& id)
- {
- TemperatureSensorChannel* sc = new TemperatureSensorChannel(id);
- new TemperatureSensorChannelAdaptor(sc);
-
- return sc;
- }
-
- /**
- * Property for accessing the measured value.
- * @return Last measured value.
- */
- Unsigned temperature() const { return previousValue_; }
-
-public Q_SLOTS:
- bool start();
- bool stop();
-
-signals:
- /**
- * Sent when a change in measured data is observed.
- * @param value Measured value.
- */
- void temperatureChanged(const Unsigned& value);
-
-protected:
- TemperatureSensorChannel(const QString& id);
- virtual ~TemperatureSensorChannel();
-
-private:
- TimedUnsigned previousValue_;
- Bin* filterBin_;
- Bin* marshallingBin_;
- DeviceAdaptor* temperatureAdaptor_;
- BufferReader<TimedUnsigned>* temperatureReader_;
- RingBuffer<TimedUnsigned>* outputBuffer_;
-
- void emitData(const TimedUnsigned& value);
-};
-
-#endif // TEMPERATURE_SENSOR_CHANNEL_H
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/temperaturesensor/temperaturesensor.pro
^
|
@@ -1,19 +0,0 @@
-CONFIG += link_pkgconfig
-
-TARGET = temperaturesensor
-
-HEADERS += temperaturesensor.h \
- temperaturesensor_a.h \
- temperatureplugin.h
-
-SOURCES += temperaturesensor.cpp \
- temperaturesensor_a.cpp \
- temperatureplugin.cpp
-
-include( ../sensor-config.pri )
-
-contextprovider {
- DEFINES += PROVIDE_CONTEXT_INFO
- PKGCONFIG += contextprovider-1.0
-}
-
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/temperaturesensor/temperaturesensor_a.cpp
^
|
@@ -1,36 +0,0 @@
-/**
- @file temperaturesensor_a.cpp
- @brief D-Bus adaptor for TemperatureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#include "temperaturesensor_a.h"
-
-TemperatureSensorChannelAdaptor::TemperatureSensorChannelAdaptor(QObject* parent) :
- AbstractSensorChannelAdaptor(parent)
-{
-}
-
-Unsigned TemperatureSensorChannelAdaptor::temperature() const
-{
- return qvariant_cast<Unsigned>(parent()->property("temperature"));
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30+master.20161202035718.18.g2095755.tar.bz2/sensors/temperaturesensor/temperaturesensor_a.h
^
|
@@ -1,52 +0,0 @@
-/**
- @file temperaturesensor_a.h
- @brief D-Bus adaptor for TemperatureSensor
-
- <p>
- Copyright (C) 2016 Canonical LTD.
-
- @author Lorn Potter <lorn.potter@canonical.com>
-
- This file is part of Sensorfw.
-
- Sensord is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License
- version 2.1 as published by the Free Software Foundation.
-
- Sensord is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
- </p>
- */
-
-#ifndef ALS_SENSOR_H
-#define ALS_SENSOR_H
-
-#include <QtDBus/QtDBus>
-#include <QObject>
-
-#include "datatypes/unsigned.h"
-#include "abstractsensor_a.h"
-
-class TemperatureSensorChannelAdaptor : public AbstractSensorChannelAdaptor
-{
- Q_OBJECT
- Q_DISABLE_COPY(TemperatureSensorChannelAdaptor)
- Q_CLASSINFO("D-Bus Interface", "local.TemperatureSensor")
- Q_PROPERTY(Unsigned temperature READ temperature NOTIFY temperatureChanged)
-
-public:
- TemperatureSensorChannelAdaptor(QObject* parent);
-
-public Q_SLOTS:
- Unsigned temperature() const;
-
-Q_SIGNALS:
- void temperatureChanged(const Unsigned& value);
-};
-
-#endif
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/adaptors/adaptors.pro
^
|
@@ -30,20 +30,14 @@
mrstaccelerometer \
gyroscopeadaptor \
gyroscopeadaptor-evdev
-
SUDBIRS += oemtabletmagnetometeradaptor
-SUBDIRS += pegatronaccelerometeradaptor
+SUBDIRS += pegatronaccelerometeradaptor
SUBDIRS += oemtabletalsadaptor-ascii
SUBDIRS += oaktrailaccelerometer
SUBDIRS += oemtabletaccelerometer
SUDBIRS += oemtabletgyroscopeadaptor
SUBDIRS += steaccelerometeradaptor
SUBDIRS += mpu6050accelerometer
-SUBDIRS += lidsensoradaptor-evdev
-SUBDIRS += iioadaptor
-SUBDIRS += humidityadaptor
-SUBDIRS += pressureadaptor
-SUBDIRS += temperatureadaptor
config_hybris {
SUBDIRS += hybrisaccelerometer
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/adaptors/hybrisalsadaptor/hybrisalsadaptor.cpp
^
|
@@ -86,7 +86,7 @@
if ((fd = open(inputDev.toLatin1(), O_RDONLY)) > -1) {
if (!ioctl(fd, EVIOCGABS(ABS_MISC), &absinfo)) {
- if (absinfo.value != (signed)lastLightValue)
+ if (absinfo.value != lastLightValue)
lastLightValue = absinfo.value;
TimedUnsigned *d = buffer->nextSlot();
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/adaptors/magnetometeradaptor-ncdk/magnetometeradaptor-ncdk.cpp
^
|
@@ -66,14 +66,18 @@
int bytesRead = 0;
bool isOK = (bytesRead = read(fd, &buf, sizeof(buf))) > 0;
- if (isOK) {
+ switch (isOK)
+ {
+ case true:
strList = QByteArray(buf, bytesRead).split(':');
- if (strList.size() == 3) {
+ if (strList.size() == 3)
+ {
x = adjustPos(strList.at(0).toInt(), x_adj);
y = adjustPos(strList.at(1).toInt(), y_adj);
z = adjustPos(strList.at(2).toInt(), z_adj);
+ break;
}
- } else {
+ case false:
sensordLogW() << "Reading magnetometer error: " << strerror(errno);
return;
}
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/adaptors/magnetometeradaptor/magnetometeradaptor.cpp
^
|
@@ -93,7 +93,7 @@
{
if(intervalCompensation_)
{
- return SysfsAdaptor::setInterval((signed)value >intervalCompensation_ ? value - intervalCompensation_ : 0, sessionId);
+ return SysfsAdaptor::setInterval(value > intervalCompensation_ ? value - intervalCompensation_ : 0, sessionId);
}
return SysfsAdaptor::setInterval(value, sessionId);
}
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/adaptors/proximityadaptor-evdev/proximityadaptor-evdev.cpp
^
|
@@ -57,8 +57,8 @@
void ProximityAdaptorEvdev::interpretEvent(int src, struct input_event *ev)
{
Q_UNUSED(src);
- if ((ev->type == EV_SW && ev->code == SW_FRONT_PROXIMITY) ||
- (ev->type == EV_ABS && ev->code == ABS_DISTANCE)) {
+ if (ev->type == EV_SW && ev->code == SW_FRONT_PROXIMITY ||
+ ev->type == EV_ABS && ev->code == ABS_DISTANCE) {
if (ev->value == 0) {
currentState_ = ProximityStateClosed;
} else if (ev->value == 1) {
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/adaptors/proximityadaptor/proximityadaptor.cpp
^
|
@@ -136,7 +136,7 @@
return;
}
sscanf(buffer, "%d", &rawdata);
- if ( (signed)rawdata > threshold_ ) {
+ if ( rawdata > threshold_ ) {
ret = 1;
}
sensordLogT() << "Proximity value: " << rawdata;
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/adaptors/steaccelerometeradaptor/steaccelerometeradaptor.cpp
^
|
@@ -47,6 +47,31 @@
powerStatePath = Config::configuration()->value("accelerometer/mode_path").toByteArray();
frequency = Config::configuration()->value("accelerometer/frequency_mode").toInt();
+
+ int interval;
+ switch(frequency) {
+ case 0:
+ interval = 0; //off
+ case 1:
+ interval = 1;
+ break;
+ case 2:
+ interval = 10;
+ break;
+ case 3:
+ interval = 25;
+ break;
+ case 4:
+ interval = 50;
+ break;
+ case 6:
+ interval = 200;
+ break;
+ case 7:
+ interval = 400;
+ break;
+ };
+
setDescription("ste accelerometer");
}
@@ -77,9 +102,9 @@
void SteAccelAdaptor::processSample(int pathId, int fd)
{
- Q_UNUSED(pathId);
char buf[32];
int x, y, z;
+ qlonglong ts;
// if (pathId != devId) {
// sensordLogW () << "Wrong pathId" << pathId;
@@ -97,6 +122,7 @@
x = line.section(":",0,0).toInt();
y = line.section(":",1,1).toInt();
z = line.section(":",2,2).toInt();
+ ts = line.section(":",3,3).toLongLong();
AccelerationData *d = buffer->nextSlot();
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/core/core.pro
^
|
@@ -2,10 +2,10 @@
TEMPLATE = lib
TARGET = sensorfw
+
include( ../common-config.pri )
CONFIG += link_pkgconfig
-VERSION = 0.9.0
SENSORFW_INCLUDEPATHS = .. \
../include \
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/core/deviceadaptor.cpp
^
|
@@ -111,7 +111,6 @@
RingBufferBase* DeviceAdaptor::findBuffer(const QString& name) const
{
- Q_UNUSED(name)
AdaptedSensorEntry* entry = getAdaptedSensor();
if ( !entry )
return NULL;
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/core/inputdevadaptor.cpp
^
|
@@ -74,12 +74,10 @@
++deviceCount_;
} else if(deviceSysPathString.contains("%1")) {
const int MAX_EVENT_DEV = 16;
-qDebug() << deviceNumber << deviceCount_ << maxDeviceCount_;
// No configuration for this device, try find the device from the device system path
while (deviceNumber < MAX_EVENT_DEV && deviceCount_ < maxDeviceCount_) {
deviceName = deviceSysPathString.arg(deviceNumber);
- qDebug() << Q_FUNC_INFO << deviceName;
if (checkInputDevice(deviceName, typeName)) {
addPath(deviceName, deviceCount_);
++deviceCount_;
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/core/loader.cpp
^
|
@@ -54,13 +54,7 @@
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
QString pluginPath = QString::fromLatin1("/usr/lib/sensord/lib%1.so").arg(name);
#else
- QString pluginPath;
- QByteArray env = qgetenv("SENSORFW_LIBRARY_PATH");
- if (env.isEmpty())
- pluginPath = QString::fromLatin1("/usr/lib/sensord-qt5/lib%1-qt5.so").arg(name);
- else
- pluginPath = QString::fromLatin1(env+"/usr/lib/sensord-qt5/lib%1-qt5.so").arg(name);
-
+ QString pluginPath = QString::fromLatin1("/usr/lib/sensord-qt5/lib%1-qt5.so").arg(name);
#endif
QPluginLoader qpl(pluginPath);
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/core/sensormanager.cpp
^
|
@@ -108,13 +108,7 @@
pipeNotifier_(0),
deviation(0)
{
- QString pluginPath;
- QByteArray env = qgetenv("SENSORFW_SOCKET_PATH");
- const char* SOCKET_NAME;
- if (env.isEmpty())
- SOCKET_NAME = "/var/run/sensord.sock";
- else
- SOCKET_NAME = env+"/var/run/sensord.sock";
+ const char* SOCKET_NAME = "/var/run/sensord.sock";
new SensorManagerAdaptor(this);
@@ -322,10 +316,8 @@
clearError();
QString cleanId = getCleanId(id);
-
- qDebug() << sensorInstanceMap_.keys();
-
QMap<QString, SensorInstanceEntry>::iterator entryIt = sensorInstanceMap_.find(cleanId);
+
if ( entryIt == sensorInstanceMap_.end() )
{
setError(SmIdNotRegistered, QString(tr("requested sensor id '%1' not registered")).arg(cleanId));
@@ -487,7 +479,7 @@
if( id.contains(';') ) // no parameter passing in release
{
setError( SmIdNotRegistered, QString(tr("unknown adaptor id '%1'").arg(id)) );
- return Q_NULLPTR;
+ return NULL;
}
DeviceAdaptor* da = NULL;
@@ -627,9 +619,9 @@
void SensorManager::sensorDataHandler(int)
{
PipeData pipeData;
- ssize_t bytesRead = read(pipefds_[0], &pipeData, sizeof(pipeData));
+ read(pipefds_[0], &pipeData, sizeof(pipeData));
- if (!bytesRead || !socketHandler_->write(pipeData.id, pipeData.buffer, pipeData.size)) {
+ if (!socketHandler_->write(pipeData.id, pipeData.buffer, pipeData.size)) {
sensordLogW() << "Failed to write data to socket.";
}
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/core/sensormanager.h
^
|
@@ -464,7 +464,6 @@
template<class SENSOR_TYPE>
void SensorManager::registerSensor(const QString& sensorName)
{
- qDebug() << Q_FUNC_INFO << sensorName;
if (sensorInstanceMap_.contains(sensorName)) {
sensordLogW() << QString("<%1> Sensor is already present!").arg(sensorName);
return;
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/core/sysfsadaptor.cpp
^
|
@@ -67,8 +67,6 @@
bool SysfsAdaptor::addPath(const QString& path, const int id)
{
- qDebug() << Q_FUNC_INFO << path;
-
if (!QFile::exists(path)) {
return false;
}
@@ -302,9 +300,7 @@
{
if (mode_ == SelectMode) {
quint64 dummy = 1;
- ssize_t bytesWritten = write(pipeDescriptors_[1], &dummy, 8);
- if (!bytesWritten)
- qWarning() << "Could not write pipe descriptors";
+ write(pipeDescriptors_[1], &dummy, 8);
}
else
reader_.stopReader();
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/datatypes/datatypes.pro
^
|
@@ -23,17 +23,14 @@
posedata.h \
tapdata.h \
touchdata.h \
- proximity.h \
- lid.h \
- liddata.h
+ proximity.h
SOURCES += xyz.cpp \
orientation.cpp \
unsigned.cpp \
compass.cpp \
utils.cpp \
- tap.cpp \
- lid.cpp
+ tap.cpp
include(../common-install.pri)
publicheaders.path = $${publicheaders.path}/datatypes
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/debian/changelog
^
|
@@ -1,9 +1,3 @@
-sensorfw-qt5 (0.7.4) unstable; urgency=medium
-
- * add lid sensor
-
- -- Lorn Potter <lpotter@lpotter-Inspiron-2350> Wed, 26 Oct 2016 09:58:21 +1000
-
sensorfw-qt5 (0.7.3) unstable; urgency=low
[Lorn Potter]
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/qt-api/qt-api.pro
^
|
@@ -17,11 +17,7 @@
proximitysensor_i.cpp \
rotationsensor_i.cpp \
magnetometersensor_i.cpp \
- gyroscopesensor_i.cpp \
- lidsensor_i.cpp \
- humiditysensor_i.cpp \
- pressuresensor_i.cpp \
- temperaturesensor_i.cpp
+ gyroscopesensor_i.cpp
HEADERS += sensormanagerinterface.h \
sensormanager_i.h \
@@ -35,11 +31,7 @@
proximitysensor_i.h \
rotationsensor_i.h \
magnetometersensor_i.h \
- gyroscopesensor_i.h \
- lidsensor_i.h \
- humiditysensor_i.h \
- pressuresensor_i.h \
- temperaturesensor_i.h
+ gyroscopesensor_i.h
SENSORFW_INCLUDEPATHS = .. \
../include \
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/qt-api/socketreader.cpp
^
|
@@ -50,14 +50,7 @@
}
socket_ = new QLocalSocket(this);
- QByteArray env = qgetenv("SENSORFW_SOCKET_PATH");
- const char* SOCKET_NAME;
- if (env.isEmpty())
- SOCKET_NAME = "/var/run/sensord.sock";
- else
- SOCKET_NAME = env+"/var/run/sensord.sock";
-
- socket_->connectToServer(SOCKET_NAME, QIODevice::ReadWrite);
+ socket_->connectToServer("/var/run/sensord.sock", QIODevice::ReadWrite);
if (!(socket_->serverName().size())) {
qDebug() << socket_->errorString();
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/sensors/sensors.pro
^
|
@@ -11,10 +11,6 @@
compasssensor \
rotationsensor \
magnetometersensor \
- gyroscopesensor \
- lidsensor \
- humiditysensor \
- pressuresensor \
- temperaturesensor
+ gyroscopesensor
contextprovider:SUBDIRS += contextplugin
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/tests/adaptors/adaptors.pro
^
|
@@ -16,8 +16,7 @@
../../adaptors/touchadaptor/touchadaptor.h \
../../adaptors/kbslideradaptor/kbslideradaptor.h \
../../adaptors/proximityadaptor/proximityadaptor.h \
- ../../adaptors/gyroscopeadaptor/gyroscopeadaptor.h \
- ../../adaptors/lidsensoradaptor-evdev/lidsensoradaptor-evdev.h
+ ../../adaptors/gyroscopeadaptor/gyroscopeadaptor.h
SOURCES += adaptortest.cpp \
../../datatypes/utils.cpp \
@@ -28,8 +27,7 @@
../../adaptors/touchadaptor/touchadaptor.cpp \
../../adaptors/kbslideradaptor/kbslideradaptor.cpp \
../../adaptors/proximityadaptor/proximityadaptor.cpp \
- ../../adaptors/gyroscopeadaptor/gyroscopeadaptor.cpp \
- ../../adaptors/lidsensoradaptor-evdev/lidsensoradaptor-evdev.cpp
+ ../../adaptors/gyroscopeadaptor/gyroscopeadaptor.cpp
INCLUDEPATH += ../.. \
@@ -45,9 +43,7 @@
../../adaptors/accelerometeradaptor \
../../adaptors/kbslideradaptor \
../../adaptors/proximityadaptor \
- ../../adaptors/gyroscopeadaptor \
- ../../adaptors/lidsensoradaptor-evdev
-
+ ../../adaptors/gyroscopeadaptor
QMAKE_LIBDIR_FLAGS += -L../../builddir/core -L../../core/ -lrt
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/tests/adaptors/adaptortest.cpp
^
|
@@ -39,7 +39,6 @@
#include "kbslideradaptor.h"
#include "proximityadaptor.h"
#include "gyroscopeadaptor.h"
-#include "lidsensoradaptor-evdev.h"
#include "config.h"
@@ -157,17 +156,5 @@
adaptor->stopAdaptor();
}
-void AdaptorTest::testLidSensorAdaptor()
-{
- LidSensorAdaptorEvdev* adaptor =
- dynamic_cast<LidSensorAdaptorEvdev*>(LidSensorAdaptorEvdev::factoryMethod("lidsensoradaptor"));
- QVERIFY( adaptor );
-
- QVERIFY(adaptor->startAdaptor());
- QVERIFY(adaptor->startSensor());
-
- adaptor->stopSensor();
- adaptor->stopAdaptor();
-}
QTEST_MAIN(AdaptorTest)
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-0.8.30.tar.bz2/tests/adaptors/adaptortest.h
^
|
@@ -57,7 +57,6 @@
void testProximityAdaptor();
void testTouchAdaptor();
void testGyroscopeAdaptor();
- void testLidSensorAdaptor();
};
|