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 61da9dfd0414ebf7af04ca135fe934ca4437b38b..aaa39086ae7cebc1d342a25fdca24ebdfa600331 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)