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
- Interface: com.novell.powersave
- Member : "AcpiEvent"
- Type : Signal
0 string (e.g. "button_power")
Powersave events
- Interface: com.novell.powersave
- Member : "PowersaveEvent"
- Type : Signal
0 string ("battery_low")
Possible events:
- "acadapter.offline"
- "acadapter.online"
- "button.sleep"
- "button.power"
- "button.lid.open"
- "button.lid.closed"
- "temperature.ok"
- "temperature.active"
- "temperature.passive"
- "temperature.hot"
- "temperature.critical"
- "battery.normal"
- "battery.warning"
- "battery.low"
- "battery.critical"
- "battery.info" (something changed -> remaining percent/time should be reread)
- "global.suspend2disk" (daemon has been asked to suspend and will do so now)
- "global.suspend2ram"
- "global.standby"
- "global.resume.suspend2disk" (we are back from suspend)
- "global.resume.suspend2ram"
- "global.resume.standby"
- "daemon.start"
- "daemon.terminate"
- "daemon.scheme.change" (scheme has been switched -> reread schemes or other info that could have changed)
- "other" (Not sure now)
Daemon or script progress (e.g. 'unloading modules 40%)
- Interface: com.novell.powersave
- Member : "Progress"
- Type : Signal
Return types:
- 0 string : Progress description (e.g. "unloading modules...")
- 1 int32 : Progress (e.g. "10")
Simple messages, error messages or notifications
- Interface: com.novell.powersave
- Member : "Notification"
- Type : Signal
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
- Interface: com.novell.powersave
- Member : "SchemesGet"
- Type : Method call with return
Return types:
- 0 string : array containing all available schemes
- 1 uint8_t: index of current active scheme (use order of sent string array)
- 2 uint8_t: index of battery scheme (use order of sent string array)
- 3 uint8_t: index of AC scheme (use order of sent string array)
Get a specific scheme description
- Interface: com.novell.powersave
- Member : "SchemesGetDescription"
- Type : Method call with return
Param:
- 0 string : string has to match a scheme name.
Return types:
- 0 string : the requested scheme description
11.3 Daemon Actions (Client -(action)-> Daemon)
Check whether daemon is up and replies
- Interface: com.novell.powersave
- Member : "Ping"
- Type : Method call with return
Set machine into suspend to disk mode
- Interface: com.novell.powersave
- Member : "SuspendToDisk"
- Type : Method call with return
Set machine into suspend to ram mode
- Interface: com.novell.powersave
- Member : "SuspendToRam"
- Type : Method call with return
Set machine into standby mode
- Interface: com.novell.powersave
- Member : "Standby"
- Type : Method call with return
Enabled a single CPU
- Interface: com.novell.powersave
- Member : "CpufreqCPUEnable"
- Type : Method call with return
Param:
- 0 int : the CPU number to enable starting from 0
Disable a single CPU
- Interface: com.novell.powersave
- Member : "CpufreqCPUDisable"
- Type : Method call with return
Param:
- 0 int : the CPU number to disable starting from 0.
CPU 0 can't be disabled ATM because it runs the
main timer
Set a powersave scheme
- Interface: com.novell.powersave
- Member : "SchemesSet"
- Type : Method call with return
Param:
- 0 string : string has to match a scheme name. scheme names can be requested (see above)
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:
- 0 uint_16 : Error ID
- 0 string : Error message
The error ids can be found in powerlib.h as defines.
11.4.1 If no error occured the return message includes (normal message):
- 0 Error ID : REPLY_SUCCESS
- 1 Error message : "success"
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
- 0 Error ID : REPLY_GENERAL_ERROR
- 1 Error message : "general error"
No connection Error (The daemon is probably not running)
- 0 Error ID : REPLY_CONNECTION
- 1 Error message : "no connection"
No rights Error (The client is not allowed to speak with the daemon)
- 0 Error ID : REPLY_NO_RIGHTS
- 1 Error message : "no rights"
Invalid Paramet (The client sent bullshit)
- 0 Error ID : REPLY_INVALID_PARAM
- 1 Error message : "invalid param"
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:
- Not supported (by HW):
- 0 : REPLY_HW_NOT_SUPPORTED
- 1 : "not supported"
Interface: com.novell.powersave
- Member : "SuspendToDisk"
- Member : "SuspendToRam"
- Member : "Standby"
- Already set
- 0 : REPLY_ALREADY_SET
- 1 : "already set"
- Does not exist
- 0 : REPLY_INVALID_METHOD
- 1 : "does not exist"
Interface: com.novell.powersave