Le 06/08/2013 10:47, Jonas Sicking a écrit : > On Aug 6, 2013 12:54 AM, "Jordano Francisco (UK)" < > francisco.jord...@telefonica.com> wrote: >> >> Hi all, >> >> >> On 06/08/2013 07:43, "Jonas Sicking" <jo...@sicking.cc> wrote: >> >>> On Aug 5, 2013 11:07 PM, "Karim Geiger" <gei...@b1-systems.de> wrote: >>>> >>>> On 08/05/2013 07:26 PM, Jonas Sicking wrote: >>>>> No. Do we need any? >>>> >>>> I think that's an important point. There are some cases you want to >>>> control the LED separately. >>> >>> I think we need a bit more detail than that in order to spend time on > this >>> :-) >>> >>> / Jonas >> >> Typical use case for this api could be notifications, like FB >> notifications in android, >> use this API to setup the led blue. >> >> Other use cases (in samsung android phones): >> >> Red when plugged in - Charging >> Green when plugged in - Charging complete. >> Red when not plugged in - Low battery warning >> Blue - Audio is recording or you have a notification waiting. > > Is the LED usually in control of system level logic, or is it more commonly > handled by drivers? > > I.e. would we be able to implement a LED API on most platforms?
On a kernel level they appear to be part of the 'leds' class. For example, on Inari, you have: # ls -l /sys/class/leds/ lrwxrwxrwx root root 2013-08-06 10:45 button-backlight -> ../../devices/platform/leds-gpio/leds/button-backlight lrwxrwxrwx root root 2013-08-06 10:45 green -> ../../devices/platform/pmic-leds/leds/green lrwxrwxrwx root root 2013-08-06 10:45 lcd-backlight -> ../../devices/platform/msm_fb.524801/leds/lcd-backlight lrwxrwxrwx root root 2013-08-06 10:45 red -> ../../devices/platform/pmic-leds/leds/red If you echo 1 to /sys/class/leds/green/brightness and to /sys/class/leds/red/brightness, you get an orange led notification on Inari :) Cross checking, I get similar behavior on Desire Z running Android 2.3.3. > > Either way, implementing an API which is exposed to only the system app > sounds like it would make sense. Though we would likely need the API to > expose which colors the hardware is able to support. > > / Jonas > _______________________________________________ > dev-b2g mailing list > dev-b2g@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-b2g > _______________________________________________ dev-b2g mailing list dev-b2g@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-b2g