Changeset 5681

Show
Ignore:
Timestamp:
11/03/07 17:45:54 (7 years ago)
Author:
jgaeddert
Message:

hacking port id to scan properly

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • experimental/components/CIREN_SM/trunk/CIREN_SM/CIREN_SM.cpp

    r5677 r5681  
    103103    rx_power_threshold_hi = 35.0f; 
    104104    spectrumSensingFlag = false; 
    105     switch_scan = 50; 
    106     switch_linger = 100; 
     105    switch_scan = 100; 
     106    switch_linger = 500; 
    107107    switch_dwell = 10000; 
    108108    opMode = SCAN; 
     
    403403    switch (m) { 
    404404    case SCAN: 
    405         DEBUG(2, CIREN_SM, "switching mode to scan"); 
     405        DEBUG(0, CIREN_SM, "switching mode to scan"); 
    406406        dwell_packet_switch = switch_scan; 
    407407        break; 
    408408    case LINGER: 
    409         DEBUG(2, CIREN_SM, "switching mode to linger"); 
     409        DEBUG(0, CIREN_SM, "switching mode to linger"); 
    410410        dwell_packet_switch = switch_linger; 
    411411        break; 
    412412    case DWELL: 
    413         DEBUG(2, CIREN_SM, "switching mode to dwell"); 
     413        DEBUG(0, CIREN_SM, "switching mode to dwell"); 
    414414        dwell_packet_switch = switch_dwell; 
    415415        break; 
     
    431431        portTxDataIn->getData(I_in_tx, Q_in_tx, tx_metadata); 
    432432        N_in = I_in_tx->length(); 
    433         if (opMode == SCAN) 
    434            SwitchOperationalMode(LINGER); 
     433        if (tx_metadata->port_id == 127) { 
     434            dwell_packet_counter = 0; 
     435            SwitchOperationalMode(LINGER); 
     436        } 
    435437 
    436438        // process data here 
     
    525527        sensing_counter++; 
    526528        scan_energy = 0.01f; 
    527         if (opMode != DWELL || (opMode == DWELL && sensing_counter >= 100) ) { 
     529        if (opMode == SCAN || (opMode == DWELL && sensing_counter >= 100) ) { 
    528530            sensing_counter = 0; 
    529531            // measure energy