source: ReferenceDesigns/w3_802.11/python/wlan_exp/docs/source/device.rst

Last change on this file was 6320, checked in by chunter, 5 years ago

1.8.0 release wlan-exp

File size: 1.5 KB

WLAN Device

?
.. include:: globals.rst

The WLAN device represents an 802.11 device in a WLAN network. This can be a node running the 802.11 Reference Design or a commercial 802.11 device.

Class Definition

?
.. autoclass:: wlan_exp.device.WlanDevice

Example

To create a WLAN device, first specify the MAC address and name of the device:

# WLAN devices
# Contains a list of tuples: (MAC Address, 'String description of device')
#  MAC addresses must be expressed as uint64 values
#  For example, use 0x0123456789AB for MAC address 01:23:45:67:89:AB
WLAN_DEVICE_LIST  = [(0x000000000000, 'My Device')]

Given the device parameters, create WLAN devices for each device:

# Setup WLAN devices
devices = []
for device in WLAN_DEVICE_LIST:
    devices.append(wlan_device.WlanDevice(mac_address=device[0], name=device[1]))

Finally, interact with the devices within the 802.11 Reference Design Experiments Framework:

# Wait for devices to associate with the AP
print("Waiting for devices to join:")
total_devices = len(devices)
tmp_devices   = list(devices)
num_joined    = 0
while (total_devices != num_joined):
    for device in tmp_devices:
        if n_ap.is_associated(device):
            print("    {0} joined".format(device.name))
            num_joined += 1
            tmp_devices.remove(device)
Note: See TracBrowser for help on using the repository browser.