aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-08-26 14:30:46 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-09-01 13:27:39 +0200
commit7d8676a14472889f758ab0fddcfbe49762fe6caf (patch)
tree5974a4a9b51c9894525874d749b25bcfed4460e6
parent8808fa86f0fd0930acdbe99863c3163c7a7a99cc (diff)
Add support for TRXC MUTE command
-rw-r--r--Transceiver52M/Transceiver.cpp15
-rw-r--r--Transceiver52M/Transceiver.h3
2 files changed, 16 insertions, 2 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 32e0226..76ae3d3 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -62,7 +62,8 @@ static void dispatch_trx_rate_ctr_change(TransceiverState *state, unsigned int c
}
TransceiverState::TransceiverState()
- : mFiller(FILLER_ZERO), mRetrans(false), mNoiseLev(0.0), mNoises(NOISE_CNT), mPower(0.0)
+ : mFiller(FILLER_ZERO), mRetrans(false), mNoiseLev(0.0), mNoises(NOISE_CNT),
+ mPower(0.0), mMuted(false)
{
for (int i = 0; i < 8; i++) {
chanType[i] = Transceiver::NONE;
@@ -440,7 +441,7 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime)
state = &mStates[i];
ratectr_changed = false;
- zeros[i] = state->chanType[TN] == NONE;
+ zeros[i] = state->chanType[TN] == NONE || state->mMuted;
Mutex *mtx = mTxPriorityQueues[i].getMutex();
mtx->lock();
@@ -678,6 +679,10 @@ int Transceiver::pullRadioVector(size_t chan, struct trx_ul_burst_ind *bi)
return -ENOENT;
}
+ /* If TRX RF is locked/muted by BTS, send idle burst indications */
+ if (state->mMuted)
+ goto ret_idle;
+
/* Select the diversity channel with highest energy */
for (size_t i = 0; i < radio_burst->chans(); i++) {
float pow = energyDetect(*radio_burst->getVector(i), 20 * mSPSRx);
@@ -1006,6 +1011,12 @@ int Transceiver::ctrl_sock_handle_rx(int chan)
mVersionTRXD[chan] = version_recv;
sprintf(response, "RSP SETFORMAT %u %u", version_recv, version_recv);
}
+ } else if (match_cmd(command, "RFMUTE", &params)) {
+ // (Un)mute RF TX and RX
+ unsigned mute;
+ sscanf(params, "%u", &mute);
+ mStates[chan].mMuted = mute ? true : false;
+ sprintf(response, "RSP RFMUTE 0 %u", mute);
} else if (match_cmd(command, "_SETBURSTTODISKMASK", &params)) {
// debug command! may change or disappear without notice
// set a mask which bursts to dump to disk
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index 39298aa..7a05ac5 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -85,6 +85,9 @@ struct TransceiverState {
/* Shadowed downlink attenuation */
int mPower;
+ /* RF emission and reception disabled, as per NM Administrative State Locked */
+ bool mMuted;
+
/* counters */
struct trx_counters ctrs;