diff options
author | Thomas Tsou <tom@tsou.cc> | 2014-10-06 10:38:43 -0700 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2014-10-06 19:16:20 -0700 |
commit | e287598e6b9ebf46c73263f62767250cc96b10ab (patch) | |
tree | 92d3253c7e2cf9904e3a082b045e7bb634915fb2 /Transceiver52M/Transceiver.cpp | |
parent | 98b1af896c3e16bec418af654dd8fc2212c85fc5 (diff) |
ms: Add BSIC request command
The GETBSIC command returns 1 if no SCH has been decoded, and 0 with
the BSIC value if SCH decoding has been successful.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M/Transceiver.cpp')
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 05f3b16..1e76ec0 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -98,7 +98,8 @@ Transceiver::Transceiver(int wBasePort, : mBasePort(wBasePort), mAddr(TRXAddress), mTransmitLatency(wTransmitLatency), mClockSocket(NULL), mRadioInterface(wRadioInterface), mSPSTx(wSPS), mSPSRx(1), mChans(wChans), - mOn(false), mTxFreq(0.0), mRxFreq(0.0), mPower(-10), mMaxExpectedDelay(0) + mOn(false), mTxFreq(0.0), mRxFreq(0.0), mPower(-10), mMaxExpectedDelay(0), + mBSIC(-1) { GSM::Time startTime(random() % gHyperframe,0); @@ -435,6 +436,8 @@ bool Transceiver::decodeSCH(SoftVector *burst, GSM::Time *time) if (!gsm_sch_decode(info, data)) { gsm_sch_parse(info, &sch); + mBSIC = sch.bsic; + std::cout << "SCH : Decoded values" << std::endl; std::cout << " BSIC: " << sch.bsic << std::endl; std::cout << " T1 : " << sch.t1 << std::endl; @@ -851,6 +854,12 @@ void Transceiver::driveControl(size_t chan) sprintf(response,"RSP SETTSC 0 %d", TSC); } } + else if (!strcmp(command,"GETBSIC")) { + if (mBSIC < 0) + sprintf(response, "RSP GETBSIC 1"); + else + sprintf(response, "RSP GETBSIC 0 %d", mBSIC); + } else if (strcmp(command,"SETSLOT")==0) { // set TSC int corrCode; |