From 4e2ead7a72d0d12ac96899f0f0f074ac234d7c10 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Sat, 26 Feb 2011 13:20:16 +0200 Subject: [PATCH] Add wpa_supplicant state change event for Android network manager Signed-off-by: Dmitry Shmidt --- src/common/wpa_ctrl.h | 2 ++ wpa_supplicant/notify.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index 86653a2fa..528cc1602 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -56,6 +56,8 @@ extern "C" { #define WPA_EVENT_EAP_FAILURE "CTRL-EVENT-EAP-FAILURE " /** New scan results available */ #define WPA_EVENT_SCAN_RESULTS "CTRL-EVENT-SCAN-RESULTS " +/** wpa_supplicant state change */ +#define WPA_EVENT_STATE_CHANGE "CTRL-EVENT-STATE-CHANGE " /** A new BSS entry was added (followed by BSS entry id and BSSID) */ #define WPA_EVENT_BSS_ADDED "CTRL-EVENT-BSS-ADDED " /** A BSS entry was removed (followed by BSS entry id and BSSID) */ diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c index 4daffd845..5e3aaa09e 100644 --- a/wpa_supplicant/notify.c +++ b/wpa_supplicant/notify.c @@ -92,6 +92,13 @@ void wpas_notify_state_changed(struct wpa_supplicant *wpa_s, #endif /* CONFIG_P2P */ sme_state_changed(wpa_s); + +#ifdef ANDROID + wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_STATE_CHANGE + "id=%d state=%d BSSID=" MACSTR, + wpa_s->current_ssid ? wpa_s->current_ssid->id : -1, + new_state, MAC2STR(wpa_s->pending_bssid)); +#endif /* ANDROID */ }