aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Transceiver52M/radioInterface.cpp25
-rw-r--r--Transceiver52M/radioVector.cpp5
-rw-r--r--Transceiver52M/radioVector.h1
3 files changed, 17 insertions, 14 deletions
diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index f98194f..6e82c8a 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -234,36 +234,33 @@ bool RadioInterface::driveReceiveRadio()
GSM::Time rcvClock = mClock.get();
rcvClock.decTN(receiveOffset);
unsigned tN = rcvClock.TN();
- int rcvSz = recvCursor;
+ int recvSz = recvCursor;
int readSz = 0;
const int symbolsPerSlot = gSlotLen + 8;
+ int burstSize = (symbolsPerSlot + (tN % 4 == 0)) * mSPSRx;
// while there's enough data in receive buffer, form received
// GSM bursts and pass up to Transceiver
// Using the 157-156-156-156 symbols per timeslot format.
- while (rcvSz > (symbolsPerSlot + (tN % 4 == 0)) * mSPSRx) {
- GSM::Time tmpTime = rcvClock;
-
+ while (recvSz > burstSize) {
for (size_t i = 0; i < mChans; i++) {
- signalVector rxVector((symbolsPerSlot + (tN % 4 == 0)) * mSPSRx);
- unRadioifyVector((float *) (recvBuffer[i]->begin() + readSz), rxVector);
-
- if (rcvClock.FN() >= 0)
- burst = new radioVector(rxVector, tmpTime);
+ burst = new radioVector(burstSize, rcvClock);
- if (burst && (mReceiveFIFO[i].size() < 32))
+ unRadioifyVector((float *) (recvBuffer[i]->begin() + readSz), *burst);
+ if (mReceiveFIFO[i].size() < 32)
mReceiveFIFO[i].write(burst);
- else {
+ else
delete burst;
- }
}
mClock.incTN();
rcvClock.incTN();
- readSz += (symbolsPerSlot+(tN % 4 == 0)) * mSPSRx;
- rcvSz -= (symbolsPerSlot+(tN % 4 == 0)) * mSPSRx;
+ readSz += burstSize;
+ recvSz -= burstSize;
tN = rcvClock.TN();
+
+ burstSize = (symbolsPerSlot + (tN % 4 == 0)) * mSPSRx;
}
if (readSz > 0) {
diff --git a/Transceiver52M/radioVector.cpp b/Transceiver52M/radioVector.cpp
index 8869821..c50cfa5 100644
--- a/Transceiver52M/radioVector.cpp
+++ b/Transceiver52M/radioVector.cpp
@@ -26,6 +26,11 @@ radioVector::radioVector(const signalVector& wVector, GSM::Time& wTime)
{
}
+radioVector::radioVector(size_t size, GSM::Time& wTime)
+ : signalVector(size), mTime(wTime)
+{
+}
+
GSM::Time radioVector::getTime() const
{
return mTime;
diff --git a/Transceiver52M/radioVector.h b/Transceiver52M/radioVector.h
index 0b38bff..5ddb638 100644
--- a/Transceiver52M/radioVector.h
+++ b/Transceiver52M/radioVector.h
@@ -29,6 +29,7 @@
class radioVector : public signalVector {
public:
radioVector(const signalVector& wVector, GSM::Time& wTime);
+ radioVector(size_t size, GSM::Time& wTime);
GSM::Time getTime() const;
void setTime(const GSM::Time& wTime);
bool operator>(const radioVector& other) const;