{{{#!comment [[Include(wiki:802.11/beta-note)]] }}} [[TracNav(802.11/TOC)]] = 802.11 Reference Design: Porting to wlan_exp v1.5 = The 802.11 Reference Design v1.5 release included many improvements to the wlan_exp Python package. These improvements required numerous API changes. The [../examples example wlan_exp scripts] have been updated with the new v1.5 API. In order to assist with porting custom scrtips, the sections below highlight some of the changes from v1.4 to v1.5. {{{#!comment 1) Replaced the following: ------------------ if (((len(n_ap_l) == 1) and (len(n_sta_l) == 1))): # Extract the two nodes from the lists for easier referencing below n_ap = n_ap_l[0] n_sta = n_sta_l[0] ------------------ with ------------------ if len(n_ap_l) == 1 and len(n_sta_l) == 1: # Setup the two nodes n_ap = n_ap_l[0] n_sta = n_sta_l[0] # Configure the AP to reject authentication requests from wireless clients # - Uncomment this line to block any wireless associations during the experiment # node1.set_authentication_address_filter(allow='NONE') # Configure AP BSS n_ap.configure_bss(ssid=AP_SSID, channel=CHANNEL, beacon_interval=100) # Establish the association between nodes # - This will change the STA to the appropriate channel n_ap.add_association(n_sta) ------------------ 2) Replaced the following: ------------------ # Put each node in a known, good state for node in nodes: node.reset_all() # Set all nodes to be on the same channel node.set_channel(CHANNEL) # Remove any current association information node.disassociate_all() # Get some additional information about the experiment channel = node.get_channel() print("\n{0}:".format(node.name)) print(" Channel = {0}".format(wlan_exp_util.channel_to_str(channel))) ------------------ with ------------------ # Put each node in a known, good state for node in nodes: node.reset(log=True, txrx_counts=True, ltg=True, queue_data=True) ------------------ set_channel() and get_channel() no longer exist 3) Removed the following: ------------------ # Set the network SSID ssid = n_ap.set_ssid(AP_SSID) print("AP SSID: '{0}'\n".format(ssid)) ------------------ 4) Replaced the following: ------------------ for idx_r,rate_num in enumerate(rates): rates_mbps[idx_r] = wlan_exp_util.wlan_rates[rate_num]['rate'] ------------------ with ------------------ phy_mode = wlan_exp_util.phy_modes['HTMF'] for idx_r,rate_num in enumerate(rates): rate_info = wlan_exp_util.get_rate_info(rate_num, phy_mode) rates_mbps[idx_r] = rate_info['phy_rate'] ------------------ 5) Replaced the following: ------------------ n_ap.ap_configure(support_power_savings=False) #Disable DTIM bcast blanking ------------------ with ------------------ n_ap.enable_DTIM_multicast_buffering(False) #Disable DTIM bcast blanking ------------------ 6) Replaced the following: ------------------ rate = wlan_exp_util.wlan_rates[rate_num] n_ap.set_tx_rate_unicast(rate, curr_assoc=True, new_assoc=True) n_sta.set_tx_rate_unicast(rate, curr_assoc=True, new_assoc=True) n_ap.set_tx_rate_multicast_data(rate) n_sta.set_tx_rate_multicast_data(rate) ------------------ with ------------------ n_ap.set_tx_rate_unicast(rate_num, phy_mode, curr_assoc=True, new_assoc=True) n_ap.set_tx_rate_multicast_data(rate_num, phy_mode) n_sta.set_tx_rate_unicast(rate_num, phy_mode, curr_assoc=True, new_assoc=True) n_sta.set_tx_rate_multicast_data(rate_num, phy_mode) ------------------ 7) Replaced the following: ------------------ sta_time_span = float(sta_rx_stats_end['timestamp'] - sta_rx_stats_start['timestamp']) ------------------ with ------------------ sta_time_span = float(sta_rx_stats_end['retrieval_timestamp'] - sta_rx_stats_start['retrieval_timestamp']) ------------------ 8) Replaced the following: ------------------ # Generate indexes with just Tx and Rx events entries_filt = ['NODE_INFO', 'RX_OFDM', 'TX', 'TX_LOW'] entries_merge = {'RX_OFDM': ['RX_OFDM', 'RX_OFDM_LTG'], 'TX' : ['TX', 'TX_LTG'], 'TX_LOW' : ['TX_LOW', 'TX_LOW_LTG']} log_index_txrx_sta = log_util.filter_log_index(raw_log_index_sta, include_only=entries_filt, merge=entries_merge) # Generate numpy arrays log_np_sta = log_util.log_data_to_np_arrays(log_data_sta, log_index_txrx_sta) rx_sta = log_np_sta['RX_OFDM'] rx_sta_idx = (rx_sta['addr2'] == n_ap.wlan_mac_address) & ((rx_sta['flags'] & 0x1) == 0) & (rx_sta['fcs_result'] == 0) & ( (rx_sta['pkt_type'] == 2) | (rx_sta['pkt_type'] == 3) ) rx_sta_from_ap = rx_sta[rx_sta_idx] ------------------ with ------------------ entries_filt = ['NODE_INFO', 'RX_OFDM', 'TX_HIGH', 'TX_LOW'] entries_merge = {'RX_OFDM': ['RX_OFDM', 'RX_OFDM_LTG'], 'TX_HIGH': ['TX_HIGH', 'TX_HIGH_LTG'], 'TX_LOW' : ['TX_LOW', 'TX_LOW_LTG']} log_index_txrx_sta = log_util.filter_log_index(raw_log_index_sta, include_only=entries_filt, merge=entries_merge) # Generate numpy arrays log_np_sta = log_util.log_data_to_np_arrays(log_data_sta, log_index_txrx_sta) rx_sta = log_np_sta['RX_OFDM'] rx_sta_idx = ((rx_sta['addr2'] == n_ap.wlan_mac_address) & (((rx_sta['flags'] & RX_CONSTS.flags.DUPLICATE) == 0) & ((rx_sta['flags'] & RX_CONSTS.flags.FCS_GOOD) != 0) & ((rx_sta['pkt_type'] == RX_CONSTS.pkt_type.DATA) | (rx_sta['pkt_type'] == RX_CONSTS.pkt_type.QOSDATA) | (rx_sta['pkt_type'] == RX_CONSTS.pkt_type.NULLDATA)))) rx_sta_from_ap = rx_sta[rx_sta_idx] ------------------ }}}