aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Tsou <tom@tsou.cc>2015-03-26 19:01:02 -0700
committerTom Tsou <tom@tsou.cc>2015-03-30 18:01:09 -0700
commit7bd1e663c96d14a34451638467991208f18d6ebb (patch)
treed54d202f4386d9239d6fd13756870b43647f76f0
parent1a53985f088dd08d94f14153882ee2db047d8230 (diff)
mcbts: Enable multi-ARFCN option from command line
-rw-r--r--Transceiver52M/osmo-trx.cpp39
1 files changed, 31 insertions, 8 deletions
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index eae7042..b7007db 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -68,6 +68,7 @@ struct trx_config {
bool extref;
bool filler;
bool diversity;
+ bool mcbts;
double offset;
};
@@ -118,7 +119,7 @@ bool testConfig()
*/
bool trx_setup_config(struct trx_config *config)
{
- std::string refstr, fillstr, divstr;
+ std::string refstr, fillstr, divstr, mcstr;
if (!testConfig())
return false;
@@ -154,19 +155,28 @@ bool trx_setup_config(struct trx_config *config)
config->diversity = DEFAULT_DIVERSITY;
}
- if (!config->sps)
- config->sps = DEFAULT_SPS;
-
if (!config->chans)
config->chans = DEFAULT_CHANS;
- /* Diversity only supported on 2 channels */
- if (config->diversity)
+ if (config->mcbts && ((config->chans < 0) || (config->chans > 5))) {
+ std::cout << "Unsupported number of channels" << std::endl;
+ return false;
+ }
+
+ /* Diversity only supported on 2 channels without multi-carrier */
+ if (config->diversity && config->mcbts) {
+ std::cout << "Multi-carrier diversity unsupported" << std::endl;
+ return false;
+ }
+ if (config->diversity && (config->chans != 2)) {
+ std::cout << "Setting channels to 2 for diversity" << std::endl;
config->chans = 2;
+ }
refstr = config->extref ? "Enabled" : "Disabled";
fillstr = config->filler ? "Enabled" : "Disabled";
divstr = config->diversity ? "Enabled" : "Disabled";
+ mcstr = config->mcbts ? "Enabled" : "Disabled";
std::ostringstream ost("");
ost << "Config Settings" << std::endl;
@@ -178,6 +188,7 @@ bool trx_setup_config(struct trx_config *config)
ost << " Samples-per-Symbol...... " << config->sps << std::endl;
ost << " External Reference...... " << refstr << std::endl;
ost << " C0 Filler Table......... " << fillstr << std::endl;
+ ost << " Multi-Carrier........... " << mcstr << std::endl;
ost << " Diversity............... " << divstr << std::endl;
ost << " Tuning offset........... " << config->offset << std::endl;
std::cout << ost << std::endl;
@@ -210,6 +221,10 @@ RadioInterface *makeRadioInterface(struct trx_config *config,
radio = new RadioInterfaceDiversity(usrp,
config->sps, config->chans);
break;
+ case RadioDevice::MULTI_ARFCN:
+ radio = new RadioInterfaceMulti(usrp,
+ config->sps, config->chans);
+ break;
default:
LOG(ALERT) << "Unsupported radio interface configuration";
return NULL;
@@ -282,6 +297,7 @@ static void print_help()
" -i IP address of GSM core\n"
" -p Base port number\n"
" -d Enable dual channel diversity receiver\n"
+ " -m Enable multi-ARFCN transceiver (default=disabled)\n"
" -x Enable external 10 MHz reference\n"
" -s Samples-per-symbol (1 or 4)\n"
" -c Number of ARFCN channels (default=1)\n"
@@ -295,14 +311,15 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
int option;
config->port = 0;
- config->sps = 0;
+ config->sps = DEFAULT_SPS;
config->chans = 0;
config->extref = false;
config->filler = false;
+ config->mcbts = false;
config->diversity = false;
config->offset = 0.0;
- while ((option = getopt(argc, argv, "ha:l:i:p:c:dxfo:s:")) != -1) {
+ while ((option = getopt(argc, argv, "ha:l:i:p:c:dmxfo:s:")) != -1) {
switch (option) {
case 'h':
print_help();
@@ -323,6 +340,9 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
case 'c':
config->chans = atoi(optarg);
break;
+ case 'm':
+ config->mcbts = true;
+ break;
case 'd':
config->diversity = true;
break;
@@ -374,6 +394,9 @@ int main(int argc, char *argv[])
srandom(time(NULL));
/* Create the low level device object */
+ if (config.mcbts)
+ iface = RadioDevice::MULTI_ARFCN;
+
usrp = RadioDevice::make(config.sps, iface, config.chans, config.offset);
type = usrp->open(config.dev_args, config.extref);
if (type < 0) {