mirror of https://github.com/aredn/aredn.git
Merge branch 'FixupSNR' into release-3.15.1.0
fixes AREDN->ticket:129
This commit is contained in:
commit
28d5b160c1
|
@ -600,11 +600,18 @@ sub get_wifi_signal
|
||||||
chomp $wifiintf;
|
chomp $wifiintf;
|
||||||
my ($SignalLevel) = "N/A";
|
my ($SignalLevel) = "N/A";
|
||||||
my ($NoiseFloor) = "N/A";
|
my ($NoiseFloor) = "N/A";
|
||||||
foreach(`iwinfo $wifiintf info`)
|
foreach(`iw dev $wifiintf station dump`)
|
||||||
{
|
{
|
||||||
next unless /.*Signal: ([\d\-]+) dBm.*Noise: ([\d\-]+) dBm/;
|
next unless /.+signal:\s+([-]?[\d]+)/;
|
||||||
$SignalLevel=$1;
|
if ( $SignalLevel <= "$1" || $SignalLevel == "N/A" )
|
||||||
$NoiseFloor=$2;
|
{
|
||||||
|
$SignalLevel=$1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach(`iw dev $wifiintf survey dump|grep -A 1 \"\\[in use\\]\"`)
|
||||||
|
{
|
||||||
|
next unless /([\d\-]+) dBm/;
|
||||||
|
$NoiseFloor=$1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $SignalLevel == "N/A" || $NoiseFloor == "N/A" )
|
if ( $SignalLevel == "N/A" || $NoiseFloor == "N/A" )
|
||||||
|
|
Loading…
Reference in New Issue