當前位置: 首頁>>代碼示例>>Python>>正文


Python Wireless.getBitrate方法代碼示例

本文整理匯總了Python中pythonwifi.iwlibs.Wireless.getBitrate方法的典型用法代碼示例。如果您正苦於以下問題:Python Wireless.getBitrate方法的具體用法?Python Wireless.getBitrate怎麽用?Python Wireless.getBitrate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pythonwifi.iwlibs.Wireless的用法示例。


在下文中一共展示了Wireless.getBitrate方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: sniff_wifi

# 需要導入模塊: from pythonwifi.iwlibs import Wireless [as 別名]
# 或者: from pythonwifi.iwlibs.Wireless import getBitrate [as 別名]
def sniff_wifi():
    if plat == "OSX":
        # bridge to objective c(apple stuff)
        objc.loadBundle(
            "CoreWLAN", bundle_path="/System/Library/Frameworks/CoreWLAN.framework", module_globals=globals()
        )

        for iname in CWInterface.interfaceNames():
            interface = CWInterface.interfaceWithName_(iname)
            wifi_parameters = (
                "Interface:      %s, SSID:           %s, Transmit Rate:  %s, Transmit Power: %s, RSSI:           %s"
                % (iname, interface.ssid(), interface.transmitRate(), interface.transmitPower(), interface.rssi())
            )
    elif plat == "LINUX":
        interface = Wireless("wlan0")

        # Link Quality, Signal Level and Noise Level line
        wifi_parameters = "Interface:      %s, SSID:           %s, Transmit Rate:  %s, Transmit Power: %s" % (
            "wlan0",
            interface.getEssid(),
            interface.getBitrate(),
            interface.getTXPower(),
        )

    # record wifi parameters
    print wifi_parameters
    open(channels_file, "a").write(wifi_parameters + "\n")
開發者ID:baharxy,項目名稱:LTEWiFi-Measurements,代碼行數:29,代碼來源:udp_local_phone.py

示例2: getStatus

# 需要導入模塊: from pythonwifi.iwlibs import Wireless [as 別名]
# 或者: from pythonwifi.iwlibs.Wireless import getBitrate [as 別名]
	def getStatus(self):
		ifobj = Wireless(self.iface)
		fq = Iwfreq()
		try:
			self.channel = str(fq.getChannel(str(ifobj.getFrequency()[0:-3])))
		except:
			self.channel = 0
		status = {
				  'BSSID': str(ifobj.getAPaddr()), #ifobj.getStatistics()
				  'ESSID': str(ifobj.getEssid()),
				  'quality': "%s/%s" % (ifobj.getStatistics()[1].quality,ifobj.getQualityMax().quality),
				  'signal': str(ifobj.getStatistics()[1].siglevel-0x100) + " dBm",
				  'bitrate': str(ifobj.getBitrate()),
				  'channel': str(self.channel),
				  #'channel': str(fq.getChannel(str(ifobj.getFrequency()[0:-3]))),
		}
		
		for (key, item) in status.items():
			if item is "None" or item is "":
					status[key] = _("N/A")
				
		return status
開發者ID:FFTEAM,項目名稱:enigma2-5,代碼行數:24,代碼來源:Wlan.py

示例3:

# 需要導入模塊: from pythonwifi.iwlibs import Wireless [as 別名]
# 或者: from pythonwifi.iwlibs.Wireless import getBitrate [as 別名]
import os
import sys
from sys import platform as _platform
import time
import types
import pythonwifi.flags
from pythonwifi.iwlibs import Wireless, WirelessInfo, Iwrange, getNICnames, getWNICnames
     
if _platform== 'linux' or _platform== 'linux2':
 interface=Wireless('wlan1')
 stat, qual, discard, missed_beacon = interface.getStatistics()
 # Link Quality, Signal Level and Noise Level line
 wifi_parameters= 'Interface:      %s, SSID:           %s, Transmit Rate:  %s, Transmit Power: %s, RSSI:           %s'   % ('wlan1', interface.getEssid(), interface.getBitrate(), interface.getTXPower(), qual.signallevel)
 print wifi_parameters
elif _platform=='darwin':
 import objc
 objc.loadBundle('CoreWLAN',
                bundle_path='/System/Library/Frameworks/CoreWLAN.framework',
                module_globals=globals())

 for iname in CWInterface.interfaceNames():
  interface = CWInterface.interfaceWithName_(iname)
  print """
 Interface:      %s
 SSID:           %s
 Transmit Rate:  %s
 Transmit Power: %s
 RSSI:           %s""" % (iname, interface.ssid(), interface.transmitRate(),
                         interface.transmitPower(), interface.rssi())

開發者ID:baharxy,項目名稱:LTEWiFi-Measurements,代碼行數:31,代碼來源:sniff_wifi.py

示例4: sniff_wifi

# 需要導入模塊: from pythonwifi.iwlibs import Wireless [as 別名]
# 或者: from pythonwifi.iwlibs.Wireless import getBitrate [as 別名]
def sniff_wifi():
 if plat=='OSX':
  # bridge to objective c(apple stuff)
  objc.loadBundle('CoreWLAN',
                bundle_path='/System/Library/Frameworks/CoreWLAN.framework',
                module_globals=globals())

  for iname in CWInterface.interfaceNames():
    interface = CWInterface.interfaceWithName_(iname)
    wifi_parameters= 'Interface:      %s, SSID:           %s, Transmit Rate:  %s, Transmit Power: %s, RSSI:           %s' % (iname, interface.ssid(), interface.transmitRate(), interface.transmitPower(), interface.rssi())
 elif plat=='LINUX':
  interface=Wireless('wlan0')
  
  # Link Quality, Signal Level and Noise Level line
  wifi_parameters= 'Interface:      %s, SSID:           %s, Transmit Rate:  %s, Transmit Power: %s'   % ('wlan0',   interface.getEssid(), interface.getBitrate(), interface.getTXPower())
 
 #record wifi parameters
 print wifi_parameters
 open(channels_file, "a").write(wifi_parameters+'\n')
開發者ID:baharxy,項目名稱:LTEWiFi-Measurements,代碼行數:21,代碼來源:udp_local_phone_different_rates.py


注:本文中的pythonwifi.iwlibs.Wireless.getBitrate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。