[-]
[+]
|
Changed |
_service:tar_git:sensorfw.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://git.merproject.org/mer-core/sensorfw.git</param>
<param name="branch">master</param>
- <param name="revision">b863b07cc89448cb088d1bc9a36ca836d98204cb</param>
+ <param name="revision">1677639c4bd150b0492266ba497779cf891dd097</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/adaptors/hybrisaccelerometer/hybrisaccelerometeradaptor.cpp
^
|
@@ -21,7 +21,6 @@
#include "hybrisaccelerometeradaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
-#include <hardware/sensors.h>
#include "config.h"
#define GRAVITY_RECIPROCAL_THOUSANDS 101.971621298
@@ -66,9 +65,15 @@
d->timestamp_ = quint64(data.timestamp * .001);
// sensorfw wants milli-G'
+#ifdef USE_BINDER
+ d->x_ = data.u.vec3.x * GRAVITY_RECIPROCAL_THOUSANDS;
+ d->y_ = data.u.vec3.y * GRAVITY_RECIPROCAL_THOUSANDS;
+ d->z_ = data.u.vec3.z * GRAVITY_RECIPROCAL_THOUSANDS;
+#else
d->x_ = data.acceleration.x * GRAVITY_RECIPROCAL_THOUSANDS;
d->y_ = data.acceleration.y * GRAVITY_RECIPROCAL_THOUSANDS;
d->z_ = data.acceleration.z * GRAVITY_RECIPROCAL_THOUSANDS;
+#endif
buffer->commit();
buffer->wakeUpReaders();
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/adaptors/hybrisalsadaptor/hybrisalsadaptor.cpp
^
|
@@ -24,7 +24,6 @@
#include "hybrisalsadaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
-#include <hardware/sensors.h>
#include "config.h"
#include <fcntl.h>
@@ -129,7 +128,11 @@
{
TimedUnsigned *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
+#ifdef USE_BINDER
+ d->value_ = data.u.scalar;
+#else
d->value_ = data.light;
+#endif
lastLightValue = d->value_;
buffer->commit();
buffer->wakeUpReaders();
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptor.cpp
^
|
@@ -21,7 +21,6 @@
#include "hybrisgyroscopeadaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
-#include <hardware/sensors.h>
#include "config.h"
#include <math.h>
@@ -73,9 +72,15 @@
TimedXyzData *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
+#ifdef USE_BINDER
+ d->x_ = (data.u.vec3.x) * RADIANS_TO_DEGREES * 1000;
+ d->y_ = (data.u.vec3.y) * RADIANS_TO_DEGREES * 1000;
+ d->z_ = (data.u.vec3.z) * RADIANS_TO_DEGREES * 1000;
+#else
d->x_ = (data.gyro.x) * RADIANS_TO_DEGREES * 1000;
d->y_ = (data.gyro.y) * RADIANS_TO_DEGREES * 1000;
d->z_ = (data.gyro.z) * RADIANS_TO_DEGREES * 1000;
+#endif
buffer->commit();
buffer->wakeUpReaders();
}
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/adaptors/hybrismagnetometeradaptor/hybrismagnetometeradaptor.cpp
^
|
@@ -21,7 +21,6 @@
#include "hybrismagnetometeradaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
-#include <hardware/sensors.h>
#include "config.h"
HybrisMagnetometerAdaptor::HybrisMagnetometerAdaptor(const QString& id) :
@@ -68,6 +67,16 @@
{
CalibratedMagneticFieldData *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
+
+#ifdef USE_BINDER
+ d->x_ = data.u.vec3.x * 1000;
+ d->y_ = data.u.vec3.y * 1000;
+ d->z_ = data.u.vec3.z * 1000;
+ d->rx_ = data.u.vec3.x * 1000;
+ d->ry_ = data.u.vec3.y * 1000;
+ d->rz_ = data.u.vec3.z * 1000;
+ d->level_= data.u.vec3.status;
+#else
//uT
d->x_ = (data.magnetic.x * 1000);
d->y_ = (data.magnetic.y * 1000);
@@ -81,7 +90,7 @@
d->rx_ = data.magnetic.x * 1000;
d->ry_ = data.magnetic.y * 1000;
d->rz_ = data.magnetic.z * 1000;
-
+#endif
#endif
buffer->commit();
buffer->wakeUpReaders();
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/adaptors/hybrisorientationadaptor/hybrisorientationadaptor.cpp
^
|
@@ -21,7 +21,6 @@
#include "hybrisorientationadaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
-#include <hardware/sensors.h>
#include "config.h"
/*
@@ -84,9 +83,14 @@
{
CompassData *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
+#ifdef USE_BINDER
+ d->degrees_ = data.u.vec3.x; //azimuth
+ d->level_ = data.u.vec3.status;
+#else
d->degrees_ = data.orientation.azimuth; //azimuth
- d->rawDegrees_ = d->degrees_;
d->level_ = data.orientation.status;
+#endif
+ d->rawDegrees_ = d->degrees_;
buffer->commit();
buffer->wakeUpReaders();
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/adaptors/hybrispressureadaptor/hybrispressureadaptor.cpp
^
|
@@ -26,7 +26,6 @@
#include "hybrispressureadaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
-#include <hardware/sensors.h>
#include "config.h"
HybrisPressureAdaptor::HybrisPressureAdaptor(const QString& id) :
@@ -70,7 +69,11 @@
{
TimedUnsigned *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
+#ifdef USE_BINDER
+ d->value_ = data.u.scalar * 100;//From hPa to Pa
+#else
d->value_ = data.pressure * 100;//From hPa to Pa
+#endif
buffer->commit();
buffer->wakeUpReaders();
}
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/adaptors/hybrisproximityadaptor/hybrisproximityadaptor.cpp
^
|
@@ -25,7 +25,6 @@
#include "hybrisproximityadaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
-#include <hardware/sensors.h>
#include "config.h"
#include <fcntl.h>
#include <unistd.h>
@@ -138,11 +137,18 @@
ProximityData *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
bool near = false;
+#ifdef USE_BINDER
+ if (data.u.scalar < maxRange()) {
+ near = true;
+ }
+ d->value_ = data.u.scalar;
+#else
if (data.distance < maxRange()) {
near = true;
}
- d->withinProximity_ = near;
d->value_ = data.distance;
+#endif
+ d->withinProximity_ = near;
lastNearValue = near;
buffer->commit();
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptor.cpp
^
|
@@ -24,7 +24,6 @@
#include "hybrisstepcounteradaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
-#include <hardware/sensors.h>
#include "config.h"
#ifndef SENSOR_TYPE_STEP_COUNTER
@@ -81,6 +80,9 @@
{
TimedUnsigned *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
+#ifdef USE_BINDER
+ d->value_ = data.u.stepCount;
+#else
#ifdef NO_SENSORS_EVENT_U64
uint64_t value = 0;
memcpy(&value, data.data, sizeof value);
@@ -88,6 +90,7 @@
#else
d->value_ = data.u64.step_counter;
#endif
+#endif
buffer->commit();
buffer->wakeUpReaders();
}
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/common-config.pri
^
|
@@ -38,7 +38,11 @@
contains(CONFIG,hybris) {
CONFIG += link_pkgconfig
- PKGCONFIG += android-headers
- PKGCONFIG += libhardware
+ contains(CONFIG,binder) {
+ DEFINES += USE_BINDER=1
+ PKGCONFIG += libgbinder libglibutil gobject-2.0 glib-2.0
+ } else {
+ PKGCONFIG += android-headers libhardware
+ }
}
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/core/hybris.pro
^
|
@@ -5,9 +5,6 @@
include( ../common-config.pri )
-CONFIG += link_pkgconfig
-PKGCONFIG += android-headers
-
SENSORFW_INCLUDEPATHS = .. \
../include \
../filters \
@@ -20,7 +17,11 @@
SOURCES += hybrisadaptor.cpp
HEADERS += hybrisadaptor.h
-LIBS += -L/usr/lib -lhybris-common -lhardware -L../datatypes
+LIBS += -L/usr/lib -L../datatypes
+
+!contains(CONFIG,binder) {
+ LIBS += -lhybris-common -lhardware
+}
include(../common-install.pri)
target.path = $$SHAREDLIBPATH
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/core/hybrisadaptor.cpp
^
|
@@ -25,8 +25,9 @@
#include <QCoreApplication>
#include <QTimer>
+#ifndef USE_BINDER
#include <hardware/hardware.h>
-#include <hardware/sensors.h>
+#endif
#include <unistd.h>
#include <fcntl.h>
@@ -34,6 +35,7 @@
#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
@@ -125,6 +127,12 @@
#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"
+#define SENSOR_BINDER_SERVICE_NAME SENSOR_BINDER_SERVICE_IFACE "/default"
+#endif
+
/* ========================================================================= *
* UTILITIES
* ========================================================================= */
@@ -217,15 +225,26 @@
: QObject(parent)
, m_initialized(false)
, m_registeredAdaptors()
+#ifdef USE_BINDER
+ , m_client(NULL)
+ , m_deathId(0)
+ , m_pollTransactId(0)
+ , m_remote(NULL)
+ , m_serviceManager(NULL)
+#else
, m_halModule(NULL)
, m_halDevice(NULL)
- , m_halSensorCount(0)
- , m_halSensorArray(NULL)
- , m_halSensorState(NULL)
- , m_halIndexOfType()
- , m_halIndexOfHandle()
, m_halEventReaderTid(0)
-{
+#endif
+ , m_sensorArray(NULL)
+ , m_sensorCount(0)
+ , m_sensorState(NULL)
+ , m_indexOfType()
+ , m_indexOfHandle()
+{
+#ifdef USE_BINDER
+ startConnect();
+#else
int err;
/* Open android sensor plugin */
@@ -246,45 +265,60 @@
}
/* Get static sensor information */
- m_halSensorCount = m_halModule->get_sensors_list(m_halModule, &m_halSensorArray);
+ m_sensorCount = m_halModule->get_sensors_list(m_halModule, &m_sensorArray);
+ initManager();
+#endif
+}
+
+void HybrisManager::initManager()
+{
/* Reserve space for sensor state data */
- m_halSensorState = new HybrisSensorState[m_halSensorCount];
+ m_sensorState = new HybrisSensorState[m_sensorCount];
/* Select and initialize sensors to be used */
- for (int i = 0 ; i < m_halSensorCount ; i++) {
+ for (int i = 0 ; i < m_sensorCount ; i++) {
/* Always do handle -> index mapping */
- m_halIndexOfHandle.insert(m_halSensorArray[i].handle, i);
+ m_indexOfHandle.insert(m_sensorArray[i].handle, i);
bool use = true;
// Assumption: The primary sensor variants that we want to
// use are listed before the secondary ones that we want
// to ignore -> Use the 1st entry found for each sensor type.
- if (m_halIndexOfType.contains(m_halSensorArray[i].type)) {
+ if (m_indexOfType.contains(m_sensorArray[i].type)) {
use = false;
}
// some devices have compass and compass raw,
// ignore compass raw. compass has range 360
- if (m_halSensorArray[i].type == SENSOR_TYPE_ORIENTATION &&
- m_halSensorArray[i].maxRange != 360) {
+ if (m_sensorArray[i].type == SENSOR_TYPE_ORIENTATION &&
+ m_sensorArray[i].maxRange != 360) {
use = false;
}
sensordLogD() << Q_FUNC_INFO
<< (use ? "SELECT" : "IGNORE")
- << "type:" << m_halSensorArray[i].type
- << "name:" << (m_halSensorArray[i].name ?: "n/a");
+ << "type:" << m_sensorArray[i].type
+#ifdef USE_BINDER
+ << "name:" << (m_sensorArray[i].name.data.str ?: "n/a");
+#else
+ << "name:" << (m_sensorArray[i].name ?: "n/a");
+#endif
if (use) {
// min/max delay is specified in [us] -> convert to [ms]
- int minDelay = (m_halSensorArray[i].minDelay + 999) / 1000;
+ int minDelay = (m_sensorArray[i].minDelay + 999) / 1000;
int maxDelay = -1; // Assume: not defined by hal
+#ifdef USE_BINDER
+ maxDelay = (m_sensorArray[i].maxDelay + 999) / 1000;
+#else
#ifdef SENSORS_DEVICE_API_VERSION_1_3
if (m_halDevice->common.version >= SENSORS_DEVICE_API_VERSION_1_3)
- maxDelay = (m_halSensorArray[i].maxDelay + 999) / 1000;
+ maxDelay = (m_sensorArray[i].maxDelay + 999) / 1000;
+#endif
#endif
+
/* If HAL does not define maximum delay, we need to invent
* something that a) allows sensorfwd logic to see a range
* instead of a point, b) is unlikely to be wrong enough to
@@ -292,6 +326,7 @@
*
* For now use: minDelay * 2, but at least 1000 ms.
*/
+
if (maxDelay < 0 && minDelay > 0) {
maxDelay = (minDelay < 500) ? 1000 : (minDelay * 2);
sensordLogD("hal does not specify maxDelay, fallback: %d ms",
@@ -315,35 +350,46 @@
else if (delay > maxDelay )
delay = maxDelay;
- m_halSensorState[i].m_minDelay = minDelay;
- m_halSensorState[i].m_maxDelay = maxDelay;
+ m_sensorState[i].m_minDelay = minDelay;
+ m_sensorState[i].m_maxDelay = maxDelay;
- halSetActive(m_halSensorArray[i].handle, true);
- halSetDelay(m_halSensorArray[i].handle, delay);
+ setDelay(m_sensorArray[i].handle, delay, true);
+ setActive(m_sensorArray[i].handle, true);
+ setDelay(m_sensorArray[i].handle, delay, false);
sensordLogD("delay = %d [%d, %d]",
- m_halSensorState[i].m_delay,
- m_halSensorState[i].m_minDelay,
- m_halSensorState[i].m_maxDelay);
+ m_sensorState[i].m_delay,
+ m_sensorState[i].m_minDelay,
+ m_sensorState[i].m_maxDelay);
}
- m_halIndexOfType.insert(m_halSensorArray[i].type, i);
+ m_indexOfType.insert(m_sensorArray[i].type, i);
/* Set sane fallback values for select sensors in case the
* hal does not report initial values. */
- sensors_event_t *eve = &m_halSensorState[i].m_fallbackEvent;
- eve->version = sizeof *eve;
- eve->sensor = m_halSensorArray[i].handle;
- eve->type = m_halSensorArray[i].type;
- switch (m_halSensorArray[i].type) {
+ sensors_event_t *eve = &m_sensorState[i].m_fallbackEvent;
+#ifndef USE_BINDER
+ eve->version = sizeof *eve;
+#endif
+ eve->sensor = m_sensorArray[i].handle;
+ eve->type = m_sensorArray[i].type;
+ switch (m_sensorArray[i].type) {
case SENSOR_TYPE_LIGHT:
// Roughly indoor lightning
+#ifdef USE_BINDER
+ eve->u.scalar = 400;
+#else
eve->light = 400;
+#endif
break;
case SENSOR_TYPE_PROXIMITY:
// Not-covered
- eve->distance = m_halSensorArray[i].maxRange;
+#ifdef USE_BINDER
+ eve->u.scalar = m_sensorArray[i].maxRange;
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/core/hybrisadaptor.h
^
|
@@ -26,10 +26,16 @@
#include <QTimer>
#include <QFile>
-#include <pthread.h>
-
#include "deviceadaptor.h"
+
+#ifdef USE_BINDER
+#include <gbinder.h>
+#include "hybrisbindertypes.h"
+#else
#include <hardware/sensors.h>
+#include <pthread.h>
+#endif
+
#define SENSORFW_MCE_WATCHER
class HybrisAdaptor;
@@ -54,23 +60,25 @@
explicit HybrisManager(QObject *parent = 0);
virtual ~HybrisManager();
+ void cleanup();
+ void initManager();
/* - - - - - - - - - - - - - - - - - - - *
- * android sensor hal functions
+ * android sensor functions
* - - - - - - - - - - - - - - - - - - - */
- sensors_event_t *halEventForHandle(int handle) const;
- int halIndexForHandle(int handle) const;
- int halIndexForType (int sensorType) const;
- int halHandleForType (int sensorType) const;
- float halGetMaxRange (int handle) const;
- float halGetResolution (int handle) const;
- int halGetMinDelay (int handle) const;
- int halGetMaxDelay (int handle) const;
- int halGetDelay (int handle) const;
- bool halSetDelay (int handle, int delay_ms);
- bool halGetActive (int handle) const;
- bool halSetActive (int handle, bool active);
+ sensors_event_t *eventForHandle(int handle) const;
+ int indexForHandle(int handle) const;
+ int indexForType (int sensorType) const;
+ int handleForType (int sensorType) const;
+ float getMaxRange (int handle) const;
+ float getResolution (int handle) const;
+ int getMinDelay (int handle) const;
+ int getMaxDelay (int handle) const;
+ int getDelay (int handle) const;
+ bool setDelay (int handle, int delay_ms, bool force);
+ bool getActive (int handle) const;
+ bool setActive (int handle, bool active);
/* - - - - - - - - - - - - - - - - - - - *
* HybrisManager <--> sensorfwd
@@ -85,19 +93,46 @@
// fields
bool m_initialized;
QMap <int, HybrisAdaptor *> m_registeredAdaptors; // type -> obj
+
+#ifdef USE_BINDER
+ // Binder backend
+ GBinderClient *m_client;
+ gulong m_deathId;
+ gulong m_pollTransactId;
+ GBinderRemoteObject *m_remote;
+ GBinderServiceManager *m_serviceManager;
+ struct sensor_t *m_sensorArray; // [m_sensorCount]
+#else
+ // HAL backend
struct sensors_module_t *m_halModule;
struct sensors_poll_device_t *m_halDevice;
- int m_halSensorCount;
- const struct sensor_t *m_halSensorArray; // [m_halSensorCount]
- HybrisSensorState *m_halSensorState; // [m_halSensorCount]
- QMap <int, int> m_halIndexOfType; // type -> index
- QMap <int, int> m_halIndexOfHandle; // handle -> index
pthread_t m_halEventReaderTid;
+ const struct sensor_t *m_sensorArray; // [m_sensorCount]
+#endif
+ int m_sensorCount;
+ HybrisSensorState *m_sensorState; // [m_sensorCount]
+ QMap <int, int> m_indexOfType; // type -> index
+ QMap <int, int> m_indexOfHandle; // handle -> index
+
+#ifdef USE_BINDER
+ void getSensorList();
+ void startConnect();
+ void finishConnect();
+ static void binderDied(GBinderRemoteObject *, void *user_data);
+ void pollEvents();
+ static void pollEventsCallback(
+ GBinderClient* /*client*/, GBinderRemoteReply* reply,
+ int status, void* userData);
+#endif
friend class HybrisAdaptorReader;
+#ifndef USE_BINDER
private:
static void *halEventReaderThread(void *aptr);
+#endif
+ void processEvents(const sensors_event_t *buffer,
+ int numberOfEvents, bool &blockSuspend, bool &errorInInput);
};
class HybrisAdaptor : public DeviceAdaptor
|
[-]
[+]
|
Added |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/core/hybrisbindertypes.h
^
|
@@ -0,0 +1,278 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 Jolla Ltd
+** Contact: matti.lehtimaki@jolla.com
+**
+**
+** $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 HYBRIS_BINDER_TYPES_H
+#define HYBRIS_BINDER_TYPES_H
+
+#include <gbinder.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#define STATUS_OK 0
+
+#define ALIGNED(x) __attribute__ ((aligned(x)))
+
+enum binder_calls {
+ // MUST be in the same order as the interfaces in ISensors.hidl
+ GET_SENSORS_LIST = GBINDER_FIRST_CALL_TRANSACTION,
+ SET_OPERATION_MODE,
+ ACTIVATE,
+ POLL,
+ BATCH,
+ FLUSH,
+ INJECT_SENSOR_DATA,
+ REGISTER_DIRECT_CHANNEL,
+ UNREGISTER_DIRECT_CHANNEL,
+ CONFIG_DIRECT_REPORT,
+};
+
+enum {
+ RESULT_OK = 0,
+ RESULT_PERMISSION_DENIED = -1,
+ RESULT_NO_MEMORY = -12,
+ RESULT_BAD_VALUE = -22,
+ RESULT_INVALID_OPERATION = -38,
+};
+
+enum {
+ OPERATION_MODE_NORMAL = 0,
+ OPERATION_MODE_DATA_INJECTION = 1,
+};
+
+enum {
+ SENSOR_TYPE_META_DATA = 0,
+ SENSOR_TYPE_ACCELEROMETER = 1,
+ SENSOR_TYPE_MAGNETIC_FIELD = 2,
+ SENSOR_TYPE_ORIENTATION = 3,
+ SENSOR_TYPE_GYROSCOPE = 4,
+ SENSOR_TYPE_LIGHT = 5,
+ SENSOR_TYPE_PRESSURE = 6,
+ SENSOR_TYPE_TEMPERATURE = 7,
+ SENSOR_TYPE_PROXIMITY = 8,
+ SENSOR_TYPE_GRAVITY = 9,
+ SENSOR_TYPE_LINEAR_ACCELERATION = 10,
+ SENSOR_TYPE_ROTATION_VECTOR = 11,
+ SENSOR_TYPE_RELATIVE_HUMIDITY = 12,
+ SENSOR_TYPE_AMBIENT_TEMPERATURE = 13,
+ SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14,
+ SENSOR_TYPE_GAME_ROTATION_VECTOR = 15,
+ SENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 16,
+ SENSOR_TYPE_SIGNIFICANT_MOTION = 17,
+ SENSOR_TYPE_STEP_DETECTOR = 18,
+ SENSOR_TYPE_STEP_COUNTER = 19,
+ SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20,
+ SENSOR_TYPE_HEART_RATE = 21,
+ SENSOR_TYPE_TILT_DETECTOR = 22,
+ SENSOR_TYPE_WAKE_GESTURE = 23,
+ SENSOR_TYPE_GLANCE_GESTURE = 24,
+ SENSOR_TYPE_PICK_UP_GESTURE = 25,
+ SENSOR_TYPE_WRIST_TILT_GESTURE = 26,
+ SENSOR_TYPE_DEVICE_ORIENTATION = 27,
+ SENSOR_TYPE_POSE_6DOF = 28,
+ SENSOR_TYPE_STATIONARY_DETECT = 29,
+ SENSOR_TYPE_MOTION_DETECT = 30,
+ SENSOR_TYPE_HEART_BEAT = 31,
+ SENSOR_TYPE_DYNAMIC_SENSOR_META = 32,
+ SENSOR_TYPE_ADDITIONAL_INFO = 33,
+ SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34,
+ SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 35,
+ SENSOR_TYPE_DEVICE_PRIVATE_BASE = 65536, // 0x10000
+};
+
+enum {
+ SENSOR_FLAG_WAKE_UP = 1u, // 1
+ SENSOR_FLAG_CONTINUOUS_MODE = 0u, // 0
+ SENSOR_FLAG_ON_CHANGE_MODE = 2u, // 2
+ SENSOR_FLAG_ONE_SHOT_MODE = 4u, // 4
+ SENSOR_FLAG_SPECIAL_REPORTING_MODE = 6u, // 6
+ SENSOR_FLAG_DATA_INJECTION = 16u, // 0x10
+ SENSOR_FLAG_DYNAMIC_SENSOR = 32u, // 0x20
+ SENSOR_FLAG_ADDITIONAL_INFO = 64u, // 0x40
+ SENSOR_FLAG_DIRECT_CHANNEL_ASHMEM = 1024u, // 0x400
+ SENSOR_FLAG_DIRECT_CHANNEL_GRALLOC = 2048u, // 0x800
+ SENSOR_FLAG_MASK_REPORTING_MODE = 14u, // 0xE
+ SENSOR_FLAG_MASK_DIRECT_REPORT = 896u, // 0x380
+ SENSOR_FLAG_MASK_DIRECT_CHANNEL = 3072u, // 0xC00
+};
+
+struct sensor_t {
+ int32_t handle ALIGNED(4);
+ gbinder_hidl_string name ALIGNED(8);
+ gbinder_hidl_string vendor ALIGNED(8);
+ int32_t version ALIGNED(4);
+ int32_t type ALIGNED(4);
+ gbinder_hidl_string typeAsString ALIGNED(8);
+ float maxRange ALIGNED(4);
+ float resolution ALIGNED(4);
+ float power ALIGNED(4);
+ int32_t minDelay ALIGNED(4);
+ uint32_t fifoReservedEventCount ALIGNED(4);
+ uint32_t fifoMaxEventCount ALIGNED(4);
+ gbinder_hidl_string requiredPermission ALIGNED(8);
+ int32_t maxDelay ALIGNED(4);
+ uint32_t flags ALIGNED(4);
+} ALIGNED(8);
+
+static_assert(sizeof(sensor_t) == 112, "wrong size");
+
+enum {
+ NO_CONTACT = -1, // (-1)
+ UNRELIABLE = 0,
+ ACCURACY_LOW = 1,
+ ACCURACY_MEDIUM = 2,
+ ACCURACY_HIGH = 3,
+};
+
+struct Vec3 {
+ float x ALIGNED(4);
+ float y ALIGNED(4);
+ float z ALIGNED(4);
+ int8_t status ALIGNED(1);
+} ALIGNED(4);
+
+static_assert(sizeof(Vec3) == 16, "wrong size");
+
+struct Vec4 {
+ float x ALIGNED(4);
+ float y ALIGNED(4);
+ float z ALIGNED(4);
+ float w ALIGNED(4);
+} ALIGNED(4);
+
+static_assert(sizeof(Vec4) == 16, "wrong size");
+
+struct Uncal {
+ float x ALIGNED(4);
+ float y ALIGNED(4);
+ float z ALIGNED(4);
+ float x_bias ALIGNED(4);
+ float y_bias ALIGNED(4);
+ float z_bias ALIGNED(4);
+} ALIGNED(4);
+
+static_assert(sizeof(Uncal) == 24, "wrong size");
+
+struct HeartRate {
+ float bpm ALIGNED(4);
+ int8_t status ALIGNED(1);
+} ALIGNED(4);
+
+static_assert(sizeof(HeartRate) == 8, "wrong size");
+
+enum {
+ META_DATA_FLUSH_COMPLETE = 1u, // 1
+};
+
+struct MetaData {
+ uint32_t what ALIGNED(4);
+} ALIGNED(4);
+
+static_assert(sizeof(MetaData) == 4, "wrong size");
+
+struct Dynamicsensor_t {
+ bool connected ALIGNED(1);
+ int32_t handle ALIGNED(4);
+ uint8_t uuid[16] ALIGNED(1);
+} ALIGNED(4);
+
+static_assert(sizeof(Dynamicsensor_t) == 24, "wrong size");
+
+enum class AdditionalInfoType : uint32_t {
+ AINFO_BEGIN = 0u, // 0
+ AINFO_END = 1u, // 1
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-0.10.10.tar.bz2/filters/declinationfilter/declinationfilter.cpp
^
|
@@ -35,7 +35,8 @@
DeclinationFilter::DeclinationFilter() :
Filter<CompassData, DeclinationFilter, CompassData>(this, &DeclinationFilter::correct),
- declinationCorrection_(0)
+ declinationCorrection_(0),
+ lastUpdate_(0)
{
updateInterval_ = SensorFrameworkConfig::configuration()->value<quint64>("compass/declination_update_interval", 1000 * 60 * 60) * 1000;
loadSettings();
|
[-]
[+]
|
Added |
_service:tar_git:sensorfw-qt5-hybris.inc
^
|
@@ -0,0 +1,67 @@
+Summary: Sensor Framework Qt5
+Version: 0.10.10
+Release: 0
+Group: System/Sensor Framework
+License: LGPLv2+
+URL: http://gitorious.org/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.
+Source2: sensorfwd.service
+Requires: sensord-qt5
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+BuildRequires: pkgconfig(Qt5Core)
+BuildRequires: pkgconfig(Qt5DBus)
+BuildRequires: pkgconfig(Qt5Network)
+BuildRequires: pkgconfig(Qt5Test)
+BuildRequires: pkgconfig(mlite5)
+BuildRequires: pkgconfig(sensord-qt5)
+Obsoletes: %{name}-configs <= 0.8.17
+
+%description
+Sensor Framework provides an interface to hardware sensor drivers through logical sensors. This package contains sensor framework daemon and required libraries.
+
+%package devel
+Summary: Sensor framework daemon libraries development headers
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: qt5-qtcore-devel
+Requires: qt5-qtdbus-devel
+Requires: qt5-qtnetwork-devel
+
+%description devel
+Development headers for sensor framework daemon and libraries.
+
+%prep
+%setup -q -n %{name}-%{version}
+
+%build
+unset LD_AS_NEEDED
+export LD_RUN_PATH=/usr/lib/sensord-qt5/
+export QT_SELECT=5
+
+%qmake5 CONFIG+=hybris %{qmake_extra_parameters} PC_VERSION=`echo %{version} | sed 's/+.*//'`
+
+make %{?_smp_mflags}
+
+%install
+rm -rf %{buildroot}
+export QT_SELECT=5
+%qmake5_install
+
+%post
+/sbin/ldconfig
+
+%postun
+/sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/libhybrissensorfw*.so.*
+%{_libdir}/libhybrissensorfw*.so
+%{_libdir}/sensord-qt5/*.so
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/sensord-qt5/*
|