diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2013-09-06 00:35:57 +0400 |
---|---|---|
committer | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2013-09-06 00:35:57 +0400 |
commit | 0b8aa00bc7b8233fad019fb92d63066b1be9b8e4 (patch) | |
tree | c570da132ac2214f816317424a07904cebe8dd33 /Transceiver52M/Transceiver.cpp | |
parent | 1ed2e27d1931ee940ac67d818f40465edfef1c4e (diff) |
conditional load testing (selected at compile time), turned on by default.achemeris/load_testing
Diffstat (limited to 'Transceiver52M/Transceiver.cpp')
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 103c46c..b104aac 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -60,7 +60,11 @@ Transceiver::Transceiver(int wBasePort, const char *TRXAddress, mFIFOServiceLoopThread = NULL; mControlServiceLoopThread = NULL; mTransmitPriorityQueueServiceLoopThread = NULL; +#ifndef TRX_LOAD_TESTING mMaxExpectedDelay = 0; +#else + mMaxExpectedDelay = 10; +#endif mTransmitPriorityQueue = mDriveLoop->priorityQueue(mChannel); mReceiveFIFO = mRadioInterface->receiveFIFO(mChannel); @@ -131,11 +135,13 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, DriveLoop::CorrType corrType = mDriveLoop->expectedCorrType(mChannel, rxBurst->getTime()); +#ifndef TRX_LOAD_TESTING if ((corrType == DriveLoop::OFF) || (corrType == DriveLoop::IDLE)) { delete rxBurst; return NULL; } - +#endif + // check to see if received burst has sufficient signalVector *vectorBurst = rxBurst; complex amplitude = 0.0; @@ -152,8 +158,10 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, prevFalseDetectionTime = rxBurst->getTime(); } +#ifndef TRX_LOAD_TESTING delete rxBurst; return NULL; +#endif } LOG(DEBUG) << "Estimated Energy: " << sqrt(avgPwr) << ", at time " << rxBurst->getTime(); #endif @@ -186,6 +194,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, estimateChannel, &channelResp, &chanOffset); +#ifdef TRX_LOAD_TESTING + success = true; +#endif if (success) { LOG(DEBUG) << "FOUND TSC!!!!!! " << amplitude << " " << TOA; mEnergyThreshold -= 1.0F/10.0F; @@ -217,6 +228,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, mSPS, &litude, &TOA); +#ifdef TRX_LOAD_TESTING + success = true; +#endif if (success) { LOG(DEBUG) << "FOUND RACH!!!!!! " << amplitude << " " << TOA; mEnergyThreshold -= (1.0F/10.0F); @@ -396,7 +410,9 @@ void Transceiver::driveControl() //set expected maximum time-of-arrival int maxDelay; sscanf(buffer,"%3s %s %d",cmdcheck,command,&maxDelay); +#ifndef TRX_LOAD_TESTING mMaxExpectedDelay = maxDelay; // 1 GSM symbol is approx. 1 km +#endif sprintf(response,"RSP SETMAXDLY 0 %d",maxDelay); } else if (strcmp(command,"SETRXGAIN")==0) { |