2 Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 PROPRIETARY/CONFIDENTIAL
4 This software is the confidential and proprietary information of
5 SAMSUNG ELECTRONICS ("Confidential Information"). You agree and acknowledge that
6 this software is owned by Samsung and you
7 shall not disclose such Confidential Information and shall
8 use it only in accordance with the terms of the license agreement
9 you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no
10 representations or warranties about the suitability
11 of the software, either express or implied, including but not
12 limited to the implied warranties of merchantability, fitness for
13 a particular purpose, or non-infringement.
14 SAMSUNG shall not be liable for any damages suffered by licensee arising out of or
15 related to this software.
23 #define MAX_LOCAL_BUFSZ 128
25 void request_cb(DBusPendingCall *pc, void *user_data)
31 reply = dbus_pending_call_steal_reply(pc);
32 dbus_pending_call_unref(pc);
34 dbus_error_init(&error);
36 if (!dbus_message_get_args(reply, &error,
37 DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID))
38 _E("Failed to complete call");
40 printf("filename = %s\n", str);
42 dbus_message_unref(reply);
47 int main(int argc, char **argv)
55 char tmp[MAX_LOCAL_BUFSZ];
59 loop = g_main_loop_new(NULL, FALSE);
61 dbus_error_init(&error);
63 bus = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
65 _E("Failed to open bus to bus")
67 dbus_connection_setup_with_g_main(bus, NULL);
69 message = dbus_message_new_method_call (
70 SERVICE_NAME,PATH_NAME,INTERFACE_NAME,
73 gettimeofday(&tv, NULL);
74 snprintf(tmp, MAX_LOCAL_BUFSZ, "%ld/%ld", tv.tv_sec, tv.tv_usec);
77 dbus_message_append_args(message,
78 DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID);
80 dbus_connection_send_with_reply(bus, message, &pc, INT_MAX);
81 if (!dbus_pending_call_set_notify(pc, request_cb, NULL, NULL))
82 _E("pending call set fail");
84 dbus_message_unref(message);
86 printf("wait result\n");
88 g_main_loop_run(loop);