bugfix: Better handle AP detection.

All devices that respond to an iw scan will be AP's or ADHOCS.

All adhoc devices need to have the adhoc designator so if we don't see this we know its an AP.
This commit is contained in:
Conrad Lara - KG6JEI 2015-09-04 22:19:53 -07:00
parent c7bde9712a
commit a200f49a37
1 changed files with 3 additions and 5 deletions

View File

@ -97,7 +97,7 @@ sub pushAP
my($signal, $freq, $key, $ssid, $host, $mac, $mode) = @_;
return if $mac eq "";
return if $openap and ($key ne "" or $mode ne "ESS");
return if $openap and ($key ne "");
$chan=freq_to_chan($freq);
@ -186,7 +186,7 @@ while(1)
if ( $lastseen < 10000 ) { pushAP($signal, $chan, $key, $ssid, $host, $mac, $mode) }
$mac = uc $1;
$mode = "";
$mode = "AP";
$ssid = "";
$signal = 0;
$chan = "";
@ -202,9 +202,7 @@ while(1)
}
if($line =~ /\bSSID: (.*)/) { $ssid = $1 }
if($line =~ /\bSSID: unknown/) { $ssid = "unknown" }
if($line =~ /\bcapability: (ESS|PBCC|ChannelAgility|SpectrumMgmt)/)
{ $mode = "AP" }
if($line =~ /\bcapability: (IBSS)/ and $mode eq "")
if($line =~ /\bcapability: (IBSS)/ and $mode eq "AP")
{ $mode = "Foreign Ad-Hoc Network" }
if($line =~ /\bfreq: (\d+)/) { $chan = $1 }
if($line =~ /\bsignal: ([\d-]+)/) { $signal = $1 }