summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-03-27 13:53:57 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-04 10:25:45 +0300
commitf3778ed1cbec15bdf3b1272a803b2ca3d892357d (patch)
treec500918e32ba5334d778ef8d0863d77d1493d10a /client
parent90c59a7f8e5d2bcd3f4654f331f87ea11f8d9172 (diff)
downloadconnman-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.c19
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)