Modules | |
Client capabilities: Capabilities | |
Defines | |
#define | PS_DBUS_SERVICE "com.novell.powersave" |
#define | PS_DBUS_ACTION_INTERFACE "com.novell.powersave.action" |
#define | PS_DBUS_ADMIN_INTERFACE "com.novell.powersave.admin" |
#define | PS_DBUS_REQUEST_INTERFACE "com.novell.powersave.request" |
#define | PS_DBUS_MANAGER_INTERFACE "com.novell.powersave.manager" |
#define | PS_DBUS_SCRIPTS_INTERFACE "com.novell.powersave.scripts" |
#define | PS_DBUS_CLIENT_INTERFACE "com.novell.kpowersave" |
#define | PS_DBUS_PATH "/com/novell/powersave" |
Enumerations | |
enum | DBUS_ERROR { REPLY_SUCCESS, REPLY_NO_CONNECTION, REPLY_NO_RIGHTS, REPLY_INVALID_PARAM, REPLY_INVALID_METHOD, REPLY_INVALID_INTERFACE, REPLY_HW_NOT_SUPPORTED, REPLY_DISABLED, REPLY_ALREADY_SET, REPLY_DBUS_ERROR, REPLY_GENERAL_ERROR, REPLY_INVALID_MESSAGE_TYPE, REPLY_ERROR_MAX } |
dbus error message ids. They can be mapped to the DBus_Error_Array string array below More... | |
enum | POWERSAVE_MESSAGE_TYPE { MANAGER_MESSAGE, REQUEST_MESSAGE, ACTION_MESSAGE, SCRIPTS_MESSAGE, ADMIN_MESSAGE, CLIENT_MESSAGE } |
Enum for the interface to use. More... | |
Functions | |
void | dbusFree (void) |
frees and closes the connection to DBus | |
int | dbusGetMessageString (DBusMessage *msg, char **s, int no) |
get a string argument from a dbus messsage | |
int | dbusGetMessageInteger (DBusMessage *msg, int *i, int no) |
get an integer argument from a dbus messsage | |
int | dbusGetMessageErrorID (DBusMessage *msg, unsigned *error_id) |
get the DBUS_ERROR id from a reply | |
unsigned | dbusSendSimpleMessage (int msg_type, const char *method) |
Send a message to the powersave daemon and receive the reply. | |
unsigned | dbusSendSimpleMessageWithReply (int msg_type, DBusMessage **reply, const char *method) |
send a message to the daemon and receive the reply | |
unsigned | dbusSendMessage (int msg_type, const char *method, int first_arg_type,...) |
send message to the daemon with arguments | |
unsigned | dbusSendMessageWithReply (int msg_type, DBusMessage **reply, const char *method, int first_arg_type,...) |
send a message to the daemon with arguments and receive the reply | |
dbus_int32_t | establishConnection (int capabilities, DBusConnection *connection) |
establishes a connection to the daemon | |
Variables | |
char * | DBus_Error_Array [REPLY_ERROR_MAX] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dbus error message ids. They can be mapped to the DBus_Error_Array string array below
|
|
Enum for the interface to use.
|
|
frees and closes the connection to DBus Call this inside your application as soon as the dbus daemon brakes away |
|
get the DBUS_ERROR id from a reply if sendMessageWithReply was unsuccessful (returned !REPLY_SUCCESS) you may want to use this function to get the contents of the reply.
|
|
get an integer argument from a dbus messsage if sendMessageWithReply was successful (returned REPLY_SUCCESS) you may want to use this function to get the contents of the reply.
|
|
get a string argument from a dbus messsage if sendMessageWithReply was successful (returned REPLY_SUCCESS) you may want to use this function to get the contents of the reply.
|
|
send message to the daemon with arguments
|
|
send a message to the daemon with arguments and receive the reply
|
|
Send a message to the powersave daemon and receive the reply. You can only use the REQUEST and ACTION interface (msg_type) and you need to know what request/action you want to send and give the appropriate params for. Use the dbus type definitions and let the varargs end with DBUS_TYPE_INVALID (also see the dbus doc/code for the function dbus_message_append_args(...) E.g.: DBusMessage *reply; int ret; char *scheme = "performance"; ret = dbus_send_message(REQUEST, &reply, "set_scheme", DBUS_TYPE_STRING, &scheme, DBUS_TYPE_INVALID); if (ret == REPLY_SUCCESS){ // PROCESS MESSAGE; dbus_message_unref(reply) } else{ // Handle error - no need to unref reply } Tries to set the current scheme ("set_scheme" -> method name) to "performance" (special argument for "set_scheme" messages)
|
|
send a message to the daemon and receive the reply
|
|
establishes a connection to the daemon
|
|
|