00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <dbus/dbus.h>
00023 #include <glib.h>
00024 #include <mce/dbus-names.h>
00025 #include <mce/mode-names.h>
00026 #include "rpc-mce.h"
00027 #include "rpc-dbus.h"
00028 #include "debug.h"
00029
00030 void mce_set_alarm_visibility(DBusConnection *system_bus, gboolean visible)
00031 {
00032 const gchar *mode = visible ? MCE_ALARM_VISIBLE : MCE_ALARM_OFF;
00033 ENTER_FUNC;
00034
00035 DEBUG("Telling mce alarm is %s", visible ? "visible" : "off");
00036
00037 dbus_do_call(system_bus, NULL, FALSE,
00038 MCE_SERVICE, MCE_REQUEST_PATH, MCE_REQUEST_IF,
00039 MCE_ALARM_MODE_CHANGE_REQ,
00040 DBUS_TYPE_STRING, &mode,
00041 DBUS_TYPE_INVALID);
00042 LEAVE_FUNC;
00043 }
00044
00045 void mce_request_powerup(DBusConnection *system_bus)
00046 {
00047 ENTER_FUNC;
00048 dbus_do_call(system_bus, NULL, FALSE,
00049 MCE_SERVICE,
00050 MCE_REQUEST_PATH,
00051 MCE_REQUEST_IF,
00052 MCE_POWERUP_REQ,
00053 DBUS_TYPE_INVALID);
00054 LEAVE_FUNC;
00055 }
00056
00057 void mce_request_shutdown(DBusConnection *system_bus)
00058 {
00059 ENTER_FUNC;
00060 dbus_do_call(system_bus, NULL, FALSE,
00061 MCE_SERVICE,
00062 MCE_REQUEST_PATH,
00063 MCE_REQUEST_IF,
00064 MCE_SHUTDOWN_REQ,
00065 DBUS_TYPE_INVALID);
00066 LEAVE_FUNC;
00067 }