[-]
[+]
|
Changed |
_service:tar_git:sensorfw.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-binder.spec
^
|
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.11.8.tar.bz2/sensord-qt5.pc
^
|
@@ -1,10 +0,0 @@
-prefix=/usr
-includedir=${prefix}/include/sensord-qt5
-libdir=${prefix}/lib/
-
-Name: Sensorfw-qt5
-Description: Sensord for Qt 5
-Version: 0.11.6
-Requires:
-Libs: -L${libdir} -lsensorclient-qt5 -lsensordatatypes-qt5
-Cflags: -I${includedir} -I${includedir}/datatypes -I${includedir}/filters
|
[-]
[+]
|
Deleted |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.11.8.tar.bz2/tests/tests.xml
^
|
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<testdefinition version="0.1">
- <!-- Test suite, sensorfw-tests for automated testing of sensord -->
- <suite name="Sensorfw-tests" domain="System Software">
- <!-- At least one set per suite, name and description mandatory -->
- <set name="Sensord-automated-tests" description="Unit test cases for sensord" feature="Sensor Framework" requirement="88917">
- <case name="Sensord_Filters" level="Component" type="Functional" description="Unit test cases for sensor filters" timeout="15" subfeature="Sensor Framework">
- <step expected_result="0">/usr/bin/sensorfilters-test</step>
- </case>
- <case name="Sensord_Dataflow" level="Component" type="Functional" description="Sensord dataflow test" timeout="15" subfeature="Sensor Framework">
- <step expected_result="0">/usr/bin/sensordataflow-test</step>
- </case>
- <case name="Sensord_Adaptors" level="Component" type="Functional" description="Unit test cases for sensor adaptors" timeout="15" subfeature="Sensor Framework">
- <step expected_result="0">/usr/bin/sensoradaptors-test</step>
- </case>
- <case name="Sensord_Chains" level="Component" type="Functional" description="Unit test cases for sensor chains" timeout="15" subfeature="Sensor Framework">
- <step>stop sensord</step>
- <step expected_result="0">/usr/bin/sensorchains-test</step>
- <step>start sensord</step>
- <step>sleep 2</step>
- </case>
- <case name="Sensor_Client_API" level="Component" type="Functional" description="Client API tests for sensord" timeout="90" subfeature="Sensor Framework">
- <step expected_result="0">/usr/bin/sensorapi-test</step>
- </case>
- <case name="Sensor_MetaData" level="Component" type="Functional" description="Sensor metadata tests for sensord" timeout="15" subfeature="Sensor Framework">
- <step expected_result="0">/usr/bin/sensormetadata-test</step>
- </case>
- <case name="Dead_Client" type="Functional" level="Component" description="Unit test for properly detecting dead clients." timeout="60" subfeature="Sensor Framework">
- <step expected_result="0">/usr/share/sensorfw-tests/sensord-deadclienttest.py</step>
- </case>
-
- <!-- Environments optional - tells where the tests are run -->
- <environments>
- <scratchbox>false</scratchbox>
- <hardware>true</hardware>
- </environments>
- </set>
-
- <set name="Sensord-memory-tests" description="Memory leak tests for sensord" feature="Sensor Framework" requirement="SensorFw Testing and automation">
- <case name="Sensord_Memory_OpenClose" level="Component" type="Benchmark" description="Memory leak check for session open/close" timeout="200" subfeature="Sensor Framework">
- <step>/usr/bin/sensorbenchmark-test testSessionLeaks</step>
- </case>
- <case name="Sensord_Memory_OpenKill" level="Component" type="Benchmark" description="Memory leak check for session open/kill" timeout="200" subfeature="Sensor Framework">
- <step>/usr/bin/sensorbenchmark-test testLostSessionLeaks</step>
- </case>
-
- <!-- Environments optional - tells where the tests are run -->
- <environments>
- <scratchbox>false</scratchbox>
- <hardware>true</hardware>
- </environments>
- </set>
-
- <set name="Sensord-pm-tests" description="Sensord power management tests" feature="Sensor Framework" requirement="SensorFw Testing and automation">
- <pre_steps>
- <step expected_result="0">/usr/bin/sensordiverter.sh start</step>
- <step>sleep 5</step>
- </pre_steps>
-
- <case name="Sensord_Power_Management" type="Functional" level="Component" description="Sensord power management handling test" timeout="100" subfeature="Sensor Framework">
- <step expected_result="0">/usr/bin/sensorpowermanagement-test</step>
- </case>
-
- <case name="Sensord_Standby_Override" type="Functional" level="Component" description="Sensord standby override test" timeout="100" subfeature="Sensor Framework">
- <step expected_result="0">/usr/bin/sensorstandbyoverride-test</step>
- </case>
-
- <environments>
- <scratchbox>false</scratchbox>
- <hardware>true</hardware>
- </environments>
-
- <post_steps>
- <step expected_result="0">/usr/bin/sensordiverter.sh stop</step>
- </post_steps>
- </set>
-
-
- <set name="Sensord-benchmark-tests" description="Benchmark test cases for sensord" feature="Sensor Framework" requirement="SensorFw Testing and automation">
-
- <pre_steps>
- <!-- Stop sensord, kill to make sure -->
- <step>stop sensord</step>
- <step>killall sensord</step>
- <step>rm -f /tmp/sensorTestSampleRate</step>
- <step>mv /usr/lib/sensord/libalsadaptor.so /usr/lib/sensord/libalsadaptor.so.orig</step>
- <step>ln -s /usr/lib/sensord/testing/libalsadaptor.so /usr/lib/sensord/libalsadaptor.so</step>
- </pre_steps>
-
- <case name="Sensord_Benchmark_50hz" level="Component" type="Benchmark" description="Sensord Benchmark @ 50hz" timeout="45" subfeature="Sensor Framework">
- <step>echo 20 > /tmp/sensorTestSampleRate</step>
- <step>start sensord</step>
- <step>sleep 2</step>
- <step>/usr/bin/sensorbenchmark-test testThroughput</step>
- </case>
- <case name="Sensord_Benchmark_200hz" level="Component" type="Benchmark" description="Sensord Benchmark @ 200hz" timeout="45" subfeature="Sensor Framework">
- <step>stop sensord</step>
- <step>echo 5 > /tmp/sensorTestSampleRate</step>
- <step>start sensord</step>
- <step>sleep 2</step>
- <step>/usr/bin/sensorbenchmark-test testThroughput</step>
- </case>
- <case name="Sensord_Benchmark_500hz" level="Component" type="Benchmark" description="Sensord Benchmark @ 500hz" timeout="45" subfeature="Sensor Framework">
- <step>stop sensord</step>
- <step>echo 2 > /tmp/sensorTestSampleRate</step>
- <step>start sensord</step>
- <step>sleep 2</step>
- <step>/usr/bin/sensorbenchmark-test testThroughput</step>
- </case>
-
- <post_steps>
- <!-- Clean up and restore normal behavior-->
- <step>stop sensord</step>
- <step>rm -f /tmp/sensorTestSampleRate</step>
- <step>rm -f /usr/lib/sensord/libalsadaptor.so</step>
- <step>mv /usr/lib/sensord/libalsadaptor.so.orig /usr/lib/sensord/libalsadaptor.so</step>
- <step>start sensord</step>
- </post_steps>
-
- <!-- Environments optional - tells where the tests are run -->
- <environments>
- <scratchbox>false</scratchbox>
- <hardware>true</hardware>
- </environments>
- </set>
-
- <set name="Sensord-external-tests" description="External issue tests for sensord" feature="Sensor Framework" requirement="SensorFw Testing and automation">
- <case name="Sensord_External" level="Component" type="Functional" description="Check external required API, values etc." timeout="15" subfeature="Sensor Framework" insignificant="true">
- <step>/usr/bin/sensorexternal-test</step>
- </case>
-
- <!-- Environments optional - tells where the tests are run -->
- <environments>
- <scratchbox>false</scratchbox>
- <hardware>true</hardware>
- </environments>
- </set>
-
- </suite>
- </testdefinition>
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/adaptors.pro
^
|
@@ -10,6 +10,8 @@
SUBDIRS += hybrispressureadaptor
SUBDIRS += hybrisproximityadaptor
SUBDIRS += hybrisorientationadaptor
+ SUBDIRS += hybrisrotationadaptor
+ SUBDIRS += hybrisgeorotationadaptor
SUBDIRS += hybrisstepcounteradaptor
} else {
@@ -55,6 +57,8 @@
SUBDIRS += hybrispressureadaptor
SUBDIRS += hybrisproximityadaptor
SUBDIRS += hybrisorientationadaptor
+ SUBDIRS += hybrisrotationadaptor
+ SUBDIRS += hybrisgeorotationadaptor
SUBDIRS += hybrisstepcounteradaptor
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisaccelerometer/hybrisaccelerometeradaptor.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisaccelerometer/hybrisaccelerometeradaptor.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisaccelerometer/hybrisaccelerometeradaptorplugin.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisaccelerometer/hybrisaccelerometeradaptorplugin.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisalsadaptor/hybrisalsadaptor.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisalsadaptor/hybrisalsadaptor.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisalsadaptor/hybrisalsadaptorplugin.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisalsadaptor/hybrisalsadaptorplugin.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisgeorotationadaptor/hybrisgeorotationadaptor.cpp
^
|
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Jolla Ltd
+**
+** Copyright (C) 2020 Rinigus
+**
+**
+** $QT_BEGIN_LICENSE:LGPL$
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "hybrisgeorotationadaptor.h"
+#include "logging.h"
+#include "datatypes/utils.h"
+#include "config.h"
+
+#include <QtCore/qmath.h>
+#include <QtGlobal>
+
+#define RADIANS_TO_DEGREES 57.2957795
+
+/*
+ * azimuth: angle between the magnetic north direction and the Y axis, around
+ * the Z axis (0<=azimuth<360).
+ * 0=North, 90=East, 180=South, 270=West
+ *
+ **/
+
+HybrisGeoRotationAdaptor::HybrisGeoRotationAdaptor(const QString& id) :
+ HybrisAdaptor(id,SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR)
+{
+ m_buffer = new DeviceAdaptorRingBuffer<CompassData>(1);
+ setAdaptedSensor("hybrisgeorotation", "Internal rotation coordinates using geo rotation vector", m_buffer);
+
+ setDescription("Hybris georotation");
+ m_powerStatePath = SensorFrameworkConfig::configuration()->value("georotation/powerstate_path").toByteArray();
+ if (!m_powerStatePath.isEmpty() && !QFile::exists(m_powerStatePath)) {
+ sensordLogW() << "Path does not exists: " << m_powerStatePath;
+ m_powerStatePath.clear();
+ }
+}
+
+HybrisGeoRotationAdaptor::~HybrisGeoRotationAdaptor()
+{
+ delete m_buffer;
+}
+
+bool HybrisGeoRotationAdaptor::startSensor()
+{
+ if (!(HybrisAdaptor::startSensor()))
+ return false;
+ if (isRunning() && !m_powerStatePath.isEmpty())
+ writeToFile(m_powerStatePath, "1");
+ sensordLogD() << "Hybris GeoRotationAdaptor start";
+ return true;
+}
+
+void HybrisGeoRotationAdaptor::stopSensor()
+{
+ HybrisAdaptor::stopSensor();
+ if (!isRunning() && !m_powerStatePath.isEmpty())
+ writeToFile(m_powerStatePath, "0");
+ sensordLogD() << "Hybris GeoRotationAdaptor stop";
+}
+
+void HybrisGeoRotationAdaptor::processSample(const sensors_event_t& data)
+{
+ CompassData *d = m_buffer->nextSlot();
+ d->timestamp_ = quint64(data.timestamp * .001);
+#ifdef USE_BINDER
+ const float *rotationVector = data.u.data;
+#else
+ const float *rotationVector = data.data;
+#endif
+ // Calculations are based on Android methods
+ // getRotationMatrixFromVector and getOrientation
+ // of SensorManager.java
+ float q0 = rotationVector[3];
+ float q1 = rotationVector[0];
+ float q2 = rotationVector[1];
+ float q3 = rotationVector[2];
+ float accuracy = rotationVector[4];
+
+ float sq_q1 = 2 * q1 * q1;
+ float sq_q3 = 2 * q3 * q3;
+ float q1_q2 = 2 * q1 * q2;
+ float q3_q0 = 2 * q3 * q0;
+
+ float R1 = q1_q2 - q3_q0;
+ float R4 = 1 - sq_q1 - sq_q3;
+ float azimuth = qAtan2(R1, R4) * RADIANS_TO_DEGREES;
+ d->degrees_ = (int)(azimuth + 360) % 360;
+ d->rawDegrees_ = d->degrees_;
+
+ // level_ is set to 3 (pass csd) when accuracy is higher than 10 degrees
+ const int maxLevel = 3;
+ if (accuracy < 0) d->level_ = 0;
+ else d->level_ = (accuracy > 1e-5) ?
+ (int)(qMin(qFloor(maxLevel * 0.174533/accuracy), maxLevel)) :
+ maxLevel;
+
+ m_buffer->commit();
+ m_buffer->wakeUpReaders();
+}
+
+void HybrisGeoRotationAdaptor::init()
+{
+}
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisgeorotationadaptor/hybrisgeorotationadaptor.h
^
|
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Jolla Ltd
+**
+**
+** $QT_BEGIN_LICENSE:LGPL$
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef HYBRISGEOROTATIONADAPTOR_H
+#define HYBRISGEOROTATIONADAPTOR_H
+#include "hybrisadaptor.h"
+
+#include <QString>
+#include <QStringList>
+#include "deviceadaptorringbuffer.h"
+#include "datatypes/orientationdata.h"
+
+/**
+ * @brief Adaptor for hybris compass.
+ *
+ * Adaptor for internal compass
+ * Uses hybris sensor daemon driver interface in interval
+ * polling mode, i.e. values are read with given constant interval.
+ */
+class HybrisGeoRotationAdaptor : public HybrisAdaptor
+{
+ Q_OBJECT
+
+public:
+ static DeviceAdaptor* factoryMethod(const QString& id) {
+ return new HybrisGeoRotationAdaptor(id);
+ }
+ HybrisGeoRotationAdaptor(const QString& id);
+ ~HybrisGeoRotationAdaptor();
+
+ bool startSensor();
+ void stopSensor();
+
+protected:
+ void processSample(const sensors_event_t& data);
+ void init();
+
+private:
+ DeviceAdaptorRingBuffer<CompassData>* m_buffer;
+ QByteArray m_powerStatePath;
+
+};
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisgeorotationadaptor/hybrisgeorotationadaptor.pro
^
|
@@ -0,0 +1,14 @@
+TARGET = hybrisgeorotationadaptor
+
+HEADERS += hybrisgeorotationadaptor.h \
+ hybrisgeorotationadaptorplugin.h
+
+SOURCES += hybrisgeorotationadaptor.cpp \
+ hybrisgeorotationadaptorplugin.cpp
+
+LIBS+= -L../../core -lhybrissensorfw-qt5
+
+include( ../adaptor-config.pri )
+config_hybris {
+ PKGCONFIG += android-headers
+}
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisgeorotationadaptor/hybrisgeorotationadaptorplugin.cpp
^
|
@@ -0,0 +1,30 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Jolla Ltd
+**
+**
+** $QT_BEGIN_LICENSE:LGPL$
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "hybrisgeorotationadaptorplugin.h"
+#include "hybrisgeorotationadaptor.h"
+#include "sensormanager.h"
+#include "logging.h"
+
+void HybrisGeoRotationAdaptorPlugin::Register(class Loader&)
+{
+ sensordLogD() << "registering hybrisgeorotationadaptor";
+ SensorManager& sm = SensorManager::instance();
+ sm.registerDeviceAdaptor<HybrisGeoRotationAdaptor>("orientationadaptor");
+}
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisgeorotationadaptor/hybrisgeorotationadaptorplugin.h
^
|
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Jolla Ltd
+**
+**
+** $QT_BEGIN_LICENSE:LGPL$
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef HYBRISGEOROTATIONADAPTORPLUGIN_H
+#define HYBRISGEOROTATIONADAPTORPLUGIN_H
+
+#include "plugin.h"
+
+class HybrisGeoRotationAdaptorPlugin : public Plugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
+
+private:
+ void Register(class Loader& l);
+};
+
+#endif
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptor.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptor.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptorplugin.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptorplugin.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrismagnetometeradaptor/hybrismagnetometeradaptor.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrismagnetometeradaptor/hybrismagnetometeradaptor.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrismagnetometeradaptor/hybrismagnetometeradaptorplugin.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrismagnetometeradaptor/hybrismagnetometeradaptorplugin.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisorientationadaptor/hybrisorientationadaptor.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisorientationadaptor/hybrisorientationadaptor.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisorientationadaptor/hybrisorientationadaptorplugin.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisorientationadaptor/hybrisorientationadaptorplugin.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrispressureadaptor/hybrispressureadaptor.cpp
^
|
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2017 Matti Lehtimäki
-** Contact: matti.lehtimaki@gmail.com
**
** $QT_BEGIN_LICENSE:LGPL$
**
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrispressureadaptor/hybrispressureadaptor.h
^
|
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2017 Matti Lehtimäki
-** Contact: matti.lehtimaki@gmail.com
**
** $QT_BEGIN_LICENSE:LGPL$
**
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrispressureadaptor/hybrispressureadaptorplugin.cpp
^
|
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2017 Matti Lehtimäki
-** Contact: matti.lehtimaki@gmail.com
**
** $QT_BEGIN_LICENSE:LGPL$
**
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrispressureadaptor/hybrispressureadaptorplugin.h
^
|
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2017 Matti Lehtimäki
-** Contact: matti.lehtimaki@gmail.com
**
** $QT_BEGIN_LICENSE:LGPL$
**
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisproximityadaptor/hybrisproximityadaptor.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisproximityadaptor/hybrisproximityadaptor.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisproximityadaptor/hybrisproximityadaptorplugin.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisproximityadaptor/hybrisproximityadaptorplugin.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisrotationadaptor/hybrisrotationadaptor.cpp
^
|
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Jolla Ltd
+**
+** Copyright (C) 2020 Rinigus
+**
+**
+** $QT_BEGIN_LICENSE:LGPL$
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "hybrisrotationadaptor.h"
+#include "logging.h"
+#include "datatypes/utils.h"
+#include "config.h"
+
+#include <QtCore/qmath.h>
+#include <QtGlobal>
+
+#define RADIANS_TO_DEGREES 57.2957795
+
+/*
+ * azimuth: angle between the magnetic north direction and the Y axis, around
+ * the Z axis (0<=azimuth<360).
+ * 0=North, 90=East, 180=South, 270=West
+ *
+ **/
+
+HybrisRotationAdaptor::HybrisRotationAdaptor(const QString& id) :
+ HybrisAdaptor(id,SENSOR_TYPE_ROTATION_VECTOR)
+{
+ m_buffer = new DeviceAdaptorRingBuffer<CompassData>(1);
+ setAdaptedSensor("hybrisrotation", "Internal rotation coordinates", m_buffer);
+
+ setDescription("Hybris rotation");
+ m_powerStatePath = SensorFrameworkConfig::configuration()->value("rotation/powerstate_path").toByteArray();
+ if (!m_powerStatePath.isEmpty() && !QFile::exists(m_powerStatePath)) {
+ sensordLogW() << "Path does not exists: " << m_powerStatePath;
+ m_powerStatePath.clear();
+ }
+}
+
+HybrisRotationAdaptor::~HybrisRotationAdaptor()
+{
+ delete m_buffer;
+}
+
+bool HybrisRotationAdaptor::startSensor()
+{
+ if (!(HybrisAdaptor::startSensor()))
+ return false;
+ if (isRunning() && !m_powerStatePath.isEmpty())
+ writeToFile(m_powerStatePath, "1");
+ sensordLogD() << "Hybris RotationAdaptor start";
+ return true;
+}
+
+void HybrisRotationAdaptor::stopSensor()
+{
+ HybrisAdaptor::stopSensor();
+ if (!isRunning() && !m_powerStatePath.isEmpty())
+ writeToFile(m_powerStatePath, "0");
+ sensordLogD() << "Hybris RotationAdaptor stop";
+}
+
+void HybrisRotationAdaptor::processSample(const sensors_event_t& data)
+{
+ CompassData *d = m_buffer->nextSlot();
+ d->timestamp_ = quint64(data.timestamp * .001);
+#ifdef USE_BINDER
+ const float *rotationVector = data.u.data;
+#else
+ const float *rotationVector = data.data;
+#endif
+ // Calculations are based on Android methods
+ // getRotationMatrixFromVector and getOrientation
+ // of SensorManager.java
+ float q0 = rotationVector[3];
+ float q1 = rotationVector[0];
+ float q2 = rotationVector[1];
+ float q3 = rotationVector[2];
+ float accuracy = rotationVector[4];
+
+ float sq_q1 = 2 * q1 * q1;
+ float sq_q3 = 2 * q3 * q3;
+ float q1_q2 = 2 * q1 * q2;
+ float q3_q0 = 2 * q3 * q0;
+
+ float R1 = q1_q2 - q3_q0;
+ float R4 = 1 - sq_q1 - sq_q3;
+ float azimuth = qAtan2(R1, R4) * RADIANS_TO_DEGREES;
+ d->degrees_ = (int)(azimuth + 360) % 360;
+ d->rawDegrees_ = d->degrees_;
+
+ // level_ is set to 3 (pass csd) when accuracy is higher than 10 degrees
+ const int maxLevel = 3;
+ if (accuracy < 0) d->level_ = 0;
+ else d->level_ = (accuracy > 1e-5) ? (int)(qMin(qFloor(maxLevel * 0.174533/accuracy), maxLevel)) : maxLevel;
+
+ m_buffer->commit();
+ m_buffer->wakeUpReaders();
+}
+
+void HybrisRotationAdaptor::init()
+{
+}
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisrotationadaptor/hybrisrotationadaptor.h
^
|
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Jolla Ltd
+**
+**
+** $QT_BEGIN_LICENSE:LGPL$
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef HYBRISROTATIONADAPTOR_H
+#define HYBRISROTATIONADAPTOR_H
+#include "hybrisadaptor.h"
+
+#include <QString>
+#include <QStringList>
+#include "deviceadaptorringbuffer.h"
+#include "datatypes/orientationdata.h"
+
+/**
+ * @brief Adaptor for hybris compass.
+ *
+ * Adaptor for internal compass
+ * Uses hybris sensor daemon driver interface in interval
+ * polling mode, i.e. values are read with given constant interval.
+ */
+class HybrisRotationAdaptor : public HybrisAdaptor
+{
+ Q_OBJECT
+
+public:
+ static DeviceAdaptor* factoryMethod(const QString& id) {
+ return new HybrisRotationAdaptor(id);
+ }
+ HybrisRotationAdaptor(const QString& id);
+ ~HybrisRotationAdaptor();
+
+ bool startSensor();
+ void stopSensor();
+
+protected:
+ void processSample(const sensors_event_t& data);
+ void init();
+
+private:
+ DeviceAdaptorRingBuffer<CompassData>* m_buffer;
+ QByteArray m_powerStatePath;
+
+};
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisrotationadaptor/hybrisrotationadaptor.pro
^
|
@@ -0,0 +1,14 @@
+TARGET = hybrisrotationadaptor
+
+HEADERS += hybrisrotationadaptor.h \
+ hybrisrotationadaptorplugin.h
+
+SOURCES += hybrisrotationadaptor.cpp \
+ hybrisrotationadaptorplugin.cpp
+
+LIBS+= -L../../core -lhybrissensorfw-qt5
+
+include( ../adaptor-config.pri )
+config_hybris {
+ PKGCONFIG += android-headers
+}
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisrotationadaptor/hybrisrotationadaptorplugin.cpp
^
|
@@ -0,0 +1,30 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Jolla Ltd
+**
+**
+** $QT_BEGIN_LICENSE:LGPL$
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "hybrisrotationadaptorplugin.h"
+#include "hybrisrotationadaptor.h"
+#include "sensormanager.h"
+#include "logging.h"
+
+void HybrisRotationAdaptorPlugin::Register(class Loader&)
+{
+ sensordLogD() << "registering hybrisrotationadaptor";
+ SensorManager& sm = SensorManager::instance();
+ sm.registerDeviceAdaptor<HybrisRotationAdaptor>("orientationadaptor");
+}
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisrotationadaptor/hybrisrotationadaptorplugin.h
^
|
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Jolla Ltd
+**
+**
+** $QT_BEGIN_LICENSE:LGPL$
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef HYBRISROTATIONADAPTORPLUGIN_H
+#define HYBRISROTATIONADAPTORPLUGIN_H
+
+#include "plugin.h"
+
+class HybrisRotationAdaptorPlugin : public Plugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "com.nokia.SensorService.Plugin/1.0")
+
+private:
+ void Register(class Loader& l);
+};
+
+#endif
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptor.cpp
^
|
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2016 kimmoli
-** Contact: kimmo.lindholm@eke.fi
**
**
** $QT_BEGIN_LICENSE:LGPL$
@@ -26,12 +24,8 @@
#include "datatypes/utils.h"
#include "config.h"
-#ifndef SENSOR_TYPE_STEP_COUNTER
-#define SENSOR_TYPE_STEP_COUNTER (19)
-/* If hardware/sensors.h does not define SENSOR_TYPE_STEP_COUNTER, assume
- * a) the event structure is missing u64 union too, and b) u64.step_counter
- * would be located at the same address as non-u64 data array. */
-#define NO_SENSORS_EVENT_U64
+#ifndef USE_BINDER
+#include <android-version.h>
#endif
HybrisStepCounterAdaptor::HybrisStepCounterAdaptor(const QString& id) :
@@ -83,7 +77,10 @@
#ifdef USE_BINDER
d->value_ = data.u.stepCount;
#else
-#ifdef NO_SENSORS_EVENT_U64
+#if ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR < 4
+/* In Android versions 4.3 and older hardware/sensors.h does not
+ * contain u64 union and values are located at the same
+ * address as non-u64 data array. */
uint64_t value = 0;
memcpy(&value, data.data, sizeof value);
d->value_ = value;
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptor.h
^
|
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2016 kimmoli
-** Contact: kimmo.lindholm@eke.fi
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptorplugin.cpp
^
|
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2016 kimmoli
-** Contact: kimmo.lindholm@eke.fi
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptorplugin.h
^
|
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2016 kimmoli
-** Contact: kimmo.lindholm@eke.fi
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/compasschain/compasschain.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/compasschain/compasschain.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/compasschain/compasschainplugin.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/compasschain/compasschainplugin.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/compasschain/compassfilter.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/compasschain/compassfilter.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/compasschain/orientationfilter.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/compasschain/orientationfilter.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/magcalibrationchain/calibrationfilter.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013-2015 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/magcalibrationchain/calibrationfilter.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/magcalibrationchain/magcalibrationchain.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/magcalibrationchain/magcalibrationchain.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/magcalibrationchain/magcalibrationchainplugin.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/chains/magcalibrationchain/magcalibrationchainplugin.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/common-install.pri
^
|
@@ -9,9 +9,9 @@
# Path for headers - remember to add files if they should be installed
publicheaders.path = /usr/include/sensord-qt5
-PLUGINPATH = /usr/lib/sensord-qt5
+PLUGINPATH = $$[QT_INSTALL_LIBS]/sensord-qt5
# Path for shared libraries
-SHAREDLIBPATH = /usr/lib
+SHAREDLIBPATH = $$[QT_INSTALL_LIBS]
INSTALLS += publicheaders
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/core/core.pro
^
|
@@ -15,6 +15,8 @@
DEPENDPATH += $$SENSORFW_INCLUDEPATHS
INCLUDEPATH += $$SENSORFW_INCLUDEPATHS
+DEFINES += PLUGIN_DIRECTORY=\"\\\"$$[QT_INSTALL_LIBS]/sensord-qt5\\\"\"
+
QMAKE_LIBDIR_FLAGS += -L../datatypes\
-lsensordatatypes-qt5
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/core/hybris.pro
^
|
@@ -17,7 +17,7 @@
SOURCES += hybrisadaptor.cpp
HEADERS += hybrisadaptor.h
-LIBS += -L/usr/lib -L../datatypes
+LIBS += -L$$[QT_INSTALL_LIBS] -L../datatypes
!contains(CONFIG,binder) {
LIBS += -lhybris-common -lhardware
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/core/hybrisadaptor.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
@@ -35,98 +34,6 @@
#include <time.h>
#include <signal.h>
-
-/* Older devices probably have old android hal and thus do
- * not define sensor all sensor types that have been added
- * later on -> In order to both use symbolic names and
- * compile for all devices we need to fill in holes that
- * android hal for some particular device might have.
- */
-#ifndef SENSOR_TYPE_META_DATA
-#define SENSOR_TYPE_META_DATA (0)
-#endif
-#ifndef SENSOR_TYPE_ACCELEROMETER
-#define SENSOR_TYPE_ACCELEROMETER (1)
-#endif
-#ifndef SENSOR_TYPE_GEOMAGNETIC_FIELD
-#define SENSOR_TYPE_GEOMAGNETIC_FIELD (2) // alias for SENSOR_TYPE_MAGNETIC_FIELD
-#endif
-#ifndef SENSOR_TYPE_MAGNETIC_FIELD
-#define SENSOR_TYPE_MAGNETIC_FIELD (2) // alias for SENSOR_TYPE_GEOMAGNETIC_FIELD
-#endif
-#ifndef SENSOR_TYPE_ORIENTATION
-#define SENSOR_TYPE_ORIENTATION (3)
-#endif
-#ifndef SENSOR_TYPE_GYROSCOPE
-#define SENSOR_TYPE_GYROSCOPE (4)
-#endif
-#ifndef SENSOR_TYPE_LIGHT
-#define SENSOR_TYPE_LIGHT (5)
-#endif
-#ifndef SENSOR_TYPE_PRESSURE
-#define SENSOR_TYPE_PRESSURE (6)
-#endif
-#ifndef SENSOR_TYPE_TEMPERATURE
-#define SENSOR_TYPE_TEMPERATURE (7)
-#endif
-#ifndef SENSOR_TYPE_PROXIMITY
-#define SENSOR_TYPE_PROXIMITY (8)
-#endif
-#ifndef SENSOR_TYPE_GRAVITY
-#define SENSOR_TYPE_GRAVITY (9)
-#endif
-#ifndef SENSOR_TYPE_LINEAR_ACCELERATION
-#define SENSOR_TYPE_LINEAR_ACCELERATION (10)
-#endif
-#ifndef SENSOR_TYPE_ROTATION_VECTOR
-#define SENSOR_TYPE_ROTATION_VECTOR (11)
-#endif
-#ifndef SENSOR_TYPE_RELATIVE_HUMIDITY
-#define SENSOR_TYPE_RELATIVE_HUMIDITY (12)
-#endif
-#ifndef SENSOR_TYPE_AMBIENT_TEMPERATURE
-#define SENSOR_TYPE_AMBIENT_TEMPERATURE (13)
-#endif
-#ifndef SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED
-#define SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED (14)
-#endif
-#ifndef SENSOR_TYPE_GAME_ROTATION_VECTOR
-#define SENSOR_TYPE_GAME_ROTATION_VECTOR (15)
-#endif
-#ifndef SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
-#define SENSOR_TYPE_GYROSCOPE_UNCALIBRATED (16)
-#endif
-#ifndef SENSOR_TYPE_SIGNIFICANT_MOTION
-#define SENSOR_TYPE_SIGNIFICANT_MOTION (17)
-#endif
-#ifndef SENSOR_TYPE_STEP_DETECTOR
-#define SENSOR_TYPE_STEP_DETECTOR (18)
-#endif
-#ifndef SENSOR_TYPE_STEP_COUNTER
-#define SENSOR_TYPE_STEP_COUNTER (19)
-#endif
-#ifndef SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
-#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR (20)
-#endif
-#ifndef SENSOR_TYPE_HEART_RATE
-#define SENSOR_TYPE_HEART_RATE (21)
-#endif
-#ifndef SENSOR_TYPE_TILT_DETECTOR
-#define SENSOR_TYPE_TILT_DETECTOR (22)
-#endif
-#ifndef SENSOR_TYPE_WAKE_GESTURE
-#define SENSOR_TYPE_WAKE_GESTURE (23)
-#endif
-#ifndef SENSOR_TYPE_GLANCE_GESTURE
-#define SENSOR_TYPE_GLANCE_GESTURE (24)
-#endif
-#ifndef SENSOR_TYPE_PICK_UP_GESTURE
-#define SENSOR_TYPE_PICK_UP_GESTURE (25)
-#endif
-#ifndef SENSOR_TYPE_WRIST_TILT_GESTURE
-#define SENSOR_TYPE_WRIST_TILT_GESTURE (26)
-#endif
-
#ifdef USE_BINDER
#define SENSOR_BINDER_SERVICE_DEVICE "/dev/hwbinder"
#define SENSOR_BINDER_SERVICE_IFACE "android.hardware.sensors@1.0::ISensors"
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/core/hybrisadaptor.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
@@ -36,6 +35,97 @@
#include <pthread.h>
#endif
+/* Older devices probably have old android hal and thus do
+ * not define sensor all sensor types that have been added
+ * later on -> In order to both use symbolic names and
+ * compile for all devices we need to fill in holes that
+ * android hal for some particular device might have.
+ */
+#ifndef SENSOR_TYPE_META_DATA
+#define SENSOR_TYPE_META_DATA (0)
+#endif
+#ifndef SENSOR_TYPE_ACCELEROMETER
+#define SENSOR_TYPE_ACCELEROMETER (1)
+#endif
+#ifndef SENSOR_TYPE_GEOMAGNETIC_FIELD
+#define SENSOR_TYPE_GEOMAGNETIC_FIELD (2) // alias for SENSOR_TYPE_MAGNETIC_FIELD
+#endif
+#ifndef SENSOR_TYPE_MAGNETIC_FIELD
+#define SENSOR_TYPE_MAGNETIC_FIELD (2) // alias for SENSOR_TYPE_GEOMAGNETIC_FIELD
+#endif
+#ifndef SENSOR_TYPE_ORIENTATION
+#define SENSOR_TYPE_ORIENTATION (3)
+#endif
+#ifndef SENSOR_TYPE_GYROSCOPE
+#define SENSOR_TYPE_GYROSCOPE (4)
+#endif
+#ifndef SENSOR_TYPE_LIGHT
+#define SENSOR_TYPE_LIGHT (5)
+#endif
+#ifndef SENSOR_TYPE_PRESSURE
+#define SENSOR_TYPE_PRESSURE (6)
+#endif
+#ifndef SENSOR_TYPE_TEMPERATURE
+#define SENSOR_TYPE_TEMPERATURE (7)
+#endif
+#ifndef SENSOR_TYPE_PROXIMITY
+#define SENSOR_TYPE_PROXIMITY (8)
+#endif
+#ifndef SENSOR_TYPE_GRAVITY
+#define SENSOR_TYPE_GRAVITY (9)
+#endif
+#ifndef SENSOR_TYPE_LINEAR_ACCELERATION
+#define SENSOR_TYPE_LINEAR_ACCELERATION (10)
+#endif
+#ifndef SENSOR_TYPE_ROTATION_VECTOR
+#define SENSOR_TYPE_ROTATION_VECTOR (11)
+#endif
+#ifndef SENSOR_TYPE_RELATIVE_HUMIDITY
+#define SENSOR_TYPE_RELATIVE_HUMIDITY (12)
+#endif
+#ifndef SENSOR_TYPE_AMBIENT_TEMPERATURE
+#define SENSOR_TYPE_AMBIENT_TEMPERATURE (13)
+#endif
+#ifndef SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED
+#define SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED (14)
+#endif
+#ifndef SENSOR_TYPE_GAME_ROTATION_VECTOR
+#define SENSOR_TYPE_GAME_ROTATION_VECTOR (15)
+#endif
+#ifndef SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
+#define SENSOR_TYPE_GYROSCOPE_UNCALIBRATED (16)
+#endif
+#ifndef SENSOR_TYPE_SIGNIFICANT_MOTION
+#define SENSOR_TYPE_SIGNIFICANT_MOTION (17)
+#endif
+#ifndef SENSOR_TYPE_STEP_DETECTOR
+#define SENSOR_TYPE_STEP_DETECTOR (18)
+#endif
+#ifndef SENSOR_TYPE_STEP_COUNTER
+#define SENSOR_TYPE_STEP_COUNTER (19)
+#endif
+#ifndef SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
+#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR (20)
+#endif
+#ifndef SENSOR_TYPE_HEART_RATE
+#define SENSOR_TYPE_HEART_RATE (21)
+#endif
+#ifndef SENSOR_TYPE_TILT_DETECTOR
+#define SENSOR_TYPE_TILT_DETECTOR (22)
+#endif
+#ifndef SENSOR_TYPE_WAKE_GESTURE
+#define SENSOR_TYPE_WAKE_GESTURE (23)
+#endif
+#ifndef SENSOR_TYPE_GLANCE_GESTURE
+#define SENSOR_TYPE_GLANCE_GESTURE (24)
+#endif
+#ifndef SENSOR_TYPE_PICK_UP_GESTURE
+#define SENSOR_TYPE_PICK_UP_GESTURE (25)
+#endif
+#ifndef SENSOR_TYPE_WRIST_TILT_GESTURE
+#define SENSOR_TYPE_WRIST_TILT_GESTURE (26)
+#endif
+
#define SENSORFW_MCE_WATCHER
class HybrisAdaptor;
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/core/hybrisbindertypes.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2019 Jolla Ltd
-** Contact: matti.lehtimaki@jolla.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/core/loader.cpp
^
|
@@ -54,7 +54,6 @@
}
#define PLUGIN_PREFIX_ENV "SENSORFW_LIBRARY_PATH"
-#define PLUGIN_DIRECTORY "/usr/lib/sensord-qt5"
#define PLUGIN_PREFIX "lib"
#define PLUGIN_SUFFIX "-qt5.so"
#define SENSOR_SUFFIX "sensor"
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/core/sensormanager.cpp
^
|
@@ -41,11 +41,13 @@
#endif // SENSORFW_LUNA_SERVICE_CLIENT
#include <QSocketNotifier>
#include <errno.h>
+#include <functional>
#include "sockethandler.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
+#include <QTimer>
#include <QSettings>
@@ -55,6 +57,8 @@
void* buffer;
} PipeData;
+const int SensorManager::SOCKET_CONNECTION_TIMEOUT_MS = 10000;
+
SensorManager* SensorManager::instance_ = NULL;
int SensorManager::sessionIdCount_ = 0;
@@ -91,6 +95,59 @@
{
}
+SessionInstanceEntry::SessionInstanceEntry(QObject* parent, int sessionId, const QString& clientName)
+ : QObject(parent)
+ , m_sessionId(sessionId)
+ , m_clientName(clientName)
+ , m_timer(nullptr)
+{
+}
+
+SessionInstanceEntry::~SessionInstanceEntry()
+{
+ if (m_timer) {
+ delete m_timer;
+ m_timer = nullptr;
+ }
+}
+
+void SessionInstanceEntry::expectConnection(int msec)
+{
+ m_timer = new QTimer(this);
+ m_timer->setSingleShot(true);
+ m_timer->setInterval(msec);
+ connect(m_timer, &QTimer::timeout, this, &SessionInstanceEntry::timerTimeout);
+ m_timer->start();
+
+ SocketHandler& socketHandler = SensorManager::instance().socketHandler();
+ connect(&socketHandler, &SocketHandler::connectedSession,
+ this, &SessionInstanceEntry::sessionConnected);
+}
+
+void SessionInstanceEntry::timerTimeout()
+{
+ m_timer->deleteLater();
+ m_timer = nullptr;
+
+ SocketHandler& socketHandler = SensorManager::instance().socketHandler();
+ disconnect(&socketHandler, &SocketHandler::connectedSession, this, nullptr);
+ socketHandler.checkConnectionEstablished(m_sessionId);
+}
+
+void SessionInstanceEntry::sessionConnected(int sessionId)
+{
+ if (sessionId == m_sessionId) {
+ if (m_timer) {
+ m_timer->stop();
+ m_timer->deleteLater();
+ m_timer = nullptr;
+ }
+
+ SocketHandler& socketHandler = SensorManager::instance().socketHandler();
+ disconnect(&socketHandler, &SocketHandler::connectedSession, this, nullptr);
+ }
+}
+
inline QDBusConnection bus()
{
return QDBusConnection::systemBus();
@@ -138,6 +195,11 @@
sensordLogW() << "Error setting socket permissions! " << SOCKET_NAME;
}
+ serviceWatcher_ = new QDBusServiceWatcher(this);
+ serviceWatcher_->setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
+ QObject::connect(serviceWatcher_, &QDBusServiceWatcher::serviceUnregistered,
+ this, &SensorManager::dbusClientUnregistered);
+
#ifdef SENSORFW_MCE_WATCHER
mceWatcher_ = new MceWatcher(this);
connect(mceWatcher_, SIGNAL(displayStateChanged(const bool)),
@@ -211,6 +273,7 @@
delete socketHandler_;
delete pipeNotifier_;
+ delete serviceWatcher_;
if (pipefds_[0]) close(pipefds_[0]);
if (pipefds_[1]) close(pipefds_[1]);
@@ -260,6 +323,7 @@
setError(SmCanNotRegisterService, error.message());
return false;
}
+ serviceWatcher_->setConnection(bus());
return true;
}
@@ -368,8 +432,12 @@
return INVALID_SESSION;
}
+ QString clientName = "";
+ if ( calledFromDBus() )
+ clientName = message().service();
+
int sessionId = createNewSessionId();
- if(!entryIt.value().sensor_)
+ if (!entryIt.value().sensor_)
{
AbstractSensorChannel* sensor = addSensor(id);
if ( sensor == NULL )
@@ -380,12 +448,32 @@
entryIt.value().sensor_ = sensor;
}
entryIt.value().sessions_.insert(sessionId);
+ if ( !clientName.isEmpty() )
+ {
+ QMap<int, SessionInstanceEntry*>::iterator sessionIt = sessionInstanceMap_.insert(
+ sessionId, new SessionInstanceEntry(this, sessionId, clientName));
+ serviceWatcher_->addWatchedService(clientName);
+ sessionIt.value()->expectConnection(SOCKET_CONNECTION_TIMEOUT_MS);
+ }
return sessionId;
}
bool SensorManager::releaseSensor(const QString& id, int sessionId)
{
+ QString clientName = "";
+ QMap<int, SessionInstanceEntry*>::iterator sessionIt = sessionInstanceMap_.find(sessionId);
+ if ( calledFromDBus() )
+ {
+ clientName = message().service();
+ if ( sessionIt == sessionInstanceMap_.end() || sessionIt.value()->m_clientName != clientName )
+ {
+ sensordLogW() << "Ignoring attempt to release session" << sessionId
+ << "that wasn't previously registered for D-Bus client" << clientName;
+ return false;
+ }
+ }
+
sensordLogD() << "Releasing sensor '" << id << "' for session: " << sessionId;
clearError();
@@ -431,6 +519,28 @@
setError( SmNotInstantiated, tr("invalid sessionId, no session to release") );
}
+ if ( sessionIt != sessionInstanceMap_.end() )
+ {
+ delete sessionIt.value();
+ sessionInstanceMap_.erase(sessionIt);
+ }
+
+ if (!clientName.isEmpty())
+ {
+ bool hasMoreSessions = false;
+ for (sessionIt = sessionInstanceMap_.begin(); sessionIt != sessionInstanceMap_.end(); ++sessionIt)
+ {
+ if (sessionIt.value()->m_clientName == clientName)
+ {
+ hasMoreSessions = true;
+ break;
+ }
+ }
+
+ if (!hasMoreSessions)
+ serviceWatcher_->removeWatchedService(clientName);
+ }
+
socketHandler_->removeSession(sessionId);
return returnValue;
@@ -689,6 +799,19 @@
sensordLogW() << "[SensorManager]: Lost session " << sessionId << " detected, but not found from session list";
}
+void SensorManager::dbusClientUnregistered(const QString &clientName)
+{
+ sensordLogD() << "Watched D-Bus service '" << clientName << "' unregistered";
+ QMap<int, SessionInstanceEntry*>::iterator it = sessionInstanceMap_.begin();
+ while (it != sessionInstanceMap_.end())
+ {
+ QMap<int, SessionInstanceEntry*>::iterator prev = it;
+ ++it;
+ if (prev.value()->m_clientName == clientName)
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/core/sensormanager.h
^
|
@@ -30,6 +30,9 @@
#ifndef SENSORMANAGER_H
#define SENSORMANAGER_H
+#include <QDBusContext>
+#include <QDBusServiceWatcher>
+
#include "abstractsensor.h"
#include "abstractchain.h"
#include "deviceadaptor.h"
@@ -50,6 +53,7 @@
#endif
class QSocketNotifier;
+class QTimer;
class SocketHandler;
/**
@@ -124,10 +128,56 @@
};
/**
+ * Sensor session instance entry. Contains session ID, D-Bus service name of
+ * connecting side and timer for initial connection timeout.
+ */
+class SessionInstanceEntry : public QObject
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(SessionInstanceEntry)
+public:
+ /**
+ * Constructor.
+ *
+ * @param sessionId Sensor ID
+ * @param clientName D-Bus service name of requesting side
+ */
+ SessionInstanceEntry(QObject* parent, int sessionId, const QString& clientName);
+
+ /**
+ * Destructor.
+ */
+ ~SessionInstanceEntry();
+
+ /**
+ * Start timer to check if socket connection has been established after timeout.
+ *
+ * @param msec time to wait for socket connection.
+ */
+ void expectConnection(int msec);
+
+ int m_sessionId; /**< Session ID */
+ QString m_clientName; /**< D-Bus private client name */
+ QTimer* m_timer; /**< timer for initial connection */
+
+public slots:
+
+ /**
+ * Callback for initial connection timer.
+ */
+ void timerTimeout();
+
+ /**
+ * Callback for session socket connection getting established.
+ */
+ void sessionConnected(int sessionId);
+};
+
+/**
* Sensor manager. Singleton class which manages client sessions and
* track existence and usage of sensors, chains and adaptors.
*/
-class SensorManager : public QObject
+class SensorManager : public QObject, protected QDBusContext
{
Q_OBJECT
Q_DISABLE_COPY(SensorManager)
@@ -368,6 +418,13 @@
void lostClient(int sessionId);
/**
+ * Callback for D-Bus service unregistration.
+ *
+ * @param sessionId Session ID.
+ */
+ void dbusClientUnregistered(const QString &clientName);
+
+ /**
* Callback for MCE or LS display state change event.
*
* @param displayState display state.
@@ -473,6 +530,7 @@
QMap<QString, SensorChannelFactoryMethod> sensorFactoryMap_; /**< factories for sensor types */
QMap<QString, SensorInstanceEntry> sensorInstanceMap_; /**< sensor instances */
+ QMap<int, SessionInstanceEntry*> sessionInstanceMap_; /**< sensor session instances */
QMap<QString, DeviceAdaptorFactoryMethod> deviceAdaptorFactoryMap_; /**< factories for adaptor types. */
QMap<QString, DeviceAdaptorInstanceEntry> deviceAdaptorInstanceMap_; /**< adaptor instances */
@@ -483,6 +541,7 @@
QMap<QString, FilterFactoryMethod> filterFactoryMap_; /**< factories for filter types */
SocketHandler* socketHandler_; /**< socket handler */
+ QDBusServiceWatcher* serviceWatcher_; /**< D-Bus service watcher */
MceWatcher* mceWatcher_; /**< MCE watcher */
#ifdef SENSORFW_LUNA_SERVICE_CLIENT
LSClient* lsClient_; /**< LS client */
@@ -496,6 +555,8 @@
static int sessionIdCount_; /** session ID counter */
double deviation;
+
+ static const int SOCKET_CONNECTION_TIMEOUT_MS;
};
template<class SENSOR_TYPE>
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/core/sockethandler.cpp
^
|
@@ -276,6 +276,15 @@
return true;
}
+void SocketHandler::checkConnectionEstablished(int sessionId)
+{
+ if (!(m_idMap.keys().contains(sessionId))) {
+ sensordLogW() << "[SocketHandler]: Socket connection for session" << sessionId
+ << "hasn't been estabilished. Considering session lost";
+ emit lostSession(sessionId);
+ }
+}
+
void SocketHandler::newConnection()
{
sensordLogT() << "[SocketHandler]: New connection received.";
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/core/sockethandler.h
^
|
@@ -237,6 +237,15 @@
bool removeSession(int sessionId);
/**
+ * Verify if socket connection for a given session has been established.
+ * If there has been no connection, session is considered lost and
+ * lostSession signal is emitted.
+ *
+ * @param sessionId Session ID.
+ */
+ void checkConnectionEstablished(int sessionId);
+
+ /**
* Get socket file descriptor for given session.
*
* @param sessionId Session ID.
@@ -339,6 +348,14 @@
Q_SIGNALS:
/**
+ * Signal is emitted for new client connection after it sent the
+ session id.
+ *
+ * @param sessionId Session ID.
+ */
+ void connectedSession(int sessionId);
+
+ /**
* Signal is emitted for lost sessions which can happen for example
* if application using sensorfw crashes.
*
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/debian/changelog
^
|
@@ -1,3 +1,15 @@
+sensorfw-qt5 (0.12.1) unstable; urgency=medium
+
+[hybrisadaptor] Fix building rotation vector adaptors with old Android versions
+
+ -- Matti Lehtimäki <matti.lehtimaki@jolla.com> Wed, 09 Sep 2020 16:14:31 +0300
+
+sensorfw-qt5 (0.12.0) unstable; urgency=medium
+
+[hybrisadaptor] Use of hybris rotation vectors for compass
+
+ -- Simo Piiroinen <simo.piiroinen@jollamobile.com> Wed, 02 Sep 2020 15:12:31 +0300
+
sensorfw-qt5 (0.11.1) unstable; urgency=medium
* [packaging] Add missing debian build dependencies. Fixes MER#2060
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/filters/avgaccfilter/avgaccfilter.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/filters/avgaccfilter/avgaccfilter.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/filters/avgaccfilter/avgaccfilterplugin.cpp
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/filters/avgaccfilter/avgaccfilterplugin.h
^
|
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
-** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/sensord-qt5.pc.in
^
|
@@ -0,0 +1,10 @@
+prefix=/usr
+includedir=${prefix}/include/sensord-qt5
+libdir=${prefix}/@LIB@
+
+Name: Sensorfw-qt5
+Description: Sensord for Qt 5
+Version: 0.12.1
+Requires:
+Libs: -L${libdir} -lsensorclient-qt5 -lsensordatatypes-qt5
+Cflags: -I${includedir} -I${includedir}/datatypes -I${includedir}/filters
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/sensord.prf
^
|
@@ -1,5 +1,5 @@
-LIBS += -L/usr/lib/ -lsensorclient-qt5 -lsensordatatypes-qt5
+LIBS += -L$$[QT_INSTALL_LIBS] -lsensorclient-qt5 -lsensordatatypes-qt5
DEPENDPATH += /usr/include/sensord-qt5
INCLUDEPATH += /usr/include/sensord-qt5 /usr/include/sensord-qt5/datatypes /usr/include/sensord-qt5/filters
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/sensorfw.pro
^
|
@@ -65,7 +65,7 @@
publicheaders.files += include/*.h
INSTALLS += PKGCONFIGFILES QTCONFIGFILES
- PKGCONFIGFILES.path = /usr/lib/pkgconfig
+ PKGCONFIGFILES.path = $$[QT_INSTALL_LIBS]/pkgconfig
QTCONFIGFILES.files = sensord.prf
qt-api.depends = datatypes
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/tests/contextfw/als/testals.py
^
|
@@ -2,11 +2,6 @@
##
## Copyright (C) 2009-2010 Nokia Corporation
##
-## Contact: Jean-Luc Lamadon <jean-luc.lamadon@nokia.com>
-## Matias Muhonen <ext-matias.muhonen@nokia.com>
-## Tapio Rantala <ext-tapio.rantala@nokia.com>
-## Lihan Guo <ext-lihan.4.guo@nokia.com>
-##
## This file is part of Sensord.
##
## Sensord is free software; you can redistribute it and/or modify
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/tests/contextfw/orientation/testorientation-manual.sh
^
|
@@ -5,9 +5,6 @@
## Test different accelerometer input values manually.
## As a result, screen should rotate.
##
-## Contact: Matias Muhonen <ext-matias.muhonen@nokia.com>
-## Contact: Tapio Rantala <ext-tapio.rantala@nokia.com>
-##
INPUT_DEV_NUM=`ls /sys/class/input/event?/device/name | xargs grep -i accelerometer | cut -c23`
INPUT_DEV=/dev/input/event${INPUT_DEV_NUM}
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/tests/contextfw/orientation/testorientation.py
^
|
@@ -2,11 +2,6 @@
##
## Copyright (C) 2009-2010 Nokia Corporation
##
-## Contact: Jean-Luc Lamadon <jean-luc.lamadon@nokia.com>
-## Matias Muhonen <ext-matias.muhonen@nokia.com>
-## Tapio Rantala <ext-tapio.rantala@nokia.com>
-## Lihan Guo <ext-lihan.4.guo@nokia.com>
-##
## This file is part of Sensord.
##
## Sensord is free software; you can redistribute it and/or modify
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/tests/contextfw/stationary/teststationary.py
^
|
@@ -2,8 +2,6 @@
##
## Copyright (C) 2009-2010 Nokia Corporation
##
-## Contact: Lihan Guo <ext-lihan.4.guo@nokia.com>
-##
## This file is part of Sensord.
##
## Sensord is free software; you can redistribute it and/or modify
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/tests/deadclient/sensord-deadclienttest.py
^
|
@@ -2,8 +2,6 @@
##
## Copyright (C) 2009-2010 Nokia Corporation
##
-## Contact: Ustun Ergenoglu <ext-ustun.ergenoglu@nokia.com>
-##
## This file is part of Sensord.
##
## Sensord is free software; you can redistribute it and/or modify
|
[-]
[+]
|
Added |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/tests/tests.xml.in
^
|
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<testdefinition version="0.1">
+ <!-- Test suite, sensorfw-tests for automated testing of sensord -->
+ <suite name="Sensorfw-tests" domain="System Software">
+ <!-- At least one set per suite, name and description mandatory -->
+ <set name="Sensord-automated-tests" description="Unit test cases for sensord" feature="Sensor Framework" requirement="88917">
+ <case name="Sensord_Filters" level="Component" type="Functional" description="Unit test cases for sensor filters" timeout="15" subfeature="Sensor Framework">
+ <step expected_result="0">/usr/bin/sensorfilters-test</step>
+ </case>
+ <case name="Sensord_Dataflow" level="Component" type="Functional" description="Sensord dataflow test" timeout="15" subfeature="Sensor Framework">
+ <step expected_result="0">/usr/bin/sensordataflow-test</step>
+ </case>
+ <case name="Sensord_Adaptors" level="Component" type="Functional" description="Unit test cases for sensor adaptors" timeout="15" subfeature="Sensor Framework">
+ <step expected_result="0">/usr/bin/sensoradaptors-test</step>
+ </case>
+ <case name="Sensord_Chains" level="Component" type="Functional" description="Unit test cases for sensor chains" timeout="15" subfeature="Sensor Framework">
+ <step>stop sensord</step>
+ <step expected_result="0">/usr/bin/sensorchains-test</step>
+ <step>start sensord</step>
+ <step>sleep 2</step>
+ </case>
+ <case name="Sensor_Client_API" level="Component" type="Functional" description="Client API tests for sensord" timeout="90" subfeature="Sensor Framework">
+ <step expected_result="0">/usr/bin/sensorapi-test</step>
+ </case>
+ <case name="Sensor_MetaData" level="Component" type="Functional" description="Sensor metadata tests for sensord" timeout="15" subfeature="Sensor Framework">
+ <step expected_result="0">/usr/bin/sensormetadata-test</step>
+ </case>
+ <case name="Dead_Client" type="Functional" level="Component" description="Unit test for properly detecting dead clients." timeout="60" subfeature="Sensor Framework">
+ <step expected_result="0">/usr/share/sensorfw-tests/sensord-deadclienttest.py</step>
+ </case>
+
+ <!-- Environments optional - tells where the tests are run -->
+ <environments>
+ <scratchbox>false</scratchbox>
+ <hardware>true</hardware>
+ </environments>
+ </set>
+
+ <set name="Sensord-memory-tests" description="Memory leak tests for sensord" feature="Sensor Framework" requirement="SensorFw Testing and automation">
+ <case name="Sensord_Memory_OpenClose" level="Component" type="Benchmark" description="Memory leak check for session open/close" timeout="200" subfeature="Sensor Framework">
+ <step>/usr/bin/sensorbenchmark-test testSessionLeaks</step>
+ </case>
+ <case name="Sensord_Memory_OpenKill" level="Component" type="Benchmark" description="Memory leak check for session open/kill" timeout="200" subfeature="Sensor Framework">
+ <step>/usr/bin/sensorbenchmark-test testLostSessionLeaks</step>
+ </case>
+
+ <!-- Environments optional - tells where the tests are run -->
+ <environments>
+ <scratchbox>false</scratchbox>
+ <hardware>true</hardware>
+ </environments>
+ </set>
+
+ <set name="Sensord-pm-tests" description="Sensord power management tests" feature="Sensor Framework" requirement="SensorFw Testing and automation">
+ <pre_steps>
+ <step expected_result="0">/usr/bin/sensordiverter.sh start</step>
+ <step>sleep 5</step>
+ </pre_steps>
+
+ <case name="Sensord_Power_Management" type="Functional" level="Component" description="Sensord power management handling test" timeout="100" subfeature="Sensor Framework">
+ <step expected_result="0">/usr/bin/sensorpowermanagement-test</step>
+ </case>
+
+ <case name="Sensord_Standby_Override" type="Functional" level="Component" description="Sensord standby override test" timeout="100" subfeature="Sensor Framework">
+ <step expected_result="0">/usr/bin/sensorstandbyoverride-test</step>
+ </case>
+
+ <environments>
+ <scratchbox>false</scratchbox>
+ <hardware>true</hardware>
+ </environments>
+
+ <post_steps>
+ <step expected_result="0">/usr/bin/sensordiverter.sh stop</step>
+ </post_steps>
+ </set>
+
+
+ <set name="Sensord-benchmark-tests" description="Benchmark test cases for sensord" feature="Sensor Framework" requirement="SensorFw Testing and automation">
+
+ <pre_steps>
+ <!-- Stop sensord, kill to make sure -->
+ <step>stop sensord</step>
+ <step>killall sensord</step>
+ <step>rm -f /tmp/sensorTestSampleRate</step>
+ <step>mv @LIBDIR@/sensord/libalsadaptor.so @LIBDIR@/sensord/libalsadaptor.so.orig</step>
+ <step>ln -s @LIBDIR@/sensord/testing/libalsadaptor.so @LIBDIR@/sensord/libalsadaptor.so</step>
+ </pre_steps>
+
+ <case name="Sensord_Benchmark_50hz" level="Component" type="Benchmark" description="Sensord Benchmark @ 50hz" timeout="45" subfeature="Sensor Framework">
+ <step>echo 20 > /tmp/sensorTestSampleRate</step>
+ <step>start sensord</step>
+ <step>sleep 2</step>
+ <step>/usr/bin/sensorbenchmark-test testThroughput</step>
+ </case>
+ <case name="Sensord_Benchmark_200hz" level="Component" type="Benchmark" description="Sensord Benchmark @ 200hz" timeout="45" subfeature="Sensor Framework">
+ <step>stop sensord</step>
+ <step>echo 5 > /tmp/sensorTestSampleRate</step>
+ <step>start sensord</step>
+ <step>sleep 2</step>
+ <step>/usr/bin/sensorbenchmark-test testThroughput</step>
+ </case>
+ <case name="Sensord_Benchmark_500hz" level="Component" type="Benchmark" description="Sensord Benchmark @ 500hz" timeout="45" subfeature="Sensor Framework">
+ <step>stop sensord</step>
+ <step>echo 2 > /tmp/sensorTestSampleRate</step>
+ <step>start sensord</step>
+ <step>sleep 2</step>
+ <step>/usr/bin/sensorbenchmark-test testThroughput</step>
+ </case>
+
+ <post_steps>
+ <!-- Clean up and restore normal behavior-->
+ <step>stop sensord</step>
+ <step>rm -f /tmp/sensorTestSampleRate</step>
+ <step>rm -f @LIBDIR@/sensord/libalsadaptor.so</step>
+ <step>mv @LIBDIR@/sensord/libalsadaptor.so.orig @LIBDIR@/sensord/libalsadaptor.so</step>
+ <step>start sensord</step>
+ </post_steps>
+
+ <!-- Environments optional - tells where the tests are run -->
+ <environments>
+ <scratchbox>false</scratchbox>
+ <hardware>true</hardware>
+ </environments>
+ </set>
+
+ <set name="Sensord-external-tests" description="External issue tests for sensord" feature="Sensor Framework" requirement="SensorFw Testing and automation">
+ <case name="Sensord_External" level="Component" type="Functional" description="Check external required API, values etc." timeout="15" subfeature="Sensor Framework" insignificant="true">
+ <step>/usr/bin/sensorexternal-test</step>
+ </case>
+
+ <!-- Environments optional - tells where the tests are run -->
+ <environments>
+ <scratchbox>false</scratchbox>
+ <hardware>true</hardware>
+ </environments>
+ </set>
+
+ </suite>
+ </testdefinition>
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-binder-0.12.1.tar.bz2/tests/testutils/sensordiverter.sh
^
|
@@ -2,8 +2,6 @@
##
## Copyright (C) 2009-2010 Nokia Corporation
##
-## Contact: Tapio Rantala <ext-tapio.rantala@nokia.com>
-##
## This file is part of Sensord.
##
## Sensord is free software; you can redistribute it and/or modify
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-hybris.inc
^
|
@@ -1,7 +1,6 @@
Summary: Sensor Framework Qt5
-Group: System/Sensor Framework
License: LGPLv2+
-URL: http://gitorious.org/sensorfw
+URL: https://git.sailfishos.org/mer-core/sensorfw
Source0: %{name}-%{version}.tar.bz2
# Eventhough this is not really needed we have this here
# as this is added to packaging dir by tar_git.
@@ -23,7 +22,6 @@
%package devel
Summary: Sensor framework daemon libraries development headers
-Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: qt5-qtcore-devel
Requires: qt5-qtdbus-devel
@@ -33,20 +31,17 @@
Development headers for sensor framework daemon and libraries.
%prep
-%setup -q -n %{name}-%{version}
+%autosetup -n %{name}-%{version}
%build
unset LD_AS_NEEDED
-export LD_RUN_PATH=/usr/lib/sensord-qt5/
-export QT_SELECT=5
+export LD_RUN_PATH=%{_libdir}/sensord-qt5/
%qmake5 CONFIG+=hybris %{qmake_extra_parameters} PC_VERSION=`echo %{version} | sed 's/+.*//'`
-make %{?_smp_mflags}
+%make_build
%install
-rm -rf %{buildroot}
-export QT_SELECT=5
%qmake5_install
%post
@@ -57,6 +52,7 @@
%files
%defattr(-,root,root,-)
+%license COPYING
%{_libdir}/libhybrissensorfw*.so.*
%{_libdir}/libhybrissensorfw*.so
%{_libdir}/sensord-qt5/*.so
|