Beispiel #1
0
log_np = log_util.log_data_to_np_arrays(log_data, log_index)

###############################################################################
# Example 0: Print node info / Time info
log_node_info = log_np['NODE_INFO'][0]

print("Node Info:")
print("  Node Type    : {0}".format(
    wlan_exp_util.node_type_to_str(log_node_info['node_type'])))
print("  MAC Address  : {0}".format(
    wlan_exp_util.mac_addr_to_str(log_node_info['wlan_mac_addr'])))
print("  Serial Number: {0}".format(
    wlan_exp_util.sn_to_str(log_node_info['platform_id'],
                            log_node_info['serial_num'])))
print("  WLAN Exp Ver : {0}".format(
    wlan_exp_util.ver_code_to_str(log_node_info['version'])))
print("")

if (len(log_np['TIME_INFO']) > 0):
    log_time_info = log_np['TIME_INFO'][0]

    print("Experiment Started at: {0}".format(
        time.ctime(float(log_time_info['host_timestamp'] / 1E6))))
    print("")

###############################################################################
# Example 1: Gather some Tx information from the log
#     - Since there are only loops, this example can deal with TX_HIGH / TX_LOW
#       being an empty list and does not need a try / except.
#
Beispiel #2
0
    print("Length    = {0}".format(info['length']))

###############################################################################
# Example 0: Print node info / Time info
log_node_info = log_np['NODE_INFO'][0]

print("Node Info:")
print("  Node Type    : {0}".format(
    wlan_exp_util.node_type_to_str(log_node_info['node_type'])))
print("  MAC Address  : {0}".format(
    wlan_exp_util.mac_addr_to_str(log_node_info['wlan_mac_addr'])))
print("  Serial Number: {0}".format(
    wlan_exp_util.sn_to_str(log_node_info['hw_generation'],
                            log_node_info['serial_num'])))
print("  WLAN Exp Ver : {0}".format(
    wlan_exp_util.ver_code_to_str(log_node_info['wlan_exp_ver'])))
print("")

if (len(log_np['TIME_INFO']) > 0):
    log_time_info = log_np['TIME_INFO'][0]

    print("Experiment Started at: {0}".format(
        time.ctime(float(log_time_info['abs_time'] / 1E6))))
    print("")

###############################################################################
# Example 1: Count the number of receptions per PHY rate
#   NOTE:  Since there are only loops, this example can deal with RX_OFDM being an
#          empty list and does not need a try / except.
#
# Unpack the log into numpy structured arrays
#   log_data_to_np_arrays returns a dictionary with one key-value pair per
#    entry type included in the log_index argument. The log_index keys are reused
#    as the output dictionary keys. Each output dictionary value is a numpy record array
#    Refer to wlan_exp_log.log_entries.py for the definition of each record array datatype
log_np = log_util.log_data_to_np_arrays(log_data, log_index)

###############################################################################
# Example 0: Print node info / Time info
log_node_info = log_np['NODE_INFO'][0]

print("Node Info:")
print("  Node Type    : {0}".format(wlan_exp_util.node_type_to_str(log_node_info['node_type'])))
print("  MAC Address  : {0}".format(wlan_exp_util.mac_addr_to_str(log_node_info['wlan_mac_addr'])))
print("  Serial Number: {0}".format(wlan_exp_util.sn_to_str(log_node_info['hw_generation'], log_node_info['serial_num'])))
print("  WLAN Exp Ver : {0}".format(wlan_exp_util.ver_code_to_str(log_node_info['wlan_exp_ver'])))
print("")

if(len(log_np['TIME_INFO']) > 0):
    log_time_info = log_np['TIME_INFO'][0]

    print("Experiment Started at: {0}".format(time.ctime(float(log_time_info['abs_time'] / 1E6))))
    print("")

###############################################################################
# Example 1: Count the number of receptions per PHY rate
#   NOTE:  Since there are only loops, this example can deal with RX_OFDM being an
#          empty list and does not need a try / except.
#

# Extract all OFDM transmissions and receptions
Beispiel #4
0
    exp_info = log_np['EXP_INFO']

    for info in exp_info:
        print("Timestamp = {0}".format(info['timestamp']))
        print("Info Type = {0}".format(info['info_type']))
        print("Length    = {0}".format(info['length']))

###############################################################################
# Example 0: Print node info / Time info
    log_node_info = log_np['NODE_INFO'][0]

    print("Node Info:")
    print("  Node Type    : {0}".format(wlan_exp_util.node_type_to_str(log_node_info['node_type'])))
    print("  MAC Address  : {0}".format(wlan_exp_util.mac_addr_to_str(log_node_info['wlan_mac_addr'])))
    print("  Serial Number: {0}".format(wlan_exp_util.sn_to_str(log_node_info['hw_generation'], log_node_info['serial_num'])))
    print("  WLAN Exp Ver : {0}".format(wlan_exp_util.ver_code_to_str(log_node_info['wlan_exp_ver'])))
    print("")

    if(len(log_np['TIME_INFO']) > 0):
        log_time_info = log_np['TIME_INFO'][0]

        print("Experiment Started at: {0}".format(time.ctime(float(log_time_info['abs_time'] / 1E6))))
        print("")
    
#################################################################################################
# Example 3: Calculate total number of packets and bytes received from each distinct MAC address
# Here distinction between data, management and control packets could be carried out.

    # Skip this example if the log doesn't contain RX events
    if('RX_OFDM' in log_np.keys()):