diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2015-05-22 14:12:37 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2015-05-22 14:12:37 +0900 |
commit | 57d2a32eab7747c89335d15ea2f918768a49e919 (patch) | |
tree | e02339e64e3acb587ee680c40751592fc1292e4e | |
parent | c3514528012ca72e221b365eb430b0fea62d67d0 (diff) | |
download | deviced-57d2a32eab7747c89335d15ea2f918768a49e919.tar.gz deviced-57d2a32eab7747c89335d15ea2f918768a49e919.tar.bz2 deviced-57d2a32eab7747c89335d15ea2f918768a49e919.zip |
power: Add power method call
This method is linked to device_power_reboot() in capi-system-device module.
It is a Tizen 2.3.1 public API.
Other method call is for internal modules, not public.
Change-Id: I195487cd6315a57da019fc52e98b7000d929e53f
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
-rw-r--r-- | src/power/power-handler.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/power/power-handler.c b/src/power/power-handler.c index 388e16ed..b4ff114a 100644 --- a/src/power/power-handler.c +++ b/src/power/power-handler.c @@ -433,6 +433,30 @@ out: return reply; } +static DBusMessage *request_reboot(E_DBus_Object *obj, DBusMessage *msg) +{ + DBusMessageIter iter; + DBusMessage *reply; + char *str; + int ret; + + if (!dbus_message_get_args(msg, NULL, + DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID)) { + _E("there is no message"); + ret = -EINVAL; + goto out; + } + + _I("reboot command : %s", str); + ret = power_execute(POWER_REBOOT); + +out: + reply = dbus_message_new_method_return(msg); + dbus_message_iter_init_append(reply, &iter); + dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret); + return reply; +} + void powerdown_ap(void *data) { _I("Power off"); @@ -450,6 +474,8 @@ void restart_ap(void *data) static const struct edbus_method edbus_methods[] = { { POWER_REBOOT, "si", "i", dbus_power_handler }, { PWROFF_POPUP, "si", "i", dbus_power_handler }, + /* be linked to device_power_reboot() public API. */ + { "Reboot", "s", "i", request_reboot }, /* Add methods here */ }; |