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
RevLine 
[6320]1.. _wlan_exp_device:
2
3.. include:: globals.rst
4
5###########
6WLAN Device
7###########
8
9The WLAN device represents an 802.11 device in a WLAN network. This can be
10a node running the 802.11 Reference Design or a commercial 802.11 device.
11
12****************
13Class Definition
14****************
15
16.. autoclass:: wlan_exp.device.WlanDevice
17
18
19Example
20=======
21
22To create a WLAN device, first specify the MAC address and name of the device::
23
24    # WLAN devices
25    # Contains a list of tuples: (MAC Address, 'String description of device')
26    #  MAC addresses must be expressed as uint64 values
27    #  For example, use 0x0123456789AB for MAC address 01:23:45:67:89:AB
28    WLAN_DEVICE_LIST  = [(0x000000000000, 'My Device')]
29
30Given the device parameters, create WLAN devices for each device::
31
32    # Setup WLAN devices
33    devices = []
34   
35    for device in WLAN_DEVICE_LIST:
36        devices.append(wlan_device.WlanDevice(mac_address=device[0], name=device[1]))
37
38Finally, interact with the devices within the 802.11 Reference Design Experiments Framework::
39
40    # Wait for devices to associate with the AP
41    print("Waiting for devices to join:")
42
43    total_devices = len(devices)
44    tmp_devices   = list(devices)
45    num_joined    = 0
46
47    while (total_devices != num_joined):
48   
49        for device in tmp_devices:
50            if n_ap.is_associated(device):
51                print("    {0} joined".format(device.name))
52                num_joined += 1
53                tmp_devices.remove(device)
Note: See TracBrowser for help on using the repository browser.