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


Python Wireless.getTXPower方法代码示例

本文整理汇总了Python中pythonwifi.iwlibs.Wireless.getTXPower方法的典型用法代码示例。如果您正苦于以下问题:Python Wireless.getTXPower方法的具体用法?Python Wireless.getTXPower怎么用?Python Wireless.getTXPower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pythonwifi.iwlibs.Wireless的用法示例。


在下文中一共展示了Wireless.getTXPower方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: sniff_wifi

# 需要导入模块: from pythonwifi.iwlibs import Wireless [as 别名]
# 或者: from pythonwifi.iwlibs.Wireless import getTXPower [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:

# 需要导入模块: from pythonwifi.iwlibs import Wireless [as 别名]
# 或者: from pythonwifi.iwlibs.Wireless import getTXPower [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

示例3: sniff_wifi

# 需要导入模块: from pythonwifi.iwlibs import Wireless [as 别名]
# 或者: from pythonwifi.iwlibs.Wireless import getTXPower [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.getTXPower方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。