libs/core: expose txpower offset values in network model
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 5 Dec 2011 18:34:22 +0000 (18:34 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 5 Dec 2011 18:34:22 +0000 (18:34 +0000)
libs/core/luasrc/model/network.lua

index 61da9df..aaa3908 100644 (file)
@@ -1360,7 +1360,12 @@ function wifinet.country(self)
 end
 
 function wifinet.txpower(self)
-       return self.iwinfo.txpower or 0
+       local pwr = (self.iwinfo.txpower or 0)
+       return pwr + self:txpower_offset()
+end
+
+function wifinet.txpower_offset(self)
+       return self.iwinfo.txpower_offset or 0
 end
 
 function wifinet.signal_level(self, s, n)