aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Tsou <tom@tsou.cc>2015-03-26 16:58:45 -0700
committerTom Tsou <tom@tsou.cc>2015-03-26 17:02:16 -0700
commit92c93763b2cc3ff9365f499521b8aea42849ee9c (patch)
treece76e2277c8105c49f2fb86978dbcbfe8629d6ea
parent4adf4724c366a9eb76bcd810d29ee8753413cec5 (diff)
control: Add OpenBTS 'HANDOVER' commands
-rw-r--r--Transceiver52M/Transceiver.cpp27
-rw-r--r--Transceiver52M/Transceiver.h3
2 files changed, 29 insertions, 1 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 4885654..942eb7d 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -51,6 +51,7 @@ TransceiverState::TransceiverState()
chanResponse[i] = NULL;
DFEForward[i] = NULL;
DFEFeedback[i] = NULL;
+ handoverActive[i] = false;
for (int n = 0; n < 102; n++)
fillerTable[n][i] = NULL;
@@ -411,6 +412,9 @@ Transceiver::CorrType Transceiver::expectedCorrType(GSM::Time currTime,
unsigned burstTN = currTime.TN();
unsigned burstFN = currTime.FN();
+ if (state->handoverActive[burstTN])
+ return RACH;
+
switch (state->chanType[burstTN]) {
case NONE:
return OFF;
@@ -760,8 +764,29 @@ void Transceiver::driveControl(size_t chan)
generateMidamble(mSPSRx, TSC);
sprintf(response,"RSP SETTSC 0 %d", TSC);
}
+ } else if (!strcmp(command,"HANDOVER")) {
+ int tn;
+ sscanf(buffer, "%3s %s %d", cmdcheck, command, &tn);
+ if ((tn < 0) || (tn > 7)) {
+ LOG(ERR) << "bogus message on control interface";
+ sprintf(response, "RSP HANDOVER 1 %d", tn);
+ }
+ else {
+ mStates[chan].handoverActive[tn] = true;
+ sprintf(response, "RSP HANDOVER 0 %d", tn);
+ }
}
- else if (strcmp(command,"SETSLOT")==0) {
+ else if (!strcmp(command, "NOHANDOVER")) {
+ int tn;
+ sscanf(buffer,"%3s %s %d", cmdcheck, command, &tn);
+ if ((tn < 0) || (tn > 7)) {
+ LOG(ERR) << "bogus message on control interface";
+ sprintf(response, "RSP NOHANDOVER 1 %d", tn);
+ } else {
+ mStates[chan].handoverActive[tn] = false;
+ sprintf(response, "RSP NOHANDOVER 0 %d", tn);
+ }
+ } else if (strcmp(command,"SETSLOT")==0) {
// set TSC
int corrCode;
int timeslot;
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index 0b81511..d270b20 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -78,6 +78,9 @@ struct TransceiverState {
float chanRespOffset[8];
complex chanRespAmplitude[8];
+ /* OpenBTS handover command */
+ bool handoverActive[8];
+
/* Received noise energy levels */
float mNoiseLev;
noiseVector mNoises;