From a2fe91a688fb16f1055e3af77478cfb4bceb3ae2 Mon Sep 17 00:00:00 2001 From: Thomas Tsou Date: Wed, 13 Nov 2013 22:48:11 -0500 Subject: Transceiver52M: Add vectorized radio burst capability This patch allows multiple signalVectors to be stored within a single radioVector object. The motivation is to provide a facility for diversity and/or MIMO burst handling. When no channel value is specified, single channel bevhaviour is maintained. Signed-off-by: Thomas Tsou --- Transceiver52M/Transceiver.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'Transceiver52M/Transceiver.cpp') diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 4bd3143..caf2452 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -165,23 +165,23 @@ bool Transceiver::init() return true; } -void Transceiver::addRadioVector(size_t chan, BitVector &burst, +void Transceiver::addRadioVector(size_t chan, BitVector &bits, int RSSI, GSM::Time &wTime) { + signalVector *burst; + radioVector *radio_burst; + if (chan >= mTxPriorityQueues.size()) { LOG(ALERT) << "Invalid channel " << chan; return; } - // modulate and stick into queue - signalVector* modBurst = modulateBurst(burst, - 8 + (wTime.TN() % 4 == 0), - mSPSTx); - scaleVector(*modBurst,txFullScale * pow(10,-RSSI/10)); - radioVector *newVec = new radioVector(*modBurst,wTime); - mTxPriorityQueues[chan].write(newVec); + burst = modulateBurst(bits, 8 + (wTime.TN() % 4 == 0), mSPSTx); + scaleVector(*burst, txFullScale * pow(10, -RSSI / 10)); + + radio_burst = new radioVector(wTime, burst); - delete modBurst; + mTxPriorityQueues[chan].write(radio_burst); } void Transceiver::pushRadioVector(GSM::Time &nowTime) @@ -202,7 +202,9 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime) modFN = burst->getTime().FN() % state->fillerModulus[TN]; delete state->fillerTable[modFN][TN]; - state->fillerTable[modFN][TN] = burst; + state->fillerTable[modFN][TN] = burst->getVector(); + burst->setVector(NULL); + delete burst; } TN = nowTime.TN(); @@ -213,8 +215,10 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime) if ((burst = mTxPriorityQueues[i].getCurrentBurst(nowTime))) { delete state->fillerTable[modFN][TN]; - state->fillerTable[modFN][TN] = burst; - bursts[i] = burst; + state->fillerTable[modFN][TN] = burst->getVector(); + bursts[i] = burst->getVector(); + burst->setVector(NULL); + delete burst; } } @@ -346,7 +350,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, int &RSSI, return NULL; } - signalVector *vectorBurst = rxBurst; + signalVector *vectorBurst = rxBurst->getVector(); energyDetect(*vectorBurst, 20 * mSPSRx, 0.0, &avg); -- cgit v1.2.3