aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-07-14 22:58:55 +0400
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-07-16 07:36:17 +0400
commit9cddd4aa5dbe0ca7c02a2294e720cc3925702e39 (patch)
treebf0b4c10cfe1698befb9c072da916e5e560d60dd
parentf1c5b4f76567334a8da7cd2bf36ba854db5e341a (diff)
Transceiver52M: Start and stop all threads on POWERON/POWEROFF.
This change reveals some issue with the UHD start/stop code. Specifically, we get a failed assert in RadioInterface::pullBuffer() (num_rd == OUTCHUNK with num_rd=0) with the POWERON/POWEROFF/POWERON sequence.
-rw-r--r--Transceiver52M/Transceiver.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 39cad3a..7bcbe14 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -85,7 +85,7 @@ Transceiver::Transceiver(int wBasePort, const char *TRXAddress,
mRxFreq = 0.0;
mFreqOffset = 0.0;
- mPower = -10;
+ mPower = -20;
mEnergyThreshold = INIT_ENERGY_THRSHD;
prevFalseDetectionTime = mDriveLoop->getStartTime();
}
@@ -306,12 +306,6 @@ void Transceiver::start()
{
mRunning = true;
mControlServiceLoop.startThread((void*) this);
-
- if (!mPrimary) {
- mOn = true;
- mFIFOServiceLoop.startThread((void*) this);
- mTransmitPriorityQueueServiceLoop.startThread((void*) this);
- }
}
void Transceiver::shutdown()
@@ -371,6 +365,15 @@ void Transceiver::driveControl()
if (strcmp(command,"POWEROFF")==0) {
// turn off transmitter/demod
sprintf(response,"RSP POWEROFF 0");
+ if (mOn) {
+ // Stop radio interface threads.
+ mOn = false;
+ mFIFOServiceLoop.shutdown();
+ mTransmitPriorityQueueServiceLoop.shutdown();
+
+ mRadioInterface->stop();
+ mDriveLoop->stop();
+ }
}
else if (strcmp(command,"POWERON")==0) {
// turn on transmitter/demod
@@ -378,14 +381,15 @@ void Transceiver::driveControl()
sprintf(response,"RSP POWERON 1");
else {
sprintf(response,"RSP POWERON 0");
- if (mPrimary && !mOn) {
+ if (!mOn) {
// Prepare for thread start
- mPower = -20;
mRadioInterface->start();
- mDriveLoop->startThread();
+ mDriveLoop->start();
mDriveLoop->writeClockInterface();
- generateRACHSequence(*gsmPulse,mSamplesPerSymbol);
+ if (mPrimary) {
+ generateRACHSequence(*gsmPulse,mSamplesPerSymbol);
+ }
// Start radio interface threads.
mOn = true;