Patchwork Subject: [PATCH] Adding AP-STA-CONNECTED and DISCONNECTED events to wpa_cli if it is running with -a

login
register
mail settings
Submitter Neeraj Garg
Date Dec. 19, 2011, 6:33 a.m.
Message ID <2C2F1EBA8050E74EA81502D5740B4BD6BBBCBAB63C@SJEXCHCCR02.corp.ad.broadcom.com>
Download mbox | patch
Permalink /patch/132165/
State Accepted
Commit 653c4893be17d12ef7bc6e941b765c92c1e4a161
Headers show

Comments

Neeraj Garg - Dec. 19, 2011, 6:33 a.m.
Hello, 
Is it possible to add events like AP-STA-CONNECTED and DISCONNECTED events to a running wpa_cli with -a option. This is needed purely for test purposes for automation. Plz let me know if below patch is OK.

Subject: [PATCH] Adding AP-STA-CONNECTED and DISCONNECTED events to wpa_cli if it is running with -a
Signed-hostap: Neeraj Kumar Garg <neerajkg@broadcom.com>
---
 wpa_supplicant/wpa_cli.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Jouni Malinen - Dec. 19, 2011, 11:10 p.m.
On Sun, Dec 18, 2011 at 10:33:50PM -0800, Neeraj Kumar Garg wrote:
> Is it possible to add events like AP-STA-CONNECTED and DISCONNECTED events to a running wpa_cli with -a option. This is needed purely for test purposes for automation. Plz let me know if below patch is OK.

I guess this could be used for other purposes, too, than just testing,
but anyway, sure, this can be added. Applied.

Patch

diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 42c81cd..6ca7939 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -3292,6 +3292,10 @@  static void wpa_cli_action_process(const char *msg)
 		wpa_cli_exec(action_file, ctrl_ifname, pos);
 	} else if (str_match(pos, WPS_EVENT_FAIL)) {
 		wpa_cli_exec(action_file, ctrl_ifname, pos);
+	} else if (str_match(pos, AP_STA_CONNECTED)) {
+		wpa_cli_exec(action_file, ctrl_ifname, pos);
+	} else if (str_match(pos, AP_STA_DISCONNECTED)) {
+		wpa_cli_exec(action_file, ctrl_ifname, pos);
 	} else if (str_match(pos, WPA_EVENT_TERMINATING)) {
 		printf("wpa_supplicant is terminating - stop monitoring\n");
 		wpa_cli_quit = 1;