Add support for TRXC MUTE command

Related: SYS#4920
Change-Id: I39983d026ad54c479aa224968e9491d01f30dc35
This commit is contained in:
Pau Espin 2020-08-26 14:30:46 +02:00
parent 8808fa86f0
commit 7d8676a144
2 changed files with 16 additions and 2 deletions

View File

@ -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

View File

@ -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;