本文整理汇总了Python中pythonwifi.iwlibs.Wireless.getQualityAvg方法的典型用法代码示例。如果您正苦于以下问题:Python Wireless.getQualityAvg方法的具体用法?Python Wireless.getQualityAvg怎么用?Python Wireless.getQualityAvg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pythonwifi.iwlibs.Wireless
的用法示例。
在下文中一共展示了Wireless.getQualityAvg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: collectDataForInterface
# 需要导入模块: from pythonwifi.iwlibs import Wireless [as 别名]
# 或者: from pythonwifi.iwlibs.Wireless import getQualityAvg [as 别名]
def collectDataForInterface(self, iface):
w = Wireless(iface)
wsconfig = { }
simpleConfigs = (
("essid", w.getEssid, "off"),
("frequency", w.getFrequency, ""),
("accesspoint", w.getAPaddr, "Not-Associated"),
("bitrate", w.getBitrate, "0"),
("encryption", w.getEncryption, "off"),
)
for name, func, default in simpleConfigs:
try:
wsconfig[name] = func()
except:
wsconfig[name] = default
try:
wsconfig["quality"] = str(Iwstats("wlan0").qual.quality) + "/" + str(w.getQualityMax().quality)
except:
wsconfig["quality"] = ""
try:
wsconfig["signal"] = str(w.getQualityAvg().siglevel-128) + " dBm"
except:
wsconfig["signal"] = ""
return wsconfig
示例2: getSignalLevel
# 需要导入模块: from pythonwifi.iwlibs import Wireless [as 别名]
# 或者: from pythonwifi.iwlibs.Wireless import getQualityAvg [as 别名]
def getSignalLevel(self):
wifi = Wireless('wlan1')
essid = wifi.getEssid()
signal = "xx"
try:
signal = wifi.getQualityAvg().signallevel
self.signalLevel.setValue(signal)
except:
pass
self.signalLevel.setFormat(str(essid)+" "+str(signal))
return True