Show
Ignore:
Timestamp:
10/03/09 18:48:33 (15 years ago)
Author:
bhilburn
Message:

Numerous changes. A VTCROSS shell can now be remote relative to the radio host platform. The remote server/port is set through a new function in libvtcross, which has also been added as an option to the benchmark_dsa script. Other changes include bug fixes in the benchmark code and some SQL fixes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/cross-examples/python/gnuradio-examples/benchmark_dsa.py

    r493 r498  
    6666def main(): 
    6767 
    68     global stats_array, count_array, time_array, n_rcvd, n_right,sync_status,mode,ch,traffic_flag,n_attempts,return_flag 
     68    global stats_array, count_array, time_array, n_rcvd 
     69    global n_right, sync_status, mode, ch, traffic_flag,  
     70    global n_attempts, return_flag, crossShellHost, crossShellPort 
     71 
    6972    n_rcvd = 0 
    7073    n_right = 0 
     
    137140                    UpdateParameterPerformance(currentParameters,1,o,1) 
    138141                except: 
    139                     print "fail" 
    140142            else: 
    141143                # Get the average communication time 
     
    170172            if ok: 
    171173                (pktno,) = struct.unpack('!H', payload[0:2]) 
    172                    (sync_signal,) = struct.unpack('!s', payload[2])  
     174                (sync_signal,) = struct.unpack('!s', payload[2])  
    173175                (data_channel,) = struct.unpack('!H', payload[3:5]) 
    174176                                   
     
    198200        ############################################################## 
    199201 
    200        n_rcvd += 1 
    201        if ok: 
    202            n_right += 1 
     202        n_rcvd += 1 
     203        if ok: 
     204            n_right += 1 
    203205 
    204206    mods = modulation_utils.type_1_mods() 
    205207    demods = modulation_utils.type_1_demods() 
     208 
     209    # Set default values for the CROSS shell location. These can be overridden 
     210    # via command-line parameters 
     211    crossShellHost = "localhost" 
     212    crossShellPort = "40000" 
    206213 
    207214    #setting up the tx options parser 
     
    220227    parser_tx.add_option("","--from-file", default=None, 
    221228                          help="use file for packet contents") 
     229    parser_tx.add_option("-h", "--hostname", action="store", type="string", dest="crossShellHost", 
     230            default="localhost", help="Set the hostname/IP for the VTCROSS shell"); 
     231    parser_tx.add_option("-p", "--port", action="store", type="string", dest="crossShellPort", 
     232            default="40000", help="Set the port for the VTCROSS shell"); 
    222233  
    223234    expert_grp_tx = parser_tx.add_option_group("Expert_tx") 
     
    268279    parser_rx.add_option("-T", "--threshold", type="eng_float", default=1.5e8, 
    269280                          help="set primary user sensing energy threshold [default=%default]") 
    270  
     281    parser_rx.add_option("-h", "--hostname", action="store", type="string", dest="crossShellHost", 
     282            default="localhost", help="Set the hostname/IP for the VTCROSS shell"); 
     283    parser_rx.add_option("-p", "--port", action="store", type="string", dest="crossShellPort", 
     284            default="40000", help="Set the port for the VTCROSS shell"); 
     285  
    271286 
    272287 
     
    290305        else: 
    291306            print "[[ Using the CROSS DSA Cognitive Engine ]]" 
     307            print "[[ VTCROSS shell located at " + crossShellHost + ":" + crossShellPort + " ]]" 
     308            SetCrossShellLocation(crossShellHost, crossShellPort) 
    292309    else: 
    293310        print "[[ Using the RANDOM channel selection algorithm ]]\n\n"