Show current mode (station/AB/IBSS) in status

This commit is contained in:
Jouni Malinen 2009-12-16 16:02:38 +02:00 committed by Jouni Malinen
parent 67f0112d83
commit 0e15e529eb
2 changed files with 26 additions and 0 deletions

View file

@ -473,6 +473,27 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
return pos - buf;
pos += ret;
}
switch (ssid->mode) {
case 0:
ret = os_snprintf(pos, end - pos,
"mode=station\n");
break;
case 1:
ret = os_snprintf(pos, end - pos,
"mode=IBSS\n");
break;
case 2:
ret = os_snprintf(pos, end - pos,
"mode=AP\n");
break;
default:
ret = 0;
break;
}
if (ret < 0 || ret >= end - pos)
return pos - buf;
pos += ret;
}
#ifdef CONFIG_AP

View file

@ -508,6 +508,7 @@ void WpaGui::updateStatus()
bool bssid_updated = false, ipaddr_updated = false;
bool status_updated = false;
char *pairwise_cipher = NULL, *group_cipher = NULL;
char *mode = NULL;
start = buf;
while (*start) {
@ -544,6 +545,8 @@ void WpaGui::updateStatus()
pairwise_cipher = pos;
} else if (strcmp(start, "group_cipher") == 0) {
group_cipher = pos;
} else if (strcmp(start, "mode") == 0) {
mode = pos;
}
}
@ -551,6 +554,8 @@ void WpaGui::updateStatus()
break;
start = end + 1;
}
if (status_updated && mode)
textStatus->setText(textStatus->text() + " (" + mode + ")");
if (pairwise_cipher || group_cipher) {
QString encr;