Changeset 5681
- Timestamp:
- 11/03/07 17:45:54 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
experimental/components/CIREN_SM/trunk/CIREN_SM/CIREN_SM.cpp
r5677 r5681 103 103 rx_power_threshold_hi = 35.0f; 104 104 spectrumSensingFlag = false; 105 switch_scan = 50;106 switch_linger = 100;105 switch_scan = 100; 106 switch_linger = 500; 107 107 switch_dwell = 10000; 108 108 opMode = SCAN; … … 403 403 switch (m) { 404 404 case SCAN: 405 DEBUG( 2, CIREN_SM, "switching mode to scan");405 DEBUG(0, CIREN_SM, "switching mode to scan"); 406 406 dwell_packet_switch = switch_scan; 407 407 break; 408 408 case LINGER: 409 DEBUG( 2, CIREN_SM, "switching mode to linger");409 DEBUG(0, CIREN_SM, "switching mode to linger"); 410 410 dwell_packet_switch = switch_linger; 411 411 break; 412 412 case DWELL: 413 DEBUG( 2, CIREN_SM, "switching mode to dwell");413 DEBUG(0, CIREN_SM, "switching mode to dwell"); 414 414 dwell_packet_switch = switch_dwell; 415 415 break; … … 431 431 portTxDataIn->getData(I_in_tx, Q_in_tx, tx_metadata); 432 432 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 } 435 437 436 438 // process data here … … 525 527 sensing_counter++; 526 528 scan_energy = 0.01f; 527 if (opMode != DWELL|| (opMode == DWELL && sensing_counter >= 100) ) {529 if (opMode == SCAN || (opMode == DWELL && sensing_counter >= 100) ) { 528 530 sensing_counter = 0; 529 531 // measure energy