diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-08-20 18:55:33 -0400 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-09-05 04:55:51 -0400 |
commit | 9520ecd0c52b4c96078e2fc570085954ced8934d (patch) | |
tree | 1015bba467ce326983582494519f652fbab6f685 | |
parent | ab599f8b6d244bc36b76ad6c9a77cb3a4c34edf5 (diff) |
Transceiver52M: Generate RACH correlation sequence at initialization
There is no temporal dependency on when the RACH sequence is generated,
so there is no need for transceiver to create it in response to a
command from GSM core. If we power on the transceiver, we will need
the RACH sequence, so just allocate it during initialization.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 2 | ||||
-rw-r--r-- | Transceiver52M/runTransceiver.cpp | 3 | ||||
-rw-r--r-- | Transceiver52M/sigProcLib.cpp | 12 | ||||
-rw-r--r-- | Transceiver52M/sigProcLib.h | 2 |
4 files changed, 15 insertions, 4 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 063f04a..27e9c12 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -377,9 +377,7 @@ void Transceiver::driveControl() mPower = -20; mRadioInterface->start(); mDriveLoop->start(); - mDriveLoop->writeClockInterface(); - generateRACHSequence(mSPS); // Start radio interface threads. mOn = true; diff --git a/Transceiver52M/runTransceiver.cpp b/Transceiver52M/runTransceiver.cpp index 6a05100..0fed868 100644 --- a/Transceiver52M/runTransceiver.cpp +++ b/Transceiver52M/runTransceiver.cpp @@ -119,6 +119,9 @@ int main(int argc, char *argv[]) DriveLoop *drive = new DriveLoop(SAMPSPERSYM,GSM::Time(3,0),radio); Transceiver *trx = new Transceiver(port, addr, SAMPSPERSYM, radio, drive, 0); radio->activateChan(0); + if (!trx->init()) { + LOG(ALERT) << "Failed to initialize transceiver"; + } /* signalVector *gsmPulse = generateGSMPulse(2,1); diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 9ad149f..2ccc714 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -244,11 +244,21 @@ void initGMSKRotationTables(int sps) } } -void sigProcLibSetup(int sps) +bool sigProcLibSetup(int sps) { + if ((sps != 0) && (sps != 2) && (sps != 4)) + return false; + initTrigTables(); initGMSKRotationTables(sps); generateGSMPulse(sps, 2); + + if (!generateRACHSequence(sps)) { + sigProcLibDestroy(); + return false; + } + + return true; } void GMSKRotate(signalVector &x) { diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h index a9fabb0..ee152d5 100644 --- a/Transceiver52M/sigProcLib.h +++ b/Transceiver52M/sigProcLib.h @@ -100,7 +100,7 @@ float vectorNorm2(const signalVector &x); float vectorPower(const signalVector &x); /** Setup the signal processing library */ -void sigProcLibSetup(int sps); +bool sigProcLibSetup(int sps); /** Destroy the signal processing library */ void sigProcLibDestroy(void); |