Multiple light sensors
Richard Hughes
hughsient at gmail.com
Thu Sep 28 11:42:37 PDT 2006
After looking at the code in:
http://gitweb.freedesktop.org/?p=hal.git;a=blob;hb=HEAD;f=hald/linux/addons/addon-macbookpro-backlight.c
http://gitweb.freedesktop.org/?p=hal.git;a=blob;hb=HEAD;f=examples/light_sensors_and_keyboard_backlight.py
I see that the GetBrightness comes back from HAL as a "ai" value, i.e.
an array of signed integers.
org.freedesktop.Hal.Device.LightSensor.GetBrightness should probably
only return with a single percentage value like the other providers of
GetBrightness.
I think if a machine has multiple light sensors then they should be
exposed as separate "devices" rather than use light_sensor.num_sensors
and pretend it's a single device.
I'm currently adding support into g-p-m for light sensors, and having to
have two different code paths for get_brightness (depending on device
type) seems very clunky to me, and not at all abstract.
Comments? Flames?
Richard.
More information about the hal
mailing list