summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-core
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-03-13 17:10:43 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-03-13 17:10:43 +0000
commitbc6e9ec07ee32cb098c04f5014824789b958701e (patch)
tree95247d89a5ddaecc6b6737a92ef961ce6c024659 /modules/admin-core
parent986d8b00a22f6616fd9cb0279ddb75f9acbbee47 (diff)
modules/admin-core: add wifi_network() to luci.tools.status
Diffstat (limited to 'modules/admin-core')
-rw-r--r--modules/admin-core/luasrc/tools/status.lua40
1 files changed, 39 insertions, 1 deletions
diff --git a/modules/admin-core/luasrc/tools/status.lua b/modules/admin-core/luasrc/tools/status.lua
index e3276800d..ff98d459b 100644
--- a/modules/admin-core/luasrc/tools/status.lua
+++ b/modules/admin-core/luasrc/tools/status.lua
@@ -83,7 +83,9 @@ function wifi_networks()
noise = net:noise(),
bitrate = net:bitrate(),
ifname = net:ifname(),
- assoclist = net:assoclist()
+ assoclist = net:assoclist(),
+ country = net:country(),
+ txpower = net:txpower()
}
end
@@ -92,3 +94,39 @@ function wifi_networks()
return rv
end
+
+function wifi_network(id)
+ local ntm = require "luci.model.network".init()
+ local net = ntm:get_wifinet(id)
+ if net then
+ local dev = net:get_device()
+ if dev then
+ return {
+ id = id,
+ name = net:shortname(),
+ link = net:adminlink(),
+ up = net:is_up(),
+ mode = net:active_mode(),
+ ssid = net:active_ssid(),
+ bssid = net:active_bssid(),
+ encryption = net:active_encryption(),
+ frequency = net:frequency(),
+ channel = net:channel(),
+ signal = net:signal(),
+ quality = net:signal_percent(),
+ noise = net:noise(),
+ bitrate = net:bitrate(),
+ ifname = net:ifname(),
+ assoclist = net:assoclist(),
+ country = net:country(),
+ txpower = net:txpower(),
+ device = {
+ up = dev:is_up(),
+ device = dev:name(),
+ name = dev:get_i18n()
+ }
+ }
+ end
+ end
+ return { }
+end