[-]
[+]
|
Changed |
_service:tar_git:sensorfw.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:sensorfw-qt5-hybris.spec
^
|
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-hal-0.11.4.tar.bz2/adaptors/iioadaptor/iioadaptor.cpp
^
|
@@ -45,6 +45,7 @@
#include <QTimer>
#include <QDirIterator>
#include <qmath.h>
+#include <QRegularExpression>
#include <deviceadaptor.h>
#include "datatypes/orientationdata.h"
@@ -52,6 +53,10 @@
#define GRAVITY 9.80665
#define REV_GRAVITY 0.101936799
+// Proximity sensor
+#define PROXIMITY_DEFAULT_THRESHOLD 250
+#define PROXIMITY_NEAR_VALUE 0
+
/* Conversion of acceleration data to SI units (m/s^2) */
#define CONVERT_A_X(x) ((float(x) / 1000) * (GRAVITY * -1.0))
#define CONVERT_A_Y(x) ((float(x) / 1000) * (GRAVITY * 1.0))
@@ -73,6 +78,8 @@
delete alsBuffer_;
if (magnetometerBuffer_)
delete magnetometerBuffer_;
+ if (proximityBuffer_)
+ delete proximityBuffer_;
}
void IioAdaptor::setup()
@@ -84,6 +91,7 @@
const QString inputMatch = SensorFrameworkConfig::configuration()->value<QString>(name + "/input_match");
qDebug() << "input_match" << inputMatch;
+ iioDevice.channelTypeName = "accel";
devNodeNumber = findSensor(inputMatch);
if (devNodeNumber!= -1) {
const QString desc = "Industrial I/O accelerometer (" + iioDevice.name +")";
@@ -93,12 +101,12 @@
iioDevice.sensorType = IioAdaptor::IIO_ACCELEROMETER;
}
- }
- else if (deviceId.startsWith("gyro")) {
+ } else if (deviceId.startsWith("gyro")) {
const QString name = "gyroscope";
const QString inputMatch = SensorFrameworkConfig::configuration()->value<QString>(name + "/input_match");
qDebug() << "input_match" << inputMatch;
+ iioDevice.channelTypeName = "anglvel";
devNodeNumber = findSensor(inputMatch);
if (devNodeNumber!= -1) {
const QString desc = "Industrial I/O gyroscope (" + iioDevice.name +")";
@@ -107,14 +115,13 @@
iioDevice.sensorType = IioAdaptor::IIO_GYROSCOPE;
}
- }
- else if (deviceId.startsWith("mag")) {
+ } else if (deviceId.startsWith("mag")) {
const QString name = "magnetometer";
const QString inputMatch = SensorFrameworkConfig::configuration()->value<QString>(name + "/input_match");
qDebug() << "input_match" << inputMatch;
+ iioDevice.channelTypeName = "magn";
devNodeNumber = findSensor(inputMatch);
-
if (devNodeNumber!= -1) {
const QString desc = "Industrial I/O magnetometer (" + iioDevice.name +")";
magnetometerBuffer_ = new DeviceAdaptorRingBuffer<CalibratedMagneticFieldData>(1);
@@ -122,11 +129,11 @@
iioDevice.sensorType = IioAdaptor::IIO_MAGNETOMETER;
}
- }
- else if (deviceId.startsWith("als")) {
+ } else if (deviceId.startsWith("als")) {
const QString name = "als";
const QString inputMatch = SensorFrameworkConfig::configuration()->value<QString>(name + "/input_match");
+ iioDevice.channelTypeName = "illuminance";
devNodeNumber = findSensor(inputMatch);
if (devNodeNumber!= -1) {
QString desc = "Industrial I/O light sensor (" + iioDevice.name +")";
@@ -135,6 +142,21 @@
setAdaptedSensor(name, desc, alsBuffer_);
iioDevice.sensorType = IioAdaptor::IIO_ALS;
}
+ } else if (deviceId.startsWith("prox")) {
+ const QString name = "proximity";
+ const QString inputMatch = SensorFrameworkConfig::configuration()->value<QString>(name + "/input_match");
+ qDebug() << name + ":" << "input_match" << inputMatch;
+
+ iioDevice.channelTypeName = "proximity";
+ devNodeNumber = findSensor(inputMatch);
+ proximityThreshold = SensorFrameworkConfig::configuration()->value<QString>(name + "/threshold", QString(PROXIMITY_DEFAULT_THRESHOLD)).toInt();
+ if (devNodeNumber!= -1) {
+ QString desc = "Industrial I/O proximity sensor (" + iioDevice.name +")";
+ qDebug() << desc;
+ proximityBuffer_ = new DeviceAdaptorRingBuffer<ProximityData>(1);
+ setAdaptedSensor(name, desc, proximityBuffer_);
+ iioDevice.sensorType = IioAdaptor::IIO_PROXIMITY;
+ }
}
if (devNodeNumber == -1) {
@@ -142,8 +164,19 @@
// setValid(false);
return;
}
- iioDevice.channels = scanElementsEnable(devNodeNumber,1);
- scanElementsEnable(devNodeNumber,0);
+
+ if (mode() != SysfsAdaptor::IntervalMode) {
+ scanElementsEnable(devNodeNumber,1);
+ scanElementsEnable(devNodeNumber,0);
+ }
+
+ /* Override the scaling factor if asked */
+ bool ok;
+ double scale_override = SensorFrameworkConfig::configuration()->value(iioDevice.name + "/scale").toDouble(&ok);
+ if (ok) {
+ sensordLogD() << "Overriding scale to" << scale_override;
+ iioDevice.scale = scale_override;
+ }
introduceAvailableDataRange(DataRange(0, 65535, 1));
introduceAvailableInterval(DataRange(0, 586, 0));
@@ -182,7 +215,11 @@
QString eventName = QString::fromLatin1(udev_device_get_sysname(dev));
iioDevice.devicePath = QString::fromLatin1(udev_device_get_syspath(dev)) +"/";
iioDevice.index = eventName.right(1).toInt(&ok2);
- qDebug() << Q_FUNC_INFO << "syspath" << iioDevice.devicePath;
+ // Default values
+ iioDevice.offset = 0.0;
+ iioDevice.scale = 1.0;
+ iioDevice.frequency = 1.0;
+ qDebug() << Q_FUNC_INFO << "Syspath for sensor (" + sensorName + "):" << iioDevice.devicePath;
udev_list_entry_foreach(sysattr, udev_device_get_sysattr_list_entry(dev)) {
const char *name;
@@ -195,28 +232,29 @@
qDebug() << "attr" << name << value;
QString attributeName(name);
- if (attributeName.endsWith("scale")) {
+ if (attributeName.contains(QRegularExpression(iioDevice.channelTypeName + ".*scale$"))) {
iioDevice.scale = QString(value).toDouble(&ok);
if (ok) {
- // scale = num;
- qDebug() << "scale is" << iioDevice.scale;
+ qDebug() << sensorName + ":" << "Scale is" << iioDevice.scale;
}
- } else if (attributeName.endsWith("offset")) {
+ } else if (attributeName.contains(QRegularExpression(iioDevice.channelTypeName + ".*offset$"))) {
iioDevice.offset = QString(value).toDouble(&ok);
- if (ok)
- qDebug() << "offset is" << value;
+ if (ok) {
+ qDebug() << sensorName + ":" << "Offset is" << value;
+ }
} else if (attributeName.endsWith("frequency")) {
iioDevice.frequency = QString(value).toDouble(&ok);
- if (ok)
- // frequency = num;
- qDebug() << "frequency is" << iioDevice.frequency;
- } else if (attributeName.endsWith("raw")) {
+ if (ok) {
+ qDebug() << sensorName + ":" << "Frequency is" << iioDevice.frequency;
+ }
+ } else if (attributeName.contains(QRegularExpression(iioDevice.channelTypeName + ".*raw$"))) {
qDebug() << "adding to paths:" << iioDevice.devicePath
<< attributeName << iioDevice.index;
addPath(iioDevice.devicePath + attributeName, j);
j++;
}
}
+ iioDevice.channels = j;
// in_rot_from_north_magnetic_tilt_comp_raw ?
@@ -263,7 +301,7 @@
if (enable == 1) {
// FIXME: should enable sensors for this device? Assuming enabled already
- iioDevice.channels = scanElementsEnable(device, enable);
+ scanElementsEnable(device, enable);
sysfsWriteInt(pathLength, IIO_BUFFER_LEN);
sysfsWriteInt(pathEnable, enable);
} else {
@@ -339,7 +377,7 @@
// Find all the *_en file and write 0/1 to it
QStringList filters;
- filters << "*_en";
+ filters << ("*" + iioDevice.channelTypeName + "*_en");
dir.setNameFilters(filters);
QFileInfoList list = dir.entryInfoList();
@@ -416,6 +454,18 @@
uData = alsBuffer_->nextSlot();
uData->value_ = (result + iioDevice.offset) * iioDevice.scale;
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-hal-0.11.4.tar.bz2/adaptors/iioadaptor/iioadaptor.h
^
|
@@ -55,7 +55,8 @@
IIO_MAGNETOMETER, // magn_3d
IIO_ROTATION, // dev_rotation, quaternion
IIO_ALS, // als
- IIO_TILT // incli_3d
+ IIO_TILT, // incli_3d
+ IIO_PROXIMITY // proximity als
};
struct iio_device {
@@ -68,6 +69,7 @@
QString devicePath;
int index;
IioSensorType sensorType;
+ QString channelTypeName;
};
public:
@@ -129,9 +131,12 @@
// Device number for the sensor (-1 if not found)
int devNodeNumber;
+ int proximityThreshold;
+
DeviceAdaptorRingBuffer<TimedXyzData>* iioXyzBuffer_;
DeviceAdaptorRingBuffer<TimedUnsigned>* alsBuffer_;
DeviceAdaptorRingBuffer<CalibratedMagneticFieldData>* magnetometerBuffer_;
+ DeviceAdaptorRingBuffer<ProximityData>* proximityBuffer_;
iio_device iioDevice;
@@ -140,6 +145,7 @@
TimedXyzData* timedData;
CalibratedMagneticFieldData *calData;
TimedUnsigned *uData;
+ ProximityData *proximityData;
private slots:
void setup();
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-hal-0.11.4.tar.bz2/adaptors/iioadaptor/iioadaptor.pro
^
|
@@ -1,5 +1,4 @@
-TARGET = iioaccelerometeradaptor
-#TARGET = iiosensorsadaptor
+TARGET = iiosensorsadaptor
HEADERS += iioadaptor.h \
iioadaptorplugin.h
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-hal-0.11.4.tar.bz2/adaptors/iioadaptor/iioadaptorplugin.cpp
^
|
@@ -36,6 +36,7 @@
sm.registerDeviceAdaptor<IioAdaptor>("gyroscopeadaptor");
sm.registerDeviceAdaptor<IioAdaptor>("magnetometeradaptor");
sm.registerDeviceAdaptor<IioAdaptor>("alsadaptor");
+ sm.registerDeviceAdaptor<IioAdaptor>("proximityadaptor");
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-hal-0.11.4.tar.bz2/core/hybrisadaptor.cpp
^
|
@@ -354,8 +354,6 @@
m_sensorState[i].m_maxDelay = maxDelay;
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_sensorState[i].m_delay,
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-hal-0.11.4.tar.bz2/debian/changelog
^
|
@@ -1,3 +1,9 @@
+sensorfw-qt5 (0.11.1) unstable; urgency=medium
+
+ * [packaging] Add missing debian build dependencies. Fixes MER#2060
+
+ -- Simo Piiroinen <simo.piiroinen@jollamobile.com> Mon, 07 Oct 2019 15:28:35 +0300
+
sensorfw-qt5 (0.7.4) unstable; urgency=medium
* add lid sensor
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-hal-0.11.4.tar.bz2/debian/control
^
|
@@ -3,7 +3,16 @@
Priority: optional
Maintainer: Lorn Potter <lorn.potter@gmail.com>
Uploaders:
-Build-Depends: debhelper (>=5), qt5-default, libudev-dev
+Build-Depends: debhelper (>=5),
+ qt5-default,
+ libudev-dev,
+ libsystemd-dev,
+ doxygen,
+ graphviz,
+ pkg-config,
+ libhardware-dev,
+ android-headers,
+ libhybris-dev
Standards-Version: 3.7.3
Package: sensorfw-qt5
@@ -55,7 +64,7 @@
Section: misc
Priority: extra
Architecture: any
-Depends: sensorfw-qt5 (= ${binary:Version}), libqt5core5a, android-headers, libhardware2
+Depends: sensorfw-qt5 (= ${binary:Version}), libqt5core5a, libhardware2
Description: Sensor framework hybris support
Provides support for hybris Sensor framework backend.
@@ -63,6 +72,6 @@
Section: misc
Priority: extra
Architecture: any
-Depends: sensorfw-qt5 (= ${binary:Version}), libqt5core5a, android-headers, libhardware2
+Depends: sensorfw-qt5 (= ${binary:Version}), libqt5core5a, libhardware2
Description: Sensor framework hybris support
Provides support for hybris Sensor framework backend.
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-hal-0.11.4.tar.bz2/sensord-qt5.pc
^
|
@@ -4,7 +4,7 @@
Name: Sensorfw-qt5
Description: Sensord for Qt 5
-Version: 0.7.2.1
+Version: 0.11.3
Requires:
Libs: -L${libdir} -lsensorclient-qt5 -lsensordatatypes-qt5
Cflags: -I${includedir} -I${includedir}/datatypes -I${includedir}/filters
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-hal-0.11.4.tar.bz2/sensord.pc
^
|
@@ -4,7 +4,7 @@
Name: Sensorfw
Description: Sensorfw
-Version: 0.7.2.1
+Version: 0.11.3
Requires:
Libs: -L${libdir} -lsensorclient -lsensordatatypes
Cflags: -I${includedir} -I${includedir}/datatypes -I${includedir}/filters
|
[-]
[+]
|
Changed |
_service:tar_git:hybris-libsensorfw-qt5-hal-0.11.4.tar.bz2/sensorfw.pro
^
|
@@ -81,13 +81,13 @@
equals(QT_MAJOR_VERSION, 4):{
PKGCONFIGFILES.files = sensord.pc
- PKGCONFIGFILES.commands = 'sed -i "s/Version:.*/Version: $$PC_VERSION/" sensord.pc'
+ PKGCONFIGFILES.commands = 'sed -i "s/Version:.*/Version: $$PC_VERSION/" $$_PRO_FILE_PWD_/sensord.pc'
QTCONFIGFILES.path = /usr/share/qt4/mkspecs/features
}
equals(QT_MAJOR_VERSION, 5):{
PKGCONFIGFILES.files = sensord-qt5.pc
- PKGCONFIGFILES.commands = 'sed -i "s/Version:.*/Version: $$PC_VERSION/" sensord-qt5.pc'
+ PKGCONFIGFILES.commands = 'sed -i "s/Version:.*/Version: $$PC_VERSION/" $$_PRO_FILE_PWD_/sensord-qt5.pc'
QTCONFIGFILES.path = /usr/share/qt5/mkspecs/features
}
|