Android: Add NO_EVENTS parameter to status command

It also allows to use the STATUS command with default behavior,
say for debug, i.e., don't generate a "fake" CONNECTION and
SUPPLICANT_STATE_CHANGE events with the new STATUS-NO_EVENTS case.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
vandwalle 2014-09-11 11:40:14 -07:00 committed by Jouni Malinen
parent df2508d7a8
commit a6ab82d7b4

View file

@ -1768,22 +1768,29 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_WPS */ #endif /* CONFIG_WPS */
#ifdef ANDROID #ifdef ANDROID
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_STATE_CHANGE /*
"id=%d state=%d BSSID=" MACSTR " SSID=%s", * Allow using the STATUS command with default behavior, say for debug,
wpa_s->current_ssid ? wpa_s->current_ssid->id : -1, * i.e., don't generate a "fake" CONNECTION and SUPPLICANT_STATE_CHANGE
wpa_s->wpa_state, * events with STATUS-NO_EVENTS.
MAC2STR(wpa_s->bssid), */
wpa_s->current_ssid && wpa_s->current_ssid->ssid ? if (os_strcmp(params, "-NO_EVENTS")) {
wpa_ssid_txt(wpa_s->current_ssid->ssid, wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_STATE_CHANGE
wpa_s->current_ssid->ssid_len) : ""); "id=%d state=%d BSSID=" MACSTR " SSID=%s",
if (wpa_s->wpa_state == WPA_COMPLETED) { wpa_s->current_ssid ? wpa_s->current_ssid->id : -1,
struct wpa_ssid *ssid = wpa_s->current_ssid; wpa_s->wpa_state,
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_CONNECTED MAC2STR(wpa_s->bssid),
"- connection to " MACSTR wpa_s->current_ssid && wpa_s->current_ssid->ssid ?
" completed %s [id=%d id_str=%s]", wpa_ssid_txt(wpa_s->current_ssid->ssid,
MAC2STR(wpa_s->bssid), "(auth)", wpa_s->current_ssid->ssid_len) : "");
ssid ? ssid->id : -1, if (wpa_s->wpa_state == WPA_COMPLETED) {
ssid && ssid->id_str ? ssid->id_str : ""); struct wpa_ssid *ssid = wpa_s->current_ssid;
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_CONNECTED
"- connection to " MACSTR
" completed %s [id=%d id_str=%s]",
MAC2STR(wpa_s->bssid), "(auth)",
ssid ? ssid->id : -1,
ssid && ssid->id_str ? ssid->id_str : "");
}
} }
#endif /* ANDROID */ #endif /* ANDROID */