Multiple light sensors

David Zeuthen david at fubar.dk
Thu Sep 28 15:58:45 PDT 2006


On Thu, 2006-09-28 at 19:42 +0100, Richard Hughes wrote:
> 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.

It's on a different interface so it's fine.

> 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.

No, I think it's fine as it is... because if we did what you're
proposing we'd be having N times the amount of calls when polling the
ambient light level.

     David




More information about the hal mailing list