Ompower

From Openmoko

Revision as of 08:38, 18 September 2008 by Beni (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ompower is a suspend handling daemon talking dbus installed by default since Om 2008.8. It is responsible for triggering or aborting suspension of your phone. Applications send dbus messages which are evaluated by ompower. This may be used, for example, to abort suspending the phone while doing GPS tracking.

How does it work?

If an application wants to tell the phone that it should not suspend, it should send a dbus message. This message could be send by dbus API. In case of a shell script, sending dbus messages could be achieved by the command dbus-send:

dbus-send --system --dest=org.openmoko.Power / org.openmoko.Power.Core.RequestResourceState? \
string:cpu string:my-system-name string:on

If the application then is in a state it could be suspendet, it should send:

dbus-send --system --dest=org.openmoko.Power / org.openmoko.Power.Core.RemoveRequestedResourceState? \
string:cpu string:my-system-name 

"my-system-name" is an identifier telling dbus the requesting source. In case of tangogps, this could be "application-tangogps".

ompower will not trigger suspend (via calling apm -s) until all requests for resources are removed.


Ticket

For further reading see Ticket #2008 (Do not suspend when certain apps are running). That ticket was the reason for writing this article.


Source

You can fetch the source here: http://svn.openmoko.org/developers/raster/ompower/

Personal tools

ompower is a suspend handling daemon talking dbus installed by default since Om 2008.8. It is responsible for triggering or aborting suspension of your phone. Applications send dbus messages which are evaluated by ompower. This may be used, for example, to abort suspending the phone while doing GPS tracking.

How does it work?

If an application wants to tell the phone that it should not suspend, it should send a dbus message. This message could be send by dbus API. In case of a shell script, sending dbus messages could be achieved by the command dbus-send:

dbus-send --system --dest=org.openmoko.Power / org.openmoko.Power.Core.RequestResourceState? \
string:cpu string:my-system-name string:on

If the application then is in a state it could be suspendet, it should send:

dbus-send --system --dest=org.openmoko.Power / org.openmoko.Power.Core.RemoveRequestedResourceState? \
string:cpu string:my-system-name 

"my-system-name" is an identifier telling dbus the requesting source. In case of tangogps, this could be "application-tangogps".

ompower will not trigger suspend (via calling apm -s) until all requests for resources are removed.


Ticket

For further reading see Ticket #2008 (Do not suspend when certain apps are running). That ticket was the reason for writing this article.


Source

You can fetch the source here: http://svn.openmoko.org/developers/raster/ompower/