]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dbus: Expose P2P auto_join behavior
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 11 May 2025 17:54:40 +0000 (19:54 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 19 Jun 2025 09:50:23 +0000 (12:50 +0300)
It's useful, without it you need multiple tries to join an existing
group.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
doc/dbus.doxygen
wpa_supplicant/dbus/dbus_new_handlers_p2p.c

index 473603a1f01224fedf2e4f33b0abaa6673ccdf8e..2af405f2c7a91b00d65355cf2cf7f24231e1b67e 100644 (file)
@@ -1806,6 +1806,7 @@ Interface for performing P2P (Wi-Fi Peer-to-Peer) P2P Device operations.
        <tr><td>peer</td><td>o</td><td></td><td>yes</td></tr>
        <tr><td>persistent</td><td>b</td><td>Whether to form a persistent group.</td><td>no</td></tr>
        <tr><td>join</td><td>b</td><td>Whether to join an already operating group instead of forming a new group.</td><td>no</td></tr>
+       <tr><td>auto_join</td><td>b</td><td>Automatically choose between joining an already operating group or forming a new group.</td><td>no</td></tr>
        <tr><td>authorize_only</td><td>b</td><td>Whether to authorize a peer to initiate GO Negotiation instead of initiating immediately.</td><td>no</td></tr>
        <tr><td>frequency</td><td>i</td><td>Operating frequency in MHz</td><td>no</td></tr>
        <tr><td>go_intent</td><td>i</td><td>GO intent 0-15</td><td>no</td></tr>
index fc59947ee5464ff2fdb6d2630a7e0f23bbc1a4ee..192c65d66ad0b303a3c88dda8b8b39cab50689f1 100644 (file)
@@ -624,6 +624,7 @@ DBusMessage * wpas_dbus_handler_p2p_connect(DBusMessage *message,
        struct wpa_dbus_dict_entry entry;
        char *peer_object_path = NULL;
        int persistent_group = 0;
+       int auto_join = 0;
        int join = 0;
        int authorize_only = 0;
        int go_intent = -1;
@@ -657,6 +658,9 @@ DBusMessage * wpas_dbus_handler_p2p_connect(DBusMessage *message,
                } else if (os_strcmp(entry.key, "join") == 0 &&
                           entry.type == DBUS_TYPE_BOOLEAN) {
                        join = entry.bool_value;
+               } else if (os_strcmp(entry.key, "auto_join") == 0 &&
+                          entry.type == DBUS_TYPE_BOOLEAN) {
+                       auto_join = entry.bool_value;
                } else if (os_strcmp(entry.key, "authorize_only") == 0 &&
                           entry.type == DBUS_TYPE_BOOLEAN) {
                        authorize_only = entry.bool_value;
@@ -705,7 +709,8 @@ DBusMessage * wpas_dbus_handler_p2p_connect(DBusMessage *message,
        wpa_s = wpa_s->global->p2p_init_wpa_s;
 
        new_pin = wpas_p2p_connect(wpa_s, addr, pin, wps_method,
-                                  persistent_group, 0, join, authorize_only,
+                                  persistent_group, auto_join, join,
+                                  authorize_only,
                                   go_intent, freq, 0, -1, 0, 0, 0, 0, 0, 0,
                                   NULL, 0, false, 0, 0, NULL, false);