From c27fe60a25467f9f034b9ce4422d88cd7861ab3c Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 5 May 2021 17:33:18 +0200 Subject: add hidden fn adjustment command This is only useful if the rf path delays the signal by at least one frame, and therefore a fairly experimental command that might be removed or reworked in the future and should not be relied upon. Change-Id: I29964acffad5bad4f5bcad7f631e435a72979c46 --- CommonLibs/config_defs.h | 1 + CommonLibs/trx_vty.c | 17 +++++++++++++++++ Transceiver52M/Transceiver.cpp | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CommonLibs/config_defs.h b/CommonLibs/config_defs.h index 17352c3..33be73f 100644 --- a/CommonLibs/config_defs.h +++ b/CommonLibs/config_defs.h @@ -48,6 +48,7 @@ struct trx_cfg { double offset; double freq_offset_khz; double rssi_offset; + int ul_fn_offset; bool force_rssi_offset; /* Force value set in VTY? */ bool swap_channels; bool ext_rach; diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c index d1da450..30f55c8 100644 --- a/CommonLibs/trx_vty.c +++ b/CommonLibs/trx_vty.c @@ -271,6 +271,20 @@ DEFUN(cfg_rssi_offset, cfg_rssi_offset_cmd, return CMD_SUCCESS; } + +DEFUN_ATTR(cfg_ul_fn_offset, cfg_ul_fn_offset_cmd, + "ul-fn-offset <-10-10>", + "Adjusts the uplink frame FN by the specified amount\n" + "Frame Number offset\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.ul_fn_offset = atoi(argv[0]); + + return CMD_SUCCESS; +} + DEFUN(cfg_swap_channels, cfg_swap_channels_cmd, "swap-channels (disable|enable)", "Swap primary and secondary channels of the PHY (if any)\n" @@ -624,6 +638,8 @@ static int config_write_trx(struct vty *vty) vty_out(vty, " filler access-burst-delay %u%s", trx->cfg.rach_delay, VTY_NEWLINE); if (trx->cfg.stack_size != 0) vty_out(vty, " stack-size %u%s", trx->cfg.stack_size, VTY_NEWLINE); + if (trx->cfg.ul_fn_offset != 0) + vty_out(vty, " ul-fn-offset %u%s", trx->cfg.ul_fn_offset, VTY_NEWLINE); trx_rate_ctr_threshold_write_config(vty, " "); for (i = 0; i < trx->cfg.num_chans; i++) { @@ -787,6 +803,7 @@ int trx_vty_init(struct trx_ctx* trx) install_element(TRX_NODE, &cfg_stack_size_cmd); install_element(TRX_NODE, &cfg_chan_cmd); + install_element(TRX_NODE, &cfg_ul_fn_offset_cmd); install_node(&chan_node, dummy_config_write); install_element(CHAN_NODE, &cfg_chan_rx_path_cmd); install_element(CHAN_NODE, &cfg_chan_tx_path_cmd); diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 91f06ec..9e7bd5a 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -649,7 +649,7 @@ int Transceiver::pullRadioVector(size_t chan, struct trx_ul_burst_ind *bi) } /* Set time and determine correlation type */ - burstTime = radio_burst->getTime(); + burstTime = radio_burst->getTime() + cfg->ul_fn_offset; CorrType type = expectedCorrType(burstTime, chan); /* Initialize struct bi */ -- cgit v1.2.3