summaryrefslogtreecommitdiff
path: root/src/agent.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2011-12-02 16:18:28 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-12-12 10:44:40 +0100
commit3b21fdad0abfd7c993c18569797e1dabbc41cc12 (patch)
treea2fd5bd8062916d276a1437a0686ce15f1d47fb6 /src/agent.c
parent8c0cc20f3686a299a0abc8ddd8df8a702a26e379 (diff)
downloadconnman-3b21fdad0abfd7c993c18569797e1dabbc41cc12.tar.gz
connman-3b21fdad0abfd7c993c18569797e1dabbc41cc12.tar.bz2
connman-3b21fdad0abfd7c993c18569797e1dabbc41cc12.zip
agent: Handle 'Name' and/or 'SSID' fields on method call return
Diffstat (limited to 'src/agent.c')
-rw-r--r--src/agent.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/agent.c b/src/agent.c
index ce72d503..62710d4a 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -100,6 +100,8 @@ static void request_input_passphrase_reply(DBusPendingCall *call, void *user_dat
char *passphrase = NULL;
char *wpspin = NULL;
char *key;
+ char *name = NULL;
+ int name_len;
DBusMessageIter iter, dict;
DBusMessage *reply = dbus_pending_call_steal_reply(call);
@@ -144,6 +146,28 @@ static void request_input_passphrase_reply(DBusPendingCall *call, void *user_dat
dbus_message_iter_recurse(&entry, &value);
dbus_message_iter_get_basic(&value, &wpspin);
break;
+ } else if (g_str_equal(key, "Name")) {
+ dbus_message_iter_next(&entry);
+ if (dbus_message_iter_get_arg_type(&entry)
+ != DBUS_TYPE_VARIANT)
+ break;
+ dbus_message_iter_recurse(&entry, &value);
+ dbus_message_iter_get_basic(&value, &name);
+ name_len = strlen(name);
+ } else if (g_str_equal(key, "SSID")) {
+ dbus_message_iter_next(&entry);
+ if (dbus_message_iter_get_arg_type(&entry)
+ != DBUS_TYPE_VARIANT)
+ break;
+ dbus_message_iter_recurse(&entry, &value);
+ if (dbus_message_iter_get_arg_type(&value)
+ != DBUS_TYPE_VARIANT)
+ break;
+ if (dbus_message_iter_get_element_type(&value)
+ != DBUS_TYPE_VARIANT)
+ break;
+ dbus_message_iter_get_fixed_array(&value, &name,
+ &name_len);
}
dbus_message_iter_next(&dict);
}