Changeset 6954

Show
Ignore:
Timestamp:
03/13/11 19:10:43 (2 years ago)
Author:
jow
Message:

modules/admin-core: add wifi_network() to luci.tools.status

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/modules/admin-core/luasrc/tools/status.lua

    r6950 r6954  
    8484                bitrate    = net:bitrate(), 
    8585                ifname     = net:ifname(), 
    86                 assoclist  = net:assoclist() 
     86                assoclist  = net:assoclist(), 
     87                country    = net:country(), 
     88                txpower    = net:txpower() 
    8789            } 
    8890        end 
     
    9395    return rv 
    9496end 
     97 
     98function wifi_network(id) 
     99    local ntm = require "luci.model.network".init() 
     100    local net = ntm:get_wifinet(id) 
     101    if net then 
     102        local dev = net:get_device() 
     103        if dev then 
     104            return { 
     105                id         = id, 
     106                name       = net:shortname(), 
     107                link       = net:adminlink(), 
     108                up         = net:is_up(), 
     109                mode       = net:active_mode(), 
     110                ssid       = net:active_ssid(), 
     111                bssid      = net:active_bssid(), 
     112                encryption = net:active_encryption(), 
     113                frequency  = net:frequency(), 
     114                channel    = net:channel(), 
     115                signal     = net:signal(), 
     116                quality    = net:signal_percent(), 
     117                noise      = net:noise(), 
     118                bitrate    = net:bitrate(), 
     119                ifname     = net:ifname(), 
     120                assoclist  = net:assoclist(), 
     121                country    = net:country(), 
     122                txpower    = net:txpower(), 
     123                device     = { 
     124                    up     = dev:is_up(), 
     125                    device = dev:name(), 
     126                    name   = dev:get_i18n() 
     127                } 
     128            } 
     129        end 
     130    end 
     131    return { } 
     132end