40 Commits

Author SHA1 Message Date
Raymond Hackley
a0ff1fe4b0 light: Add support for "illuminance_clear" light sensors
That would be used in the cm36651 kernel driver, as well as devices with
multiple channels, such as combined proximity and light sensors, which use
"illuminance_clear" as the channel name.
2023-11-21 18:17:43 +01:00
Bastien Nocera
63a84af6a2 data: Add polkit policy description
Describe and set defaults for claiming sensors.
2021-09-29 11:54:26 +02:00
Max Leiter
630b461149 light: test for in_intensity_clear_{raw,input} property
Allows detection of RGBC sensing devices such as the apds9960 by checking for
the in_intensity_clear_ property, which reports the unprocessed lux value for the ALS photodiode.
More information on the field can be found in the kernel iio docs:
https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-iio.

Tested on a MSHW1084, which is compatible with te apds9960. The apsd9960
reference can be found here: https://docs.broadcom.com/doc/AV02-4191EN.
2020-12-11 02:20:43 -08:00
Bastien Nocera
af2f3a1055 build: Install daemon in libexecdir
Rather than sbindir, which would have meant it could be in the PATH.
2020-06-27 14:02:32 +02:00
Bastien Nocera
27db244d97 build: Remove autotools build 2020-06-26 18:20:16 +02:00
Bastien Nocera
cf1ac31f55 build: Add meson build system files 2020-06-26 18:16:42 +02:00
Guido Günther
fcf951b3bc data: Don't overwrite IIO_SENSOR_PROXY_TYPE
Don't overwrite an already set type for light and ambient to support
multi channel sensors.

This reverts commit 5ef75b57a988a8a6acc2611cde760f28fc7b48d6.
2020-03-04 09:41:44 +00:00
Guido Günther
1a9489afb6 data: Detect proximity sensors 2020-03-04 09:39:50 +00:00
Bastien Nocera
4dda433e92 light: Add support for "illuminance0" light sensors
That would be used in the tsl2772 and lm3533 kernel drivers, as well as
devices with multiple channels, such as combined proximity and light
sensors, which use "illuminance0" as the channel name instead of
"illuminance".

