aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-05-19 23:58:02 -0400
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-05-19 23:58:02 -0400
commitfeb4028b1b16c69ac363e3db550d54a7792242db (patch)
treeb0e457ac9eedecaee0dea1839e9370cf23740799
parent7451e47d8afc4973a4fca9300198459cec568e19 (diff)
Transceiver: Check TSC values to be in [0..7] range.
-rw-r--r--Transceiver52M/Transceiver.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index f8ed51a..cff0b3a 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -91,7 +91,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),
+ mTSC(0)
{
GSM::Time startTime(random() % gHyperframe,0);
@@ -731,7 +732,7 @@ void Transceiver::driveControl(size_t chan)
// set TSC
unsigned TSC;
sscanf(buffer, "%3s %s %d", cmdcheck, command, &TSC);
- if (mOn)
+ if (mOn || (TSC<0) || (TSC>7))
sprintf(response, "RSP SETTSC 1 %d", TSC);
else if (chan && (TSC != mTSC))
sprintf(response, "RSP SETTSC 1 %d", TSC);
@@ -742,7 +743,7 @@ void Transceiver::driveControl(size_t chan)
}
}
else if (strcmp(command,"SETSLOT")==0) {
- // set TSC
+ // set slot type
int corrCode;
int timeslot;
sscanf(buffer,"%3s %s %d %d",cmdcheck,command,&timeslot,&corrCode);