aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/osmo-trx.cpp
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2016-03-25 18:28:34 +0300
committerTom Tsou <tom.tsou@ettus.com>2016-06-22 15:18:13 -0700
commit37c52c79cf915fcbbf5cc932429d8a5c3a15a8d1 (patch)
treebab54961ec62df877192e0a6cbcffe841b44df9e /Transceiver52M/osmo-trx.cpp
parent58e9591f9e491335f2be7099b38b4c4b828c2ad4 (diff)
transceiver: Add an option to emulate a RACH delay in random filler mode.
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
Diffstat (limited to 'Transceiver52M/osmo-trx.cpp')
-rw-r--r--Transceiver52M/osmo-trx.cpp17
1 files changed, 13 insertions, 4 deletions
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[])