4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
23 #include "core/devices.h"
24 #include "core/edbus-handler.h"
25 #include "core/launch.h"
27 static DBusMessage *edbus_testmode_launch(E_DBus_Object *obj, DBusMessage *msg)
38 dbus_error_init(&err);
40 if (!dbus_message_get_args(msg, &err,
41 DBUS_TYPE_STRING, &argv, DBUS_TYPE_INVALID)) {
42 _E("there is no message");
46 sprintf(param, "%s", argv);
47 _D("param %s", param);
49 launch_evenif_exist("/usr/bin/testmode-env.sh", param);
51 reply = dbus_message_new_method_return(msg);
52 dbus_message_iter_init_append(reply, &iter);
53 dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);
58 static const struct edbus_method edbus_methods[] = {
59 { "Launch", "s", "i", edbus_testmode_launch },
60 /* Add methods here */
63 /* battery ops init funcion */
64 static void testmode_init(void *data)
68 /* init dbus interface */
69 ret = register_edbus_method(DEVICED_PATH_TESTMODE,
70 edbus_methods, ARRAY_SIZE(edbus_methods));
72 _E("fail to init edbus method(%d)", ret);
75 /* battery ops exit funcion */
76 static void testmode_exit(void *data)
80 static const struct device_ops battery_device_ops = {
81 .priority = DEVICE_PRIORITY_NORMAL,
83 .init = testmode_init,
84 .exit = testmode_exit,
87 DEVICE_OPS_REGISTER(&battery_device_ops)