Public Member Functions | Public Attributes | Private Member Functions
rocon_python_wifi.iwlibs.Wireless Class Reference

List of all members.

Public Member Functions

def __init__
def commit
def getAPaddr
def getBitrate
def getBitrates
def getChannelInfo
def getEncryption
def getEssid
def getFragmentation
def getFrequency
def getKey
def getKeys
def getMode
def getPowermanagement
def getQualityAvg
def getQualityMax
def getRetrylimit
def getRTS
def getSensitivity
def getStatistics
def getTXPower
def getWirelessName
def scan
def setAPaddr
def setEncryption
def setEssid
def setFrequency
def setKey
def setMode

Public Attributes

 ifname
 iwstruct
 sockfd
 wireless_info

Private Member Functions

def _formatBitrate
def _formatFrequency

Detailed Description

Provides high-level access to wireless interfaces.

    This class uses WirelessInfo for most access.

Definition at line 128 of file iwlibs.py.


Constructor & Destructor Documentation

def rocon_python_wifi.iwlibs.Wireless.__init__ (   self,
  ifname 
)

Definition at line 135 of file iwlibs.py.


Member Function Documentation

def rocon_python_wifi.iwlibs.Wireless._formatBitrate (   self,
  raw_bitrate 
) [private]
Returns formatted bitrate.

    'raw_bitrate' -- long -- The unformatted bitrate as a long integer.

Definition at line 189 of file iwlibs.py.

def rocon_python_wifi.iwlibs.Wireless._formatFrequency (   self,
  raw_frequency 
) [private]
Returns formatted frequency.

    'raw_frequency' -- long -- The unformatted frequency as a long
integer.

Definition at line 230 of file iwlibs.py.

Commit pending changes. 

Definition at line 687 of file iwlibs.py.

Returns the access point MAC address.

    >>> from iwlibs import Wireless, getNICnames
    >>> ifnames = getNICnames()
    >>> ifnames
    ['eth1', 'wifi0']
    >>> wifi = Wireless(ifnames[0])
    >>> wifi.getAPaddr()
    '00:0D:88:8E:4E:93'

    Test with non-wifi card:
    >>> wifi = Wireless('eth0')
    >>> wifi.getAPaddr()
    (95, 'Operation not supported')

    Test with non-existant card:
    >>> wifi = Wireless('eth2')
    >>> wifi.getAPaddr()
    (19, 'No such device')

Definition at line 141 of file iwlibs.py.

Returns the device's currently set bit rate in Mbit.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getBitrate()
    '11 Mb/s'

Definition at line 202 of file iwlibs.py.

Returns the number of bitrates available for the device.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> num, rates = wifi.getBitrates()
    >>> num == len(rates)
    True

Definition at line 214 of file iwlibs.py.

Returns the number of channels and available frequencies for
   the device.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> num, rates = wifi.getChannelInfo()
    >>> num == len(rates)
    True

Definition at line 253 of file iwlibs.py.

Get the association mode, which is probably a string of '*',
    'open', 'private', 'off'.

    As a normal user, you will get an 'Operation not permitted'
    error:

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getEncryption()
    (1, 'Operation not permitted')

Definition at line 300 of file iwlibs.py.

Returns the current ESSID information.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getEssid()
    'romanofski'

Definition at line 270 of file iwlibs.py.

Returns the fragmentation threshold.

    It depends on what the driver says. If you have fragmentation
    threshold turned on, you'll get an int. If it's turned off
    you'll get a string: 'off'.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getFragmentation()
    'off'

Definition at line 442 of file iwlibs.py.

Returns currently set frequency of the card.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getFrequency()
    '2.417 GHz'

Definition at line 460 of file iwlibs.py.

def rocon_python_wifi.iwlibs.Wireless.getKey (   self,
  key = 0,
  formatted = True 
)
Get an encryption key.

    key 0 is current key, otherwise, retrieve specific key (1-4)

    As a normal user, you will get an 'Operation not permitted'
    error:

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getKey()
    ABCD-9512-34

Definition at line 362 of file iwlibs.py.

Get all encryption keys.

    Returns a list of tuples.

    As a normal user, you will get a 'Operation not permitted'
    error:

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getKeys()
    [(1, '1234-5678-91'), (2, None), (3, 'ABCD-EFAB-CD'), (4, None)]

