- 15 Jan, 2019 2 commits
-
-
spiiroin authored
-
- 11 Jan, 2019 1 commit
-
-
Tomi Leppänen authored
Rename sensorfw-qt subpackage docs to doc and make packaging information more consistent with other packages. Signed-off-by:
Tomi Leppänen <tomi.leppanen@jolla.com>
-
- 08 Nov, 2018 2 commits
-
-
spiiroin authored
-
- 07 Nov, 2018 1 commit
-
-
spiiroin authored
Sensorfwd crashes on exit in h3113 devices (Xperia XA2). This happens because of Config class related symbol name clash between sensorfwd and android dynamic loader / libhybris: Destructor from sensorfwd code base ends up used for cleaning up libhybris objects - which then leads to segfault. As runtime loader is what it is, rename "Config" class in sensorfwd to less generic "SensorFrameworkConfig". Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 01 Oct, 2018 6 commits
-
-
spiiroin authored
-
spiiroin authored
It seems that in later android header versions sensor type values have been changed from #define constants into enumeration values. And while previously SENSOR_TYPE_MAGNETIC_FIELD was alias for SENSOR_TYPE_GEOMAGNETIC_FIELD, now it is the other way around. Which then has the net effect of: Attempt to provide fallback value for SENSOR_TYPE_MAGNETIC_FIELD with symbolic name results in compilation failures. Use hard-coded fallback values for both SENSOR_TYPE_GEOMAGNETIC_FIELD and SENSOR_TYPE_MAGNETIC_FIELD to break dependency on what types android header considers to be aliases vs not. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
-
spiiroin authored
Sensor maximum delay is available from sensors device API version 1.3 onwards. If development headers are too ancient, trying to access maxDelay member in sensor_t structure causes compilation failures. Use fallback value for maxDelay unless both development headers and sensors device exposed via hal indicate that sensors device API version 1.3 features are available. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 28 Sep, 2018 5 commits
-
-
spiiroin authored
-
spiiroin authored
The code can't be compiled for devices that use older android hal versions that do not define all sensor types referred to in the code. Provide values for all sensor types that are not defined in the android header files. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
-
- 27 Sep, 2018 3 commits
-
-
spiiroin authored
It is possible that on-change type sensors are not reported by android hal until a change is actually detected. Sensorfwd is left using zero initialized default values like proximity=covered / light=darkness - which in turn can cause various issues after each bootup. As the initial state can't be queried, choose the lest harmful option and define fallback values during sensor hal probing: - proximity sensor = not covered - light sensor = 400 lux If no actual sensor data has been received in a situation where sensor state needs to be communicated to clients, apply the fallback value. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Sensor specific adaptors derived from HybrisAdaptor class can be configured to enable/disable sensors directly via sysfs. While doing that they also bypass enable/disable policy that is implemented in HybrisAdaptor. Fix each HybrisXxxAdaptor class so that common policy logic is executed first, and direct sysfs manipulation is done based on policy decision. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Whether sensors should be started or stopped depends on a number of state variables. Using case specific conditionals at places where state variables might change makes the code fragile and hard to maintain. Separate sensor hal operations more clearly from logic and forms dictated by sensorfwd conventions. Use m_memberName naming convention for member variables, make all member data private and usable only via accessor functions. Use a single sensor start/stop policy evaluation function and call it from each place where relevant state variables might change. Use sensorfwd specific logging functions instead of qDebug etc. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 26 Sep, 2018 1 commit
-
-
spiiroin authored
Use variadic macros to allow calls like: sensordLogT("foo=%d", bar); Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 27 Jun, 2018 2 commits
-
-
spiiroin authored
-
- 26 Jun, 2018 2 commits
-
-
spiiroin authored
Hiding sensors that might be functioning / in use in already supported devices by default easily causes regression unless device specific configuration files are also updated. As false positives should cause only cosmetic issues, do not hide magnetometer, pressure, and rotation sensors by default. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
There was a typo in the file name and the name itself does not match the intent of having defaults packaged with sensorfwd as: 20-sensor-default.conf And having device specific overrides derived from 60-sensors-DEVICE.conf installed from hw adaptation specific package as something like: 60-sensor-f5121.conf Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 19 Jun, 2018 4 commits
-
-
spiiroin authored
-
spiiroin authored
The min/max sensor delays reported by android sensor hal are used without appropriate unit conversion. This causes acceptable interval range calculation to misfire, and sampling interval requests get rejected and do not reach relevant sensor adaptors and in some devices some sensors are never started due to undefined sampling rate. Android sensor hal reports min/max delays using microsecond units. Convert the values into milliseconds expected by sensorfwd logic. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
When compass chain uses android sensor hal, the stand-by override and interval property handling is left unbound. This means sampling interval requests made by client sw are not forwarded from compass chain to android orientation sensor adaptor - and in some devices this means that the sensor is never started. When using android orientation sensor for compass data, bind stand-by override and sampling interval properties to orientation sensor. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 01 Jun, 2018 2 commits
-
-
spiiroin authored
-
- 29 May, 2018 4 commits
-
-
spiiroin authored
Classes that inherit NodeBase should provide actual implementation for sensor specific setter/getter methods. To ease debugging make it visible when/if the default virtual stub methods get called. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
An attempt is made to start/stop android sensor hal event reader during runtime based on whether at least one sensor is activated via hal or not - this which is a bit useless to start with (the thread would just block while all sensors are deactivated), the stopping does not actually work - which causes segfault during cleanup if orderly exit is attempted. Use posix thread API instead of QThread as it gives more fine grained control over asynchronous cancellation and posix signal blocking. Start thread on sensord startup, cancel it when sensord is exiting. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Sensord does async signal unsafe operations from posix signal handlers. Use pipe and QSocketNotifier() to transfer async signals from signal handler context to qt mainloop. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Allow disabling / enabling sensors plugins via config entries like: [available] proximitysensor=True magnetometersensor=False lidsensor=Feature_CoverSensor orientationsensor=Feature_GyroSensor|Feature_AccelerationSensor Where: - "True" means that loading of the sensor plugin is made available via D-Bus interface and can be loaded. - "False" means the plugin will not be loaded and sensor is not made available via D-Bus - "Feature_*" means that sensor availability is checked from hw settings. If sensorfwd is compiled without ssu-sysinfo support these will be treated similarly to "True". - "" (or plugin that does not have config entry) is taken as "True", but a warning is logged in case of sensor plugins. If a plugin that is enabled in configuration fails to load, it is marked as not available until sensorfwd restart. Add new D-Bus method calls: - availablePlugins() lists all available plugins - availableSensorPlugins() lists available sensor plugins (which, when loaded, make new sensor objects and interfaces available) - pluginAvailable(name) can be used to check whether a named plugin is installed and available Package default sensor availability configuration file that disables all sensors except those that can be evaluated based on the hw settings configuration. Add example of device specific configuration file - these should be installed from hw adaptation packages and can override the defaults. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 24 May, 2018 5 commits
-
-
spiiroin authored
Each configuration file is kept in separate QSettings object and lookup for values is done in load order - which is reverse from convention where 10-something.conf can be overridden with 20-something-else.conf. Change evaluation so that latter files can override earlier ones under assumption that so far there have been no devices that would actually employ more than one config.d file and thus glitches are unlikely. Also merge data from all settings files into a single QSettings object i.e. trade a bit more complex startup for simpler lookups during runtime. The primary config file, if specified, still overrides any settings made from config.d files. Rename 90-sensord-default.conf to 10-sensord-default.conf so that it still is 10 points up from the minimum priority. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
While there are functions for "test" and "debug" level logging, both of these are compressed to QtDebugMsg type. Use QtInfoMsg type for "debug" logging and utilize a mapping function to make the QtMsgType values applicable for numerical comparing. Also drop sensordLog() macro that is just an alias for sensordLogD(). Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
If scratchbox target has development packages required for building hybris plugin packages, building of the main sensorfwd package fails because unwanted files get copied under RPM BUILDROOT directory. Apparently this happens because unconditionally executed build time hybris availability check needed for Debian builds misfires. Make execution of qtCompileTest(hybris) conditional and trigger it only when making a Debian build. Note: While this does fix the RPM build problems, I have no means to verify whether Debian builds still work as expected. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Making generated files not show up in git status can create hard to spot issues while doing local rebuilds. Also what should be hidden is a matter of taste, and having .gitignore that resides in master repo just makes it more difficult to tweak the ignores. Drop .gitignore from repository. Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com
-