From e287598e6b9ebf46c73263f62767250cc96b10ab Mon Sep 17 00:00:00 2001 From: Thomas Tsou Date: Mon, 6 Oct 2014 10:38:43 -0700 Subject: 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 --- Transceiver52M/Transceiver.cpp | 11 ++++++++++- Transceiver52M/Transceiver.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) 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; diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h index 8f3e47b..e31a9a9 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -183,6 +183,7 @@ private: int mPower; ///< the transmit power in dB unsigned mTSC; ///< the midamble sequence code unsigned mMaxExpectedDelay; ///< maximum expected time-of-arrival offset in GSM symbols + int mBSIC; ///< MS - detected BSIC std::vector mStates; -- cgit v1.2.3