Main Page | Data Structures | File List | Data Fields | Globals

rpc-mce.c

Go to the documentation of this file.
00001 /**
00002  * This file is part of alarmd
00003  *
00004  * Contact Person: David Weinehall <david.weinehall@nokia.com>
00005  *
00006  * Copyright (C) 2006 Nokia Corporation
00007  * alarmd and libalarm are free software; you can redistribute them
00008  * and/or modify them under the terms of the GNU Lesser General Public
00009  * License version 2.1 as published by the Free Software Foundation.
00010  *
00011  * alarmd and libalarm are distributed in the hope that they will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this software; if not, write to the Free
00018  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00019  * 02110-1301 USA
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 }

Generated on Thu Dec 21 18:23:30 2006 for Alarmd by  doxygen 1.4.2