Next: , Previous: Scripts, Up: Top


11 Powersave DBus specification

Namespace: com.novell.powersave

11.1 com.novell.powersave Interface

11.1.1 Events triggerd by the Powersave Daemon

Acpi events from /proc/acpi/events

0 string (e.g. "button_power")

Powersave events

0 string ("battery_low")

Possible events:

Daemon or script progress (e.g. 'unloading modules 40%)

Return types:

Simple messages, error messages or notifications

0 string (e.g. "Unable to unload module.")

D-BUS Example:

signal sender=:1.5 -> dest=(null destination) interface=com.novell.powersave; member=acpi_event 0 string "button.power"

When an event occurs the clients may want to use the Request interface to reread specific values (e.g. request "rem_charg_time_battery" after a event "battery.info", or request "schemes" after a event "daemon.scheme.changed"

11.2 IV. Client Requests (Client -(request)-> Daemon -(response)-> Client)

-> All requests do not have any parameters.

Get all Powersave schemes

Return types:

Get a specific scheme description

Param:

Return types:

11.3 Daemon Actions (Client -(action)-> Daemon)

Check whether daemon is up and replies

Set machine into suspend to disk mode

Set machine into suspend to ram mode

Set machine into standby mode

Enabled a single CPU

Param:

Disable a single CPU

Param:

Set a powersave scheme

Param:

Notify connected clients of any progress going on

11.4 Return Messages

All calls to the bus get a return/error message replied.

Return messages include following types:

The error ids can be found in powerlib.h as defines.

11.4.1 If no error occured the return message includes (normal message):

If an error happens the message will be an error reply (as specified by dbus). Following errors can be checked for all method calls/signals:

General Error

No connection Error (The daemon is probably not running)

No rights Error (The client is not allowed to speak with the daemon)

Invalid Paramet (The client sent bullshit)

Following request/actions may return specialised errors:

11.4.2 Specialised Error Replies

Following errors may occur on some actions/requests and must be checked by the client if such a action/request is made:

  1. Not supported (by HW):

    Interface: com.novell.powersave

  2. Already set
  3. Does not exist

    Interface: com.novell.powersave