wifi scanning fails when freq argument supplied
Two problems: freq needs to be converted to a string and
the ordering of the arguments is wrong. This breaks waveguide
because it now uses wifi.py instead of directly calling 'iw'.
This fixes b/32246222
Change-Id: I447268e075b05263b36219351bedc82de36e9b0d
diff --git a/wifi/wifi.py b/wifi/wifi.py
index 4719b12..3773f03 100755
--- a/wifi/wifi.py
+++ b/wifi/wifi.py
@@ -537,12 +537,12 @@
raise utils.BinWifiException('No client interface for band %s', band)
scan_args = []
+ if opt.scan_freq:
+ scan_args += ['freq', str(opt.scan_freq)]
if opt.scan_ap_force:
scan_args += ['ap-force']
if opt.scan_passive:
scan_args += ['passive']
- if opt.scan_freq:
- scan_args += ['freq', opt.scan_freq]
print(iw.scan(interface, scan_args))