Use the maximum rssi, not the scaled percentage for the signal level.

This makes the value for %signal match ifconfig(8) in all cases.
This commit is contained in:
Jasper Lievisse Adriaanse 2015-04-04 10:56:58 +02:00
parent 9abe0a9d59
commit e91891729e
1 changed files with 2 additions and 3 deletions

View File

@ -308,10 +308,9 @@ static int get_wireless_info(const char *interface, wireless_info_t *info) {
strlcpy(nr.nr_ifname, interface, sizeof(nr.nr_ifname));
if (ioctl(s, SIOCG80211NODE, &nr) == 0 && nr.nr_rssi) {
info->signal_level = nr.nr_rssi;
if (nr.nr_max_rssi)
info->signal_level_max = IEEE80211_NODEREQ_RSSI(&nr);
else
info->signal_level = nr.nr_rssi;
info->signal_level_max = nr.nr_max_rssi;
info->flags |= WIRELESS_INFO_FLAG_HAS_SIGNAL;
}