mcbts: Allow out of order channel setup
Previous checks on multi-channel TSC and ARFCN settings would fail
if channels were initialized out of order. Namely, if channel 0
was not configured first, osmo-trx would error on the control
interface leading osmo-bts to fail.
Allow global TSC setting on all channels with added logging notice.
Notify if channel frequency is unexpected - which may happen if
channels are setup out of order - but do no report as error.
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 0ccb9a4..d3dce49 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -841,9 +841,8 @@
sscanf(buffer, "%3s %s %d", cmdcheck, command, &TSC);
if ((TSC < 0) || (TSC > 7))
sprintf(response, "RSP SETTSC 1 %d", TSC);
- else if (chan && (TSC != mTSC))
- sprintf(response, "RSP SETTSC 1 %d", TSC);
else {
+ LOG(NOTICE) << "Changing TSC from " << mTSC << " to " << TSC;
mTSC = TSC;
sprintf(response,"RSP SETTSC 0 %d", TSC);
}
diff --git a/Transceiver52M/radioInterfaceMulti.cpp b/Transceiver52M/radioInterfaceMulti.cpp
index ba81fe1..650fd85 100644
--- a/Transceiver52M/radioInterfaceMulti.cpp
+++ b/Transceiver52M/radioInterfaceMulti.cpp
@@ -355,8 +355,10 @@
return mRadio->setTxFreq(freq + shift * MCBTS_SPACING);
double center = mRadio->getTxFreq();
- if (!fltcmp(freq, center + (double) (chan - shift) * MCBTS_SPACING))
- return false;
+ if (!fltcmp(freq, center + (double) (chan - shift) * MCBTS_SPACING)) {
+ LOG(NOTICE) << "Channel " << chan << " RF frequency offset is "
+ << freq / 1e6 << " MHz";
+ }
return true;
}
@@ -372,8 +374,10 @@
return mRadio->setRxFreq(freq + shift * MCBTS_SPACING);
double center = mRadio->getRxFreq();
- if (!fltcmp(freq, center + (double) (chan - shift) * MCBTS_SPACING))
- return false;
+ if (!fltcmp(freq, center + (double) (chan - shift) * MCBTS_SPACING)) {
+ LOG(NOTICE) << "Channel " << chan << " RF frequency offset is "
+ << freq / 1e6 << " MHz";
+ }
return true;
}