Changeset 395

Show
Ignore:
Timestamp:
07/30/09 11:04:21 (15 years ago)
Author:
trnewman
Message:

Renaming to reflect origins.

Files:
1 moved

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/cognitive_engines/DSA_CE/examples/gnuradio-examples/benchmark_dsa.py

    r392 r395  
    9898                o[0].name = "energy" 
    9999         
    100                 print probe_level 
    101          
    102100                o[1].value = absent_time  
    103101                o[1].name = "communication_time" 
     
    127125 
    128126                stats_array[int(p[0].value)] = stats_array[int(p[0].value)] + 1 
    129                 print "Stats:: 1..",stats_array[1]," 2..",stats_array[2]," 3..",stats_array[3]," 4..",stats_array[4]  
    130127                return channel,hop_freq #returning the channel number and hop frequency 
    131128         
     
    153150                                        ack_payload = struct.pack('!HsH', pktno & 0xffff,data,ch & 0xffff) #+ data 
    154151                                        send_pkt(tb,ack_payload) #sending back the acknowledgement 
    155                         #else: 
    156                         #       print "sync packet not ok\n" 
    157152                ################################################################### 
    158153                 
     
    168163                                        send_pkt(tb,payload) 
    169164                                 
    170                         #else: 
    171                         #       print "data packet not ok\n" 
    172165                ############################################################## 
    173166 
     
    175168                if ok: 
    176169                        n_right += 1 
    177  
    178                 #print "ok = %5s  pktno = %4d  n_rcvd = %4d  n_right = %4d" % ( 
    179                 #    ok, pktno, n_rcvd, n_right) 
    180                  
    181170 
    182171        mods = modulation_utils.type_1_mods() 
     
    231220                sys.exit(1) 
    232221 
    233         #if options_tx.from_file is not None: 
    234         #       source_file = open(options_tx.from_file, 'r') 
    235              
    236222        parser_rx = OptionParser (option_class=eng_option, conflict_handler="resolve") 
    237223        expert_grp_rx = parser_rx.add_option_group("Expert_rx") 
    238         #parser_rx.add_option("-m", "--modulation", type="choice", choices=demods.keys(), 
    239         #               default='gmsk', 
    240         #               help="Select modulation from: %s [default=%%default]" 
    241         #                       % (', '.join(demods.keys()),)) 
    242          
    243224        receive_path.add_options(parser_rx, expert_grp_rx) 
    244225 
    245         #for mod in demods.values(): 
    246         #       mod.add_options(expert_grp_rx) 
    247  
    248226        (options_rx, args_rx) = parser_rx.parse_args () 
    249227 
    250         #if len(args_rx) != 0: 
    251         #       parser_rx.print_help(sys.stderr) 
    252         #       sys.exit(1) 
    253228        ############# Setting some default values for rx side of the block 
    254229        options_rx.rx_freq = 462.5625e6 #setting default rx_freq value 
     
    260235        ############# 
    261236 
    262         #if options_rx.rx_freq is None: 
    263         #       sys.stderr.write("You must specify -f FREQ or --freq FREQ\n") 
    264         #       parser_rx.print_help(sys.stderr) 
    265         #       sys.exit(1) 
    266          
    267237        # build the graph 
    268238 
     
    286256        time.sleep(0.1) 
    287257 
     258        print "\n[[ Scanning channels for network nodes ]]\n" 
    288259        while running: 
    289260 
     
    329300                         
    330301                        else: 
    331                                 print "sync channel found..channel ",ch,"\n"   
     302                                print "\n\n[[ Network Node Found: Commencing communications on CHANNEL ", ch, " ]]\n"; 
    332303                                n_attempts_counter = 0 
    333304                                mode = "traffic" 
     
    359330                                                                 
    360331                                send_pkt(tb,payload) 
    361                                 #print "printing payload",data,"**\n" 
    362332                                n += len(payload) 
    363333                                sys.stderr.write('.') 
     
    379349                                        _elapsed_time  = start_time - stop_time 
    380350                                        elapsed_time = _elapsed_time.seconds 
    381                                         print "primary user detected..moving out of this channel\n" 
     351                                        print "\n[[ Primary User Detected:  Evacuating Current Channel ]]\n" 
     352                                        print "\n[[ Scanning channels for network nodes ]]\n" 
    382353                                        mode = "sync" 
    383354                                        return_flag = 1