119 | | == Tx/Rx Entry Changes == |
| 119 | === Entry Type Constants === |
| 120 | Various log entry type fields encode values as "magic" numbers. The C code uses {{{#define}}} and {{{enum}}} to encode the field values. Starting in v1.5 the wlan_exp framework provides a convenient container to encode the same constants for use in log processing scripts. The constant definitions are stored per log entry type. The constants for a given entry type can be retrieved with {{{c = log_util.get_entry_constants('ENTRY_TYPE_NAME')}}}. The return value is a dictionary-like object with keys for each field in the log entry with constant definitions. The constants dictionary can be accessed with normal dictionary syntax {{{d['field']}}} or with field names as properties {{{d.field}}}. The contents of the returned object cannot be changed. |
| 121 | |
| 122 | For example, consider the {{{RX_OFDM}}} entry type: |
| 123 | {{{#!python |
| 124 | >>> c_rx = log_util.get_entry_constants('RX_OFDM') |
| 125 | >>> c_rx |
| 126 | {'flags': {'DUPLICATE': 2, 'FCS_GOOD': 1, 'LTG': 128, 'LTG_PYLD': 64}, |
| 127 | 'phy_mode': {'DSSS': 0, 'HTMF': 2, 'NONHT': 1}, |
| 128 | 'pkt_type': {'ACK': 212, |
| 129 | 'BEACON': 128, |
| 130 | 'CTS': 196, |
| 131 | 'DATA': 8, |
| 132 | 'NULLDATA': 72, |
| 133 | 'PROBE_RESP': 80, |
| 134 | 'QOSDATA': 136, |
| 135 | 'RTS': 180}} |
| 136 | |
| 137 | >>> c_rx.phy_mode['HTMF'] |
| 138 | 2 |
| 139 | }}} |
| 140 | |
| 141 | === Tx/Rx Entry Changes === |