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

Neeraj Kumar Garg neerajkg
Sun Dec 18 22:33:50 PST 2011


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 at broadcom.com>
---
 wpa_supplicant/wpa_cli.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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;
-- 
1.7.4.1

Regards,
-Neeraj




More information about the Hostap mailing list