Definition at line 421 of file iwlibs.py.

Returns currently set operation mode.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getMode()
    'Managed'

Definition at line 510 of file iwlibs.py.

Returns the power management settings.

    #>>> from iwlibs import Wireless
    #>>> wifi = Wireless('eth1')
    #>>> wifi.getPowermanagement()
    #'off'

Definition at line 547 of file iwlibs.py.

Returns an Iwquality object with average quality information.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> aq = wifi.getQualityAvg()
    >>> print "quality:", aq.quality, "signal:", aq.siglevel, "noise:", aq.nlevel
    quality: 38 signal: 13 noise: 0

Definition at line 579 of file iwlibs.py.

Returns an Iwquality object with maximum quality information.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> mq = wifi.getQualityMax()
    >>> print "quality:", mq.quality, "signal:", mq.siglevel, "noise:", mq.nlevel
    quality: 38 signal: 13 noise: 0

Definition at line 564 of file iwlibs.py.

Returns the retry/lifetime limit.

    man iwconfig:
"Most cards have MAC retransmissions, and some allow to set
the behaviour of the retry mechanism."

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getRetrylimit()
    16

Definition at line 594 of file iwlibs.py.

Returns the RTS threshold, likely to be int, 'auto',
    'fixed', 'off'

    man iwconfig:
"RTS/CTS adds a handshake before each packet transmission to
make sure that the channel is clear. This adds overhead, but
increases performance in case of hidden nodes or a large
number of active nodes. This parameter sets the size of the
smallest packet for which the node sends RTS; a value equal
to the maximum packet size disable the mechanism."

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getRTS()
    'off'

Definition at line 610 of file iwlibs.py.

Returns sensitivity information.

    man iwconfig:
"This is the lowest signal level for which the hardware
attempt packet reception, signals weaker than this are
ignored. This is used to avoid receiving background noise,
so you should set it according to the average noise
level. Positive values are assumed to be the raw value used
by the hardware or a percentage, negative values are
assumed to be dBm."

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getSensitivity()
    'off'

Definition at line 633 of file iwlibs.py.

Returns statistics information which can also be found in
    /proc/net/wireless.

Definition at line 672 of file iwlibs.py.

Returns the transmit power in dBm.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getTXPower()
    '17 dBm'

Definition at line 654 of file iwlibs.py.

Returns the wireless name.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getWirelessName()
    'IEEE 802.11-DS'

Definition at line 536 of file iwlibs.py.

Returns Iwscanresult objects, after a successful scan. 

Definition at line 683 of file iwlibs.py.

def rocon_python_wifi.iwlibs.Wireless.setAPaddr (   self,
  addr 
)
Sets the access point MAC address.

    translated from iwconfig.c
    
    FIXME: This needs to check address type before acting.

Definition at line 165 of file iwlibs.py.

Set the association mode.

    As a normal user, you will get an 'Operation not permitted'
    error:

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.setEncryption()
    (1, 'Operation not permitted')

Definition at line 330 of file iwlibs.py.

def rocon_python_wifi.iwlibs.Wireless.setEssid (   self,
  essid 
)
Sets the ESSID.

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.getEssid()
    'romanofski'
    >>> wifi.setEssid('Joost')
    >>> wifi.getEssid()
    'Joost'

Definition at line 281 of file iwlibs.py.

Sets the frequency on the card.

   translated from iwconfig.c

Definition at line 472 of file iwlibs.py.

def rocon_python_wifi.iwlibs.Wireless.setKey (   self,
  key,
  index = 1 
)
Set an encryption key.

    As a normal user, you will get an 'Operation not permitted'
    error:

    >>> from iwlibs import Wireless
    >>> wifi = Wireless('eth1')
    >>> wifi.setKey()

Definition at line 393 of file iwlibs.py.

def rocon_python_wifi.iwlibs.Wireless.setMode (   self,
  mode 
)
Sets the operation mode.

Definition at line 521 of file iwlibs.py.


Member Data Documentation

Definition at line 135 of file iwlibs.py.

Definition at line 135 of file iwlibs.py.

Definition at line 135 of file iwlibs.py.

Definition at line 135 of file iwlibs.py.


The documentation for this class was generated from the following file:


rocon_python_wifi
Author(s): RĂ³man Joost, Sean Robinson
autogenerated on Fri May 2 2014 10:35:45