Show
Ignore:
Timestamp:
07/29/09 00:31:04 (15 years ago)
Author:
trnewman
Message:

Functional DSA CBR, although it picks a random row.

Files:
1 modified

Legend:

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

    r389 r390  
    4747        def send_pkt(self, payload='', eof=False): 
    4848                return self.txpath.send_pkt(payload, eof) 
    49          
     49 
     50        def get_real_channel(channel): 
     51 
     52                real_channel = 1; 
     53 
     54                if channel == 1: 
     55                        real_channel = 1 
     56                if channel == 2: 
     57                        real_channel = 7 
     58                if channel == 3: 
     59                        real_channel = 8 
     60                if channel == 4: 
     61                        real_channel = 14 
     62 
     63                return real_channel 
     64 
    5065        def get_freq(hop_freq,probe_level,absent_time): 
    5166 
     
    5570                        channel = 1 
    5671                if hop_freq == 462712500: 
    57                         channel = 7 
     72                        channel = 2 
    5873                if hop_freq == 467562500: 
    59                         channel = 8 
     74                        channel = 3 
    6075                if hop_freq == 467712500: 
    61                         channel = 14 
     76                        channel = 4 
    6277 
    6378                p = Parameter(1) 
     
    7287 
    7388                p = GetOptimalParameters(o,1,currentParameters,1); 
    74                 print p[0].name, p[0].value 
    75          
     89                print p[0].value 
     90                 
     91                channel = get_real_channel(int(p[0].value)) 
     92 
    7693                if channel < 8: 
    7794                        hop_freq = float(1e6 * (462.5625+(channel-1)*0.025))#setting the centre freq frequency for sending packets 
     
    153170                        help="use file for packet contents") 
    154171         
    155         transmit_path.add_options(parser_tx, expert_grp_tx) 
     172        transmit_path.add_options(parser_tx, expert_grp_tx) 
    156173 
    157174        for mod in mods.values(): 
     
    228245        ch_energy = tb.rxpath.probe.level() #setting initial value 
    229246        hop_freq = options_tx.tx_freq #  = options_rx.rx_freq...same for tx and rx side 
    230         while running: 
     247         
     248 
     249        # Scan all channels first for inital data 
     250 
     251        while running: 
    231252 
    232253                ################################################sync mode####################################