diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-03-27 13:53:57 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-04-04 10:25:45 +0300 |
commit | f3778ed1cbec15bdf3b1272a803b2ca3d892357d (patch) | |
tree | c500918e32ba5334d778ef8d0863d77d1493d10a /client | |
parent | 90c59a7f8e5d2bcd3f4654f331f87ea11f8d9172 (diff) | |
download | connman-f3778ed1cbec15bdf3b1272a803b2ca3d892357d.tar.gz connman-f3778ed1cbec15bdf3b1272a803b2ca3d892357d.tar.bz2 connman-f3778ed1cbec15bdf3b1272a803b2ca3d892357d.zip |
client: Use D-Bus helper functions for state method call
Diffstat (limited to 'client')
-rw-r--r-- | client/commands.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/client/commands.c b/client/commands.c index 3e6922f5..017b98d1 100644 --- a/client/commands.c +++ b/client/commands.c @@ -144,12 +144,29 @@ static int cmd_disable(char *args[], int num, struct option *options) return 0; } +static void state_print(DBusMessageIter *iter, const char *error, + void *user_data) +{ + DBusMessageIter entry; + + if (error != NULL) { + fprintf(stderr, "Error: %s", error); + return; + } + + dbus_message_iter_recurse(iter, &entry); + __connmanctl_dbus_print(&entry, " ", " = ", "\n"); + fprintf(stdout, "\n"); +} + static int cmd_state(char *args[], int num, struct option *options) { if (num > 1) return -E2BIG; - return list_properties(connection, "GetProperties", NULL); + return __connmanctl_dbus_method_call(connection, "/", + "net.connman.Manager", "GetProperties", + state_print, NULL, DBUS_TYPE_INVALID); } static int cmd_services(char *args[], int num, struct option *options) |