From f5fd578d6097c295192840e846a8e4eca5cef5d2 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Sun, 24 May 2015 18:56:51 -0400 Subject: osmo-trx: Fix random filler command line option. Filler types was of "bool" type, which prevented it from taking values greter than 1. And RAND filler type has integer value of 2, which was casted to 1 on assigning, which led to a normal filler table being used instead of the RAND one. --- Transceiver52M/Transceiver.h | 2 +- Transceiver52M/osmo-trx.cpp | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h index 8bcd8e5..4f6aa69 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -149,7 +149,7 @@ public: IDLE ///< timeslot is an idle (or dummy) burst } CorrType; - enum { + enum FillerType { FILLER_DUMMY, FILLER_ZERO, FILLER_RAND, diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index b121e48..3f562ba 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -67,7 +67,7 @@ struct trx_config { unsigned chans; unsigned rtsc; bool extref; - bool filler; + Transceiver::FillerType filler; bool diversity; double offset; }; @@ -160,8 +160,18 @@ bool trx_setup_config(struct trx_config *config) config->chans = 2; refstr = config->extref ? "Enabled" : "Disabled"; - fillstr = config->filler ? "Enabled" : "Disabled"; divstr = config->diversity ? "Enabled" : "Disabled"; + switch (config->filler) { + case Transceiver::FILLER_DUMMY: + fillstr = "Dummy bursts"; + break; + case Transceiver::FILLER_ZERO: + fillstr = "Disabled"; + break; + case Transceiver::FILLER_RAND: + fillstr = "Normal busrts with random payload"; + break; + } std::ostringstream ost(""); ost << "Config Settings" << std::endl; -- cgit v1.2.3