Closes: #290
2020-01-09 16:14:02 +01:00
Guido Günther
eb8fde8fd2 light: Support sensors using raw values as well
E.g. the vcnl4000 class devices reports a raw value and a scale
to calculate lux.
2020-01-06 17:42:02 +01:00
Bastien Nocera
f4cd8e803b data: Make filesystem access strict
We don't need write access to /etc, so block it.
2018-05-04 16:11:07 +02:00
Bastien Nocera
9d8861b2be build: Fix distcheck in data/
Commit 2a2f5c5 broke distcheck, as it did not add the input file
net.hadess.SensorProxy.conf.in to the tarball.
2017-11-02 19:17:32 +01:00
Frederic Crozat
2a2f5c5c3b data: fix permissions when geoclue runs with a different user (#185)
Geoclue can be configured to use another user than geoclue.
2017-09-22 13:31:44 +02:00
Bastien Nocera
078dc862a0 data: Fix daemon not receiving udev events
Disable PrivateNetwork lockdown so we can get access to uevents that
tell us whether sensors got removed or added, but allow enough
networking for udev to work correctly.

Fixes the regression introduced in 45f9a638.
2017-02-15 15:49:30 +01:00
Simon McVittie
e2d81f2141 security: Make D-Bus policy rules only affect SensorProxy itself
D-Bus policy XML files are generic configuration for the bus daemon:
they are conventionally named like a bus name, but there is nothing
that inherently limits their application to that bus name.

In particular this means that a rule like

  <policy context="default">
    <allow send_interface="org.freedesktop.DBus.Properties"/>

allows any process on the system bus to send an
org.freedesktop.DBus.Properties.Set() call to any other process on the
system bus, even if the destination process expected to be only
accessible by root.

Closes: #41
2017-02-02 16:12:52 +01:00
Bastien Nocera
45f9a63885 data: Lockdown systemd service
As detailed in systemd.exec(5).
2017-01-05 13:06:37 +01:00
Bastien Nocera
19ec07affa data: Fix compass property name
In commit 924dd58, we changed from matching the device names to a more
generic property match. But we matched on the "iio-buffer-compass"
property instead of the one actually set in the udev rules
("iio-compass").

Change the udev rules property name to "iio-buffer-compass" so that
rules and code match.

This fixes iio-sensor-proxy startup on HP Pavilion x360.

Spotted by Ted Ying <yingted@gmail.com>

Closes: #128
2016-12-28 11:23:10 +01:00
Bastien Nocera
297bce8cba data: Also apply property when the device changes
This means that "udevadm trigger ..." won't lose that data, making
it easier to test device properties like the mount-matrix.
2016-12-10 16:52:07 +01:00
Bastien Nocera
f7be8bba37 data: Don't start iio-sensor-proxy for devices we don't handle
For every type of device we support, tag the device with an
IIO_SENSOR_PROXY_TYPE property which the drivers can use to filter the
type of driver it will use.

This also means that hwmon temperature sensors, unsupported IIO sensors,
etc. don't start iio-sensor-proxy, and iio-sensor-proxy doesn't appear
in the udev output for that device (which lead to folks thinking their
hardware had light sensors or an accelerometer, which it didn't).
2016-11-23 15:14:40 +01:00
Bastien Nocera
ba9a803628 data, main: Move debug envvar to service file
To make it easier to debug iio-sensor-proxy
without recompiling.
2016-11-22 14:19:12 +01:00
Bastien Nocera
cc9e5c0754 data: Fix .rules file description
We're not an iio to input proxy anymore.
2016-04-25 12:17:44 +02:00
Bastien Nocera
51b35aa301 data: Run udev rules later
40-* is too early to have some of the tags added to devices we want to
use. For example, input accelerometers wouldn't be tagged for
iio-sensor-proxy usage, as the tagging would be done in 50-*.

80 seems to be a good priority.

Closes #71
2016-04-20 18:16:09 +02:00
Bastien Nocera
d7ada809b9 data: Style fix in rules file 2016-04-20 18:13:16 +02:00
Bastien Nocera
37d39a3347 data: Update D-Bus configuration again
This fixes introspection not working for normal users on the interface
that's available to every user.
2015-06-08 15:08:35 +02:00
Bastien Nocera
1fb9a3561f data: Allow users to introspect the main interface 2015-06-03 13:55:44 +01:00
Bastien Nocera
53436ac990 main: Limit access to compass to Geoclue
Only geoclue can now access the Compass information, as we've moved it
to a separate object path and interface name.

Closes #29
2015-06-03 13:45:40 +01:00
Bastien Nocera
abf48d015d rules: Make hwmon light sensor support more generic
Even if it's used in MacBooks, hwmon compatible sensors also exist on
other laptops, such as some Samsung laptops. Make sure we can support
those too.
2015-05-24 16:22:34 +02:00
Bastien Nocera
5436d07fb0 rules: Add missing systemd TAG to autostart daemon
The daemon wasn't starting on, at least, MacBooks because the systemd
tag was missing, not starting the systemd iio-sensor-proxy.service unit.

Closes #25
2015-05-24 16:20:58 +02:00
Cristian Rodríguez
3be00360be rules: Don't override SYSTEMD_WANTS
Something else might need it too
2015-05-24 15:28:52 +02:00
Cristian Rodríguez
ea1801cea6 rules: Fix ACTION equality check
ACTION=add --> ACTION==add
2015-05-24 15:28:01 +02:00
Bastien Nocera
3eb4ecc139 build: Install D-Bus config file in $(sysconfdir)
Rather than hard-coding /etc
2015-05-22 16:16:20 +02:00
Bastien Nocera
853371b9b1 build: Add --with-systemdsystemunitdir configure option 2015-05-22 16:16:20 +02:00
Bastien Nocera
6bd7e248ab data: Add --with-udevrulesdir configure option 2015-05-22 16:16:20 +02:00
Bastien Nocera
2b24dfde61 build: Fix distcheck (somewhat)
The systemd files still aren't installable inside the prefix.
2015-05-21 12:07:00 +02:00
Bastien Nocera
84401a0e0f docs: Add gtk-doc documentation
Closes #8
2015-05-20 10:13:04 +02:00
Bastien Nocera
97b0c0a075 rules: Auto-start iio-sensor-proxy for Apple SMC light sensors 2015-03-19 16:11:57 +01:00
Bastien Nocera
4b873a049b rules: Auto-start iio-sensor-proxy for input accels too 2015-03-05 16:05:11 +01:00
Bastien Nocera
fd4b7f7d65 main: Use D-Bus instead of uinput
Instead of exporting the orientation state using a combination of
uinput and udev, use D-Bus.
2015-03-05 10:47:07 +01:00
Bastien Nocera
348fc043e6 data: Correct path to binary in service file 2014-11-20 05:39:51 +01:00
Bastien Nocera
07897adea3 build: Autotoolify 2014-11-19 17:03:45 +01:00