]> git.sur5r.net Git - i3/i3status/commitdiff
Use the maximum rssi, not the scaled percentage for the signal level. 22/head
authorJasper Lievisse Adriaanse <jasper@humppa.nl>
Sat, 4 Apr 2015 08:56:58 +0000 (10:56 +0200)
committerJasper Lievisse Adriaanse <jasper@humppa.nl>
Sat, 4 Apr 2015 08:56:58 +0000 (10:56 +0200)
This makes the value for %signal match ifconfig(8) in all cases.

src/print_wireless_info.c

index eae942b9c6dfa95271b7e8444f068398a8b2ab64..8b390ab61e6f2c07f8090bb4c8fba4cfde40285e 100644 (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;
             }