mirror of https://github.com/aredn/aredn.git
bugfix: sometimes iw doesn't show noise floor
Pull from kernel debug instead for now untill we can work around it in iw. fixes AREDN->ticket:129
This commit is contained in:
parent
794c00c7c6
commit
a46bbf27d8
|
@ -608,12 +608,23 @@ sub get_wifi_signal
|
|||
$SignalLevel=$1;
|
||||
}
|
||||
}
|
||||
|
||||
foreach(`iw dev $wifiintf survey dump|grep -A 1 \"\\[in use\\]\"`)
|
||||
{
|
||||
next unless /([\d\-]+) dBm/;
|
||||
$NoiseFloor=$1;
|
||||
}
|
||||
|
||||
if ( $SignalLevel == "N/A" )
|
||||
{
|
||||
open( my $SignalFH , "<" , "/sys/kernel/debug/ieee80211/phy0/ath9k/dump_nfcal") or return ("N/A","N/A");
|
||||
while (<$SignalFH>) {
|
||||
next unless /Channel Noise Floor : ([-]?[0-9]+)/;
|
||||
$SignalLevel=$1;
|
||||
}
|
||||
close($SignalFH);
|
||||
}
|
||||
|
||||
if ( $SignalLevel == "N/A" || $NoiseFloor == "N/A" )
|
||||
{
|
||||
return ("N/A","N/A");
|
||||
|
|
Loading…
Reference in New Issue