Application:LEDService

From WebOS Internals
Jump to navigation Jump to search

Summary

This service provides access to the LED's brightness settings. As of webOS 1.1.0, is not accessible from application development. With this service, it can be accessed by an application.

This service has three methods which are exposed to the user, along with three opposite methods.

setBrightnessLeftLED(int value)
allows you to set the brightness of the Left LED in the gesture area.
setBrightnessCenterLED(int value)
allows you to set the brightness of the Center LED in the gesture area.
setBrightnessRightLED(int value)
allows you to set the brightness of the Right LED in the gesture area.

Then:

getBrightnessLeftLED
allows you to get the current integer valued brightness of the Left LED in the gesture area.
getBrightnessCenterLED
allows you to get the current integer valued brightness of the Right LED in the gesture area.
getBrightnessRightLED
allows you to get the current integer valued brightness of the Center LED in the gesture area.

Status

This is early-alpha software.

License

Please be aware that org.webosinternals.ledserivce is licensed under the GPLv2.

It cannot be used by a closed source application. If you want to use it in a non-GPLv2 but otherwise open source application, please contact the authors.

Installation

Do not stray from or vary these instructions. If you don't do it all, in precisely the right order, with zero mistakes, it's not going to work. Copy & Paste will be your friend.

You need to be logged in as root with a writeable filesystem. Instructions for both those things can be found elsewhere on this wiki.

The first time you install LEDService you must do all these steps:

<source lang="text"> mkdir -p /var/etc/ipkg/ ln -s /etc/ipkg/arch.conf /var/etc/ipkg/ echo "src/gz all http://ipkg.preware.org/feeds/preware/all" > /var/etc/ipkg/preware.conf </source>

  • If you are on the Pre, type:

<source lang="text"> echo "src/gz armv7 http://ipkg.preware.org/feeds/preware/armv7" >> /var/etc/ipkg/preware.conf </source>

  • If you are on the Emulator, type:

<source lang="text"> echo "src/gz i686 http://ipkg.preware.org/feeds/preware/i686" >> /var/etc/ipkg/preware.conf </source>

Then type:

<source lang="text"> /usr/bin/ipkg -o /var update /usr/bin/ipkg -o /var install org.webosinternals.ledservice /bin/sh /var/usr/lib/ipkg/info/org.webosinternals.ledservice.postinst </source>

Then restart the GUI service to pick up the new service:

<source lang="text"> initctl stop LunaSysMgr && initctl start LunaSysMgr </source>

If the above fails to show the results you're expecting, reboot the device.

Updating

After your first install, only the following is required to upgrade to a new version.

You need to be logged in as root with a writeable filesystem. Instructions for both those things can be found elsewhere on this wiki.

From a shell:

<source lang="text"> /usr/bin/ipkg -o /var update /usr/bin/ipkg -o /var upgrade reboot </source>

Other PreWare Applications

You need to be logged in as root with a writeable filesystem. Instructions for both those things can be found elsewhere on this wiki.

Note that you can use the same commands to install other applications from PreWare:

<source lang="text"> /usr/bin/ipkg -o /var update /usr/bin/ipkg -o /var list /usr/bin/ipkg -o /var install <package> # choose a package from the list /usr/bin/ipkg -o /var remove <package> </source>

Removal

You need to be logged in as root with a writeable filesystem. Instructions for both those things can be found elsewhere on this wiki.

<source lang="text"> /usr/bin/ipkg -o /var remove org.webosinternals.ledservice </source>

Then restart the GUI service:

<source lang="text"> initctl stop LunaSysMgr && initctl start LunaSysMgr </source>

If the above fails to show the results you're expecting, reboot the device. }}