当前位置: 首页>>代码示例>>Python>>正文


Python Wireless.getQualityAvg方法代码示例

本文整理汇总了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
开发者ID:popazerty,项目名称:beyonwiz-4.1,代码行数:29,代码来源:Wlan.py

示例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
开发者ID:homoludens,项目名称:py_examples,代码行数:13,代码来源:pyqtwindow.py


注:本文中的pythonwifi.iwlibs.Wireless.getQualityAvg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。