summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/iwinfo/src/iwinfo.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-10-19 20:58:48 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-10-19 20:58:48 +0000
commit5039b43e953c16c8510ff89b2c90470882ec55c3 (patch)
treeaebe491e91803460e74e697e6a41ece5533e60d5 /contrib/package/iwinfo/src/iwinfo.lua
parent687861c498f15b76eed192401911c0b00c714597 (diff)
libiwinfo: implement hwmodelist()
Diffstat (limited to 'contrib/package/iwinfo/src/iwinfo.lua')
-rwxr-xr-xcontrib/package/iwinfo/src/iwinfo.lua23
1 files changed, 20 insertions, 3 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo.lua b/contrib/package/iwinfo/src/iwinfo.lua
index 76b9e4ad1f..1de43faafe 100755
--- a/contrib/package/iwinfo/src/iwinfo.lua
+++ b/contrib/package/iwinfo/src/iwinfo.lua
@@ -26,14 +26,31 @@ function print_info(api, dev)
local iw = iwinfo[api]
local enc = iw.encryption(dev)
- printf("%-9s Type: %s ESSID: \"%s\"",
- dev, api, s(iw.ssid(dev)))
+ local function hwmode()
+ local m = iw.hwmodelist(dev)
+ if m then
+ local s = "802.11"
+ if m.a then s = s.."a" end
+ if m.b then s = s.."b" end
+ if m.g then s = s.."g" end
+ if m.n then s = s.."n" end
+ return s
+ else
+ return "?"
+ end
+ end
+
+ printf("%-9s ESSID: \"%s\"",
+ dev, s(iw.ssid(dev)))
printf(" Access Point: %s",
s(iw.bssid(dev)))
+ printf(" Type: %s HW Mode(s): %s",
+ api, hwmode())
+
printf(" Mode: %s Channel: %d (%.3f GHz)",
- iw.mode(dev), n(iw.channel(dev)), n(iw.frequency(dev)) / 1000)
+ s(iw.mode(dev)), n(iw.channel(dev)), n(iw.frequency(dev)) / 1000)
printf(" Tx-Power: %s dBm Link Quality: %s/%s",
s(iw.txpower(dev)), s(iw.quality(dev)), s(iw.quality_max(dev)))