Add a (hidden) VTY parameter for Rx/Tx freq. shifting
Change-Id: I360e8ba91471757210c7f096c04928a6fbb91c61 Related: SYS#4454
This commit is contained in:
parent
48cad832ea
commit
3b8f7c4d97
|
@ -46,6 +46,7 @@ struct trx_cfg {
|
|||
enum FillerType filler;
|
||||
bool multi_arfcn;
|
||||
double offset;
|
||||
double freq_offset_khz;
|
||||
double rssi_offset;
|
||||
bool force_rssi_offset; /* Force value set in VTY? */
|
||||
bool swap_channels;
|
||||
|
|
|
@ -244,6 +244,19 @@ DEFUN(cfg_offset, cfg_offset_cmd,
|
|||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFUN_ATTR(cfg_freq_offset, cfg_freq_offset_cmd,
|
||||
"freq-offset FLOAT",
|
||||
"Apply an artificial offset to Rx/Tx carrier frequency\n"
|
||||
"Frequency offset in kHz (e.g. -145300)\n",
|
||||
CMD_ATTR_HIDDEN)
|
||||
{
|
||||
struct trx_ctx *trx = trx_from_vty(vty);
|
||||
|
||||
trx->cfg.freq_offset_khz = atof(argv[0]);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFUN(cfg_rssi_offset, cfg_rssi_offset_cmd,
|
||||
"rssi-offset FLOAT [relative]",
|
||||
"Set the RSSI to dBm offset in dB (default=0)\n"
|
||||
|
@ -593,6 +606,8 @@ static int config_write_trx(struct vty *vty)
|
|||
vty_out(vty, " multi-arfcn %s%s", trx->cfg.multi_arfcn ? "enable" : "disable", VTY_NEWLINE);
|
||||
if (trx->cfg.offset != 0)
|
||||
vty_out(vty, " offset %f%s", trx->cfg.offset, VTY_NEWLINE);
|
||||
if (trx->cfg.freq_offset_khz != 0)
|
||||
vty_out(vty, " freq-offset %f%s", trx->cfg.freq_offset_khz, VTY_NEWLINE);
|
||||
if (!(trx->cfg.rssi_offset == 0 && !trx->cfg.force_rssi_offset))
|
||||
vty_out(vty, " rssi-offset %f%s%s", trx->cfg.rssi_offset,
|
||||
trx->cfg.force_rssi_offset ? " relative": "", VTY_NEWLINE);
|
||||
|
@ -758,6 +773,7 @@ int trx_vty_init(struct trx_ctx* trx)
|
|||
install_element(TRX_NODE, &cfg_clock_ref_cmd);
|
||||
install_element(TRX_NODE, &cfg_multi_arfcn_cmd);
|
||||
install_element(TRX_NODE, &cfg_offset_cmd);
|
||||
install_element(TRX_NODE, &cfg_freq_offset_cmd);
|
||||
install_element(TRX_NODE, &cfg_rssi_offset_cmd);
|
||||
install_element(TRX_NODE, &cfg_swap_channels_cmd);
|
||||
install_element(TRX_NODE, &cfg_egprs_cmd);
|
||||
|
|
|
@ -954,7 +954,7 @@ int Transceiver::ctrl_sock_handle_rx(int chan)
|
|||
// tune receiver
|
||||
int freqKhz;
|
||||
sscanf(params, "%d", &freqKhz);
|
||||
mRxFreq = freqKhz * 1e3;
|
||||
mRxFreq = (freqKhz + cfg->freq_offset_khz) * 1e3;
|
||||
if (!mRadioInterface->tuneRx(mRxFreq, chan)) {
|
||||
LOGCHAN(chan, DTRXCTRL, FATAL) << "RX failed to tune";
|
||||
sprintf(response,"RSP RXTUNE 1 %d",freqKhz);
|
||||
|
@ -965,7 +965,7 @@ int Transceiver::ctrl_sock_handle_rx(int chan)
|
|||
// tune txmtr
|
||||
int freqKhz;
|
||||
sscanf(params, "%d", &freqKhz);
|
||||
mTxFreq = freqKhz * 1e3;
|
||||
mTxFreq = (freqKhz + cfg->freq_offset_khz) * 1e3;
|
||||
if (!mRadioInterface->tuneTx(mTxFreq, chan)) {
|
||||
LOGCHAN(chan, DTRXCTRL, FATAL) << "TX failed to tune";
|
||||
sprintf(response,"RSP TXTUNE 1 %d",freqKhz);
|
||||
|
|
|
@ -542,7 +542,9 @@ static void print_config(struct trx_ctx *trx)
|
|||
ost << " Filler Burst TSC........ " << trx->cfg.rtsc << std::endl;
|
||||
ost << " Filler Burst RACH Delay. " << trx->cfg.rach_delay << std::endl;
|
||||
ost << " Multi-Carrier........... " << trx->cfg.multi_arfcn << std::endl;
|
||||
ost << " Tuning offset........... " << trx->cfg.offset << std::endl;
|
||||
ost << " LO freq. offset......... " << trx->cfg.offset << std::endl;
|
||||
if (trx->cfg.freq_offset_khz != 0)
|
||||
ost << " Tune freq. offset....... " << trx->cfg.freq_offset_khz << std::endl;
|
||||
ost << " RSSI to dBm offset...... " << trx->cfg.rssi_offset << (trx->cfg.force_rssi_offset ? "" : " (relative)") << std::endl;
|
||||
ost << " Swap channels........... " << trx->cfg.swap_channels << std::endl;
|
||||
ost << " Tx Antennas.............";
|
||||
|
|
Loading…
Reference in New Issue