diff mbox

[D-Bus,GroupStarted] Indicate whether created group is persistent or not.

Message ID 1464340991-3123-1-git-send-email-n.chaprana@samsung.com
State Changes Requested
Headers show

Commit Message

Nishant Chaprana May 27, 2016, 9:23 a.m. UTC
This patch sends extra parameter in GroupStarted event to indicate
whether created group is Persistent or not. It is similar to
[PERSISTENT] tag which comes in P2P-GROUP-STARTED over CTRL interface.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
---
 wpa_supplicant/dbus/dbus_new.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jouni Malinen May 28, 2016, 9:38 a.m. UTC | #1
On Fri, May 27, 2016 at 02:53:11PM +0530, Nishant Chaprana wrote:
> This patch sends extra parameter in GroupStarted event to indicate
> whether created group is Persistent or not. It is similar to
> [PERSISTENT] tag which comes in P2P-GROUP-STARTED over CTRL interface.

This sounds fine..

> diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
> @@ -1300,6 +1300,8 @@ void wpas_dbus_signal_p2p_group_started(struct wpa_supplicant *wpa_s,
> +	    !wpa_dbus_dict_append_bool(&dict_iter, "persistent",
> +					 network_id ? 1 : 0) ||

.. but this does not do that correctly. network_id is the id of the
network block and it could at least in theory be 0 for the persistent
group parameters and it can certainly be non-zero for a non-persistent
group (if there are other network blocks in the configuration).

network_id is actually unused in the current
wpas_dbus_signal_p2p_group_started(). I think it should actually be
removed since it does not seem to be a very meaningful parameter or at
least not clearly defined (which network? the current ssid block for the
group or the persistent group storage?). The same seems to apply to the
ssid parameter..

In any case, for this new "persistent" parameter, the caller would need
to provide a new function parameter to get this information reliably
into the signal.
diff mbox

Patch

diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index d894f6a..0827d62 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -1300,6 +1300,8 @@  void wpas_dbus_signal_p2p_group_started(struct wpa_supplicant *wpa_s,
 					      wpa_s->dbus_new_path) ||
 	    !wpa_dbus_dict_append_string(&dict_iter, "role",
 					 client ? "client" : "GO") ||
+	    !wpa_dbus_dict_append_bool(&dict_iter, "persistent",
+					 network_id ? 1 : 0) ||
 	    !wpa_dbus_dict_append_object_path(&dict_iter, "group_object",
 					      wpa_s->dbus_groupobj_path) ||
 	    !wpa_dbus_dict_close_write(&iter, &dict_iter)) {