aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/osmo-trx.cpp
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-06-07 01:07:45 -0400
committerTom Tsou <tom.tsou@ettus.com>2015-07-30 14:19:06 -0700
commit50747dc65d2f7046c427c2c846d0315781f2f249 (patch)
tree33f4fd250082f2b51a48224090ca8930931d0fc2 /Transceiver52M/osmo-trx.cpp
parent1e9b4d57dad26785f5920306963338175d162910 (diff)
osmo-trx: Add an option to swap channels on UmTRX.
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
Diffstat (limited to 'Transceiver52M/osmo-trx.cpp')
-rw-r--r--Transceiver52M/osmo-trx.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 048b9f8..7b9fd7c 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -71,6 +71,7 @@ struct trx_config {
bool diversity;
double offset;
double rssi_offset;
+ bool swap_channels;
};
ConfigurationTable gConfig;
@@ -187,6 +188,7 @@ bool trx_setup_config(struct trx_config *config)
ost << " Diversity............... " << divstr << std::endl;
ost << " Tuning offset........... " << config->offset << std::endl;
ost << " RSSI to dBm offset...... " << config->rssi_offset << std::endl;
+ ost << " Swap channels........... " << config->swap_channels << std::endl;
std::cout << ost << std::endl;
return true;
@@ -295,7 +297,8 @@ static void print_help()
" -f Enable C0 filler table\n"
" -o Set baseband frequency offset (default=auto)\n"
" -r Random burst test mode with TSC\n"
- " -R RSSI to dBm offset in dB (default=0)\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");
}
@@ -312,8 +315,9 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
config->diversity = false;
config->offset = 0.0;
config->rssi_offset = 0.0;
+ config->swap_channels = false;
- while ((option = getopt(argc, argv, "ha:l:i:p:c:dxfo:s:r:R:")) != -1) {
+ while ((option = getopt(argc, argv, "ha:l:i:p:c:dxfo:s:r:R:S")) != -1) {
switch (option) {
case 'h':
print_help();
@@ -356,6 +360,9 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
case 'R':
config->rssi_offset = atof(optarg);
break;
+ case 'S':
+ config->swap_channels = true;
+ break;
default:
print_help();
exit(0);
@@ -400,7 +407,7 @@ int main(int argc, char *argv[])
/* Create the low level device object */
usrp = RadioDevice::make(config.sps, config.chans,
config.diversity, config.offset);
- type = usrp->open(config.dev_args, config.extref);
+ type = usrp->open(config.dev_args, config.extref, config.swap_channels);
if (type < 0) {
LOG(ALERT) << "Failed to create radio device" << std::endl;
goto shutdown;