diff options
| author | Manuel Traut <manut@mecka.net> | 2014-02-18 23:27:47 +0100 |
|---|---|---|
| committer | Manuel Traut <manut@mecka.net> | 2014-02-18 23:27:47 +0100 |
| commit | ddf662b88e0e04dd6af3bba47b4a58e4d284e7d1 (patch) | |
| tree | 64d6b7d61f586b27ae1cd066fdcafad45f8cfa59 /frameworks/middleware/examples/dbus/ping-client.c | |
| parent | 21e79c833fcbd2d7c43380a2f74b5c0173c6c1a0 (diff) | |
dbus example: remove compile.sh and make a autotools project
compile.sh was a pain. didn't work with current debian.
so this patch removes it and converts the example to an autools project.
Signed-off-by: Manuel Traut <manut@mecka.net>
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 */ |
