Adjust max wifi strength that is possible

This commit is contained in:
Brent George 2021-12-01 18:24:35 -07:00
parent 9e8a71c4ef
commit 2240c79b1a
1 changed files with 2 additions and 2 deletions

View File

@ -789,8 +789,8 @@ void waybar::modules::Network::parseSignal(struct nlattr **bss) {
// signalstrength in dBm from mBm // signalstrength in dBm from mBm
signal_strength_dbm_ = nla_get_s32(bss[NL80211_BSS_SIGNAL_MBM]) / 100; signal_strength_dbm_ = nla_get_s32(bss[NL80211_BSS_SIGNAL_MBM]) / 100;
// WiFi-hardware usually operates in the range -90 to -20dBm. // WiFi-hardware usually operates in the range -90 to -30dBm.
const int hardwareMax = -20; const int hardwareMax = -30;
const int hardwareMin = -90; const int hardwareMin = -90;
const int strength = const int strength =
((signal_strength_dbm_ - hardwareMin) / double{hardwareMax - hardwareMin}) * 100; ((signal_strength_dbm_ - hardwareMin) / double{hardwareMax - hardwareMin}) * 100;