libiwinfo: show noise and snr in assoclist
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 10 Nov 2011 22:35:56 +0000 (22:35 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 10 Nov 2011 22:35:56 +0000 (22:35 +0000)
contrib/package/iwinfo/src/iwinfo.lua

index 4a982dd99454da376960351cd6e83fc13b45fe75..811022052b9219eb63b8c122cd913478ee75f5e9 100755 (executable)
@@ -140,11 +140,13 @@ end
 function print_assoclist(api, dev)
        local iw = iwinfo[api]
        local al = iw.assoclist(dev)
+       local ns = iw.noise(dev)
        local ai, ae
 
        if al and next(al) then
                for ai, ae in pairs(al) do
-                       printf("%s  %s dBm", ai, s(ae.signal))
+                       printf("%s  %s dBm / %d dBm (SNR %d)",
+                               ai, s(ae.signal), ns, n(ae.signal) - ns)
                end
        else
                print("No client connected or no information available")