r4892 - developers/werner/bin

werner at docs.openmoko.org werner at docs.openmoko.org
Tue Jan 20 22:37:34 CET 2009


Author: werner
Date: 2009-01-20 22:37:33 +0100 (Tue, 20 Jan 2009)
New Revision: 4892

Modified:
   developers/werner/bin/wlanscan
Log:
Also display the channel number.



Modified: developers/werner/bin/wlanscan
===================================================================
--- developers/werner/bin/wlanscan	2009-01-20 09:04:17 UTC (rev 4891)
+++ developers/werner/bin/wlanscan	2009-01-20 21:37:33 UTC (rev 4892)
@@ -2,11 +2,12 @@
 iwlist scan 2>/dev/null | awk '
 function flush()
 {
-    printf("%3s %-32s %9s dBm %s\n", cell, essid, signal, crypt)
+    printf("%3s %-32s %2s %9s dBm %s\n", cell, essid, chan, signal, crypt)
     cell = "?"
     essid = "?"
     signal = "?"
     crypt = "?"
+    chan = "?"
 }
 
 /^ *Cell/ {
@@ -37,6 +38,10 @@
 /^ *Extra:wpa_ie/ {
     crypt = "WPA"
 }
+/^ *Frequency:/ {
+    match($0, /Channel [0-9]*/)
+    chan = substr($0, RSTART+8, RLENGTH-8)
+}
 END {
     if (cell != "")
 	flush()




More information about the commitlog mailing list