]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
D-Bus/P2P: Support all discovery types
authorReinette Chatre <reinette.chatre@intel.com>
Fri, 26 Aug 2011 23:55:58 +0000 (16:55 -0700)
committerJouni Malinen <j@w1.fi>
Wed, 21 Sep 2011 22:01:20 +0000 (01:01 +0300)
The default discovery type is to search for devices only on social
channels. Expand this to also support an initial full scan followed by the
scan of social channels as well as the progressive scan that scans through
all the channels in the Search state rounds. This does not change the
default of scanning only social channels although there is currently a
discrepancy wrt the default used by wpa_cli, which is the full scan first.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
wpa_supplicant/dbus/dbus_new_handlers_p2p.c

index d73fd44710bae20125b1fa0eab70a0baba7e3000..f9c7cdcdbb0be980a944b73b9680e635be7a0484 100644 (file)
@@ -114,8 +114,17 @@ DBusMessage * wpas_dbus_handler_p2p_find(DBusMessage *message,
                                          wpabuf_head(entry.binarray_value[i]),
                                          WPS_DEV_TYPE_LEN);
                        }
-
                        num_req_dev_types = entry.array_len;
+               } else if (!os_strcmp(entry.key, "DiscoveryType") &&
+                          (entry.type == DBUS_TYPE_STRING)) {
+                       if (!os_strcmp(entry.str_value, "start_with_full"))
+                               type = P2P_FIND_START_WITH_FULL;
+                       else if (!os_strcmp(entry.str_value, "social"))
+                               type = P2P_FIND_ONLY_SOCIAL;
+                       else if (!os_strcmp(entry.str_value, "progressive"))
+                               type = P2P_FIND_PROGRESSIVE;
+                       else
+                               goto error_clear;
                } else
                        goto error_clear;
                wpa_dbus_dict_entry_clear(&entry);