Changes between Version 17 and Version 18 of 802.11/wlan_exp/log/entry_types
- Timestamp:
- Jan 12, 2017, 1:58:20 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
802.11/wlan_exp/log/entry_types
v17 v18 13 13 Users can define new log entry types or modify existing types to support their experiment. The requirements for this are documented below. 14 14 15 == Reference Design Entry Types == 16 The sections below document the log entry types defined in the latest 802.11 Reference Design C and Python code. 15 == Pre-Defined Constants == 17 16 18 This listing is generated directly from the [source:/ReferenceDesigns/w3_802.11/python/wlan_exp/log/entry_types.py entry_types.py] file in the wlan_exp Python package. You can generate a text version of the entry type list with this code: 17 The values for some log entry fields are drawn from a pre-defined set of constants. For example, the {{{phy_mode}}} fields in Tx/Rx entries have integer values in {{{[0..2]}}} representing DSSS, NONHT or HTMF PHY modes. 18 19 The log entry type definitions in Python include lists of the pre-defined constants for each field. You can access these pre-defined constants with the {{{get_entry_constants('Entry_Type')}}} method. This method returns an object with an attribute for each field with constant definitions; each per-field attribute has an attribute per constant. For example: 20 19 21 {{{#!python 20 from wlan_exp.log.entry_types import log_entry_types as log_entry_types 22 import wlan_exp.log.util as log_util 21 23 22 for tid in log_entry_types.keys(): 23 if(type(tid) is int and tid != 0): #only take int type IDs and skip NULL 24 print(log_entry_types[tid].generate_entry_doc(fmt='txt')) 24 # Retrieve constants for TX_LOW entries 25 TX_CONSTS = log_util.get_entry_constants('TX_LOW') 26 27 # Filter an array of TX_LOW entries by pkt_type 28 # Assumes tx_low is numpy array of TX_HIGH entries 29 tx_low_idx = (tx_low['pkt_type'] == TX_CONSTS.pkt_type.BEACON) 30 tx_low_beacons = tx_low[tx_low_idx] 25 31 }}} 26 32 33 Here {{{TX_CONSTS.pkt_type.BEACON}}} encodes the constant value for the {{{pkt_type}}} field indicating the {{{TX_LOW}}} entry contains a Beacon packet. 34 35 The entry type documentation below includes the full list of pre-defined constant names and values. 36 37 ---- 27 38 28 39 {{{#!comment 40 ########### 41 START of entry type list 42 ########### 43 29 44 Note to selves: 30 45 … … 36 51 37 52 }}} 38 39 ----40 53 41 54 [[Include(source:/ReferenceDesigns/w3_802.11/python/wlan_exp/log/entry_type_wiki_docs.txt, text/x-trac-wiki)]] … … 97 110 || s16 / signed short || h || int16 || 98 111 || s32 / signed int || i || int32 || 112 113 ---- 114 == Reference Design Entry Types == 115 The list of log entry types above is auto-generated from the [source:/ReferenceDesigns/w3_802.11/python/wlan_exp/log/entry_types.py entry_types.py] source code in the wlan_exp Python package. You can generate a text version of the entry type list with this code: 116 117 {{{#!python 118 from wlan_exp.log.entry_types import log_entry_types as log_entry_types 119 120 for tid in log_entry_types.keys(): 121 if(type(tid) is int and tid != 0): #only take int type IDs and skip NULL 122 print(log_entry_types[tid].generate_entry_doc(fmt='txt')) 123 }}}