/bin/wifi: update Quantenna scan result parsing.
Change-Id: I84d4c89689f75dd0771bed3d042627a79cbfc8fb
diff --git a/wifi/quantenna.py b/wifi/quantenna.py
index bb541f5..8efaf0c 100755
--- a/wifi/quantenna.py
+++ b/wifi/quantenna.py
@@ -64,8 +64,11 @@
def _parse_scan_result(line):
# Scan result format:
#
- # "Quantenna1" 00:26:86:00:11:5f 60 56 1 2 1 2 0 15 80
- # | | | | | | | | | | |
+ # "Quantenna1" 00:26:86:00:11:5f 60 56 1 2 1 2 0 15 80 100 1 Infrastructure
+ # | | | | | | | | | | | | | |
+ # | | | | | | | | | | | | | Mode
+ # | | | | | | | | | | | | DTIM interval
+ # | | | | | | | | | | | Beacon interval
# | | | | | | | | | | Maximum bandwidth
# | | | | | | | | | WPS flags
# | | | | | | | | Qhop flags
@@ -80,7 +83,7 @@
#
# The SSID may contain quotes and spaces. Split on whitespace from the right,
# making at most 10 splits, to preserve spaces in the SSID.
- sp = line.strip().rsplit(None, 10)
+ sp = line.strip().rsplit(None, 13)
return sp[0][1:-1], sp[1], int(sp[2]), -float(sp[3]), int(sp[4]), int(sp[5])
diff --git a/wifi/quantenna_test.py b/wifi/quantenna_test.py
index b0fb485..3241b70 100755
--- a/wifi/quantenna_test.py
+++ b/wifi/quantenna_test.py
@@ -46,7 +46,8 @@
@wvtest.wvtest
def parse_scan_result_test():
- result = ' " ssid with "quotes" " 00:11:22:33:44:55 40 25 0 0 0 0 0 1 40 '
+ result = (' " ssid with "quotes" " 00:11:22:33:44:55 40 25 0 0 0 0 0 1 40 '
+ '100 1 Infrastructure')
wvtest.WVPASSEQ(quantenna._parse_scan_result(result),
(' ssid with "quotes" ', '00:11:22:33:44:55', 40, -25, 0, 0))