diff options
Diffstat (limited to 'frameworks/middleware/examples/dbus/ping-client.c')
| -rw-r--r-- | frameworks/middleware/examples/dbus/ping-client.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/frameworks/middleware/examples/dbus/ping-client.c b/frameworks/middleware/examples/dbus/ping-client.c index e3035e4..ceb3205 100644 --- a/frameworks/middleware/examples/dbus/ping-client.c +++ b/frameworks/middleware/examples/dbus/ping-client.c @@ -12,10 +12,10 @@ int main (int argc, char **argv) DBusConnection *bus; DBusError error; - if (argc > 1) - v_STRING = argv[1]; - else - v_STRING = "no arg given"; + if (argc > 1) + v_STRING = argv[1]; + else + v_STRING = "no arg given"; /* Create a new event loop to run in */ loop = g_main_loop_new (NULL, FALSE); @@ -42,8 +42,8 @@ int main (int argc, char **argv) static gboolean send_ping (DBusConnection *bus) { DBusMessage *message; - struct timespec tx_time; - struct timespec done_time; + struct timespec tx_time; + struct timespec done_time; message = dbus_message_new_signal ("/de/linutronix/Ping", "de.linutronix.Ping", "Ping"); @@ -51,12 +51,16 @@ static gboolean send_ping (DBusConnection *bus) dbus_message_append_args (message, DBUS_TYPE_STRING, &v_STRING, DBUS_TYPE_INVALID); - clock_gettime(CLOCK_MONOTONIC, &tx_time); + + clock_gettime(CLOCK_MONOTONIC, &tx_time); + /* Send the signal */ dbus_connection_send (bus, message, NULL); - clock_gettime(CLOCK_MONOTONIC, &done_time); - g_print("%d:%d\n%d:%d\n\n", tx_time.tv_sec, tx_time.tv_nsec/1000, - done_time.tv_sec, done_time.tv_nsec/1000); + clock_gettime(CLOCK_MONOTONIC, &done_time); + + g_print("%d:%d\n%d:%d\n\n", tx_time.tv_sec, tx_time.tv_nsec/1000, + done_time.tv_sec, done_time.tv_nsec/1000); + /* Free the signal now we have finished with it */ dbus_message_unref (message); /* Return TRUE to tell the event loop we want to be called again */ |
