From 37c52c79cf915fcbbf5cc932429d8a5c3a15a8d1 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Fri, 25 Mar 2016 18:28:34 +0300 Subject: transceiver: Add an option to emulate a RACH delay in random filler mode. Signed-off-by: Tom Tsou --- Transceiver52M/osmo-trx.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'Transceiver52M/osmo-trx.cpp') diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index d56b5c6..f4b585e 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -70,6 +70,7 @@ struct trx_config { unsigned rx_sps; unsigned chans; unsigned rtsc; + unsigned rach_delay; bool extref; Transceiver::FillerType filler; bool diversity; @@ -265,7 +266,7 @@ Transceiver *makeTransceiver(struct trx_config *config, RadioInterface *radio) trx = new Transceiver(config->port, config->addr.c_str(), config->tx_sps, config->rx_sps, config->chans, GSM::Time(3,0), radio, config->rssi_offset); - if (!trx->init(config->filler, config->rtsc)) { + if (!trx->init(config->filler, config->rtsc, config->rach_delay)) { LOG(ALERT) << "Failed to initialize transceiver"; delete trx; return NULL; @@ -317,8 +318,8 @@ static void print_help() " -c Number of ARFCN channels (default=1)\n" " -f Enable C0 filler table\n" " -o Set baseband frequency offset (default=auto)\n" - " -r Random burst test mode with TSC\n" - " -A Random burst test mode with Access Bursts\n" + " -r Random Normal Burst test mode with TSC\n" + " -A Random Access Burst test mode with delay\n" " -R RSSI to dBm offset in dB (default=0)\n" " -S Swap channels (UmTRX only)\n", "EMERG, ALERT, CRT, ERR, WARNING, NOTICE, INFO, DEBUG"); @@ -333,6 +334,7 @@ static void handle_options(int argc, char **argv, struct trx_config *config) config->rx_sps = DEFAULT_RX_SPS; config->chans = DEFAULT_CHANS; config->rtsc = 0; + config->rach_delay = 0; config->extref = false; config->filler = Transceiver::FILLER_ZERO; config->diversity = false; @@ -341,7 +343,7 @@ static void handle_options(int argc, char **argv, struct trx_config *config) config->swap_channels = false; config->edge = false; - while ((option = getopt(argc, argv, "ha:l:i:p:c:dxfo:s:r:AR:Se")) != -1) { + while ((option = getopt(argc, argv, "ha:l:i:p:c:dxfo:s:r:A:R:Se")) != -1) { switch (option) { case 'h': print_help(); @@ -382,6 +384,7 @@ static void handle_options(int argc, char **argv, struct trx_config *config) config->filler = Transceiver::FILLER_NORM_RAND; break; case 'A': + config->rach_delay = atoi(optarg); config->filler = Transceiver::FILLER_ACCESS_RAND; break; case 'R': @@ -420,6 +423,12 @@ static void handle_options(int argc, char **argv, struct trx_config *config) print_help(); exit(0); } + + if (config->rach_delay > 68) { + printf("RACH delay is too big %i\n\n", config->rach_delay); + print_help(); + exit(0); + } } int main(int argc, char *argv[]) -- cgit v1.2.3