enb: refactored rf_args handling for ZMQ-based radio
this patch moves the rf_dev_args creation for both eNB types
into the eNB base class, since they are identical.
the patch also fixes the arguments for all CA and MIMO configurations
Change-Id: I8ca3ed83e65dc07927385267e5970bc4f5b120d5
diff --git a/src/osmo_gsm_tester/obj/enb_amarisoft.py b/src/osmo_gsm_tester/obj/enb_amarisoft.py
index bb48880..ec7063c 100644
--- a/src/osmo_gsm_tester/obj/enb_amarisoft.py
+++ b/src/osmo_gsm_tester/obj/enb_amarisoft.py
@@ -27,25 +27,6 @@
def rf_type_valid(rf_type_str):
return rf_type_str in ('uhd', 'zmq')
-#reference: srsLTE.git srslte_symbol_sz()
-def num_prb2symbol_sz(num_prb):
- if num_prb <= 6:
- return 128
- if num_prb <= 15:
- return 256
- if num_prb <= 25:
- return 384
- if num_prb <= 50:
- return 768
- if num_prb <= 75:
- return 1024
- if num_prb <= 110:
- return 1536
- raise log.Error('invalid num_prb %r', num_prb)
-
-def num_prb2base_srate(num_prb):
- return num_prb2symbol_sz(num_prb) * 15 * 1000
-
class AmarisoftENB(enb.eNodeB):
REMOTE_DIR = '/osmo-gsm-tester-amarisoftenb'
@@ -174,15 +155,10 @@
# We need to set some specific variables programatically here to match IP addresses:
if self._conf.get('rf_dev_type') == 'zmq':
- base_srate = num_prb2base_srate(self.num_prb())
- rf_dev_args = 'fail_on_disconnect=true' \
- + ',tx_port0=tcp://' + self.addr() + ':2000' \
- + ',tx_port1=tcp://' + self.addr() + ':2002' \
- + ',rx_port0=tcp://' + self.ue.addr() + ':2001' \
- + ',rx_port1=tcp://' + self.ue.addr() + ':2003' \
- + ',id=enb,base_srate=' + str(base_srate)
+ base_srate = self.num_prb2base_srate(self.num_prb())
+ rf_dev_args = self.get_zmq_rf_dev_args()
config.overlay(values, dict(enb=dict(sample_rate = base_srate / (1000*1000),
- rf_dev_args=rf_dev_args)))
+ rf_dev_args = rf_dev_args)))
# Set UHD frame size as a function of the cell bandwidth on B2XX
if self._conf.get('rf_dev_type') == 'uhd' and values['enb'].get('rf_dev_args', None) is not None: