enb: Add attribute to set 'id'

Change-Id: I8ce296c7875d557062dc13e7093ce0400050f2ce
This commit is contained in:
Pau Espin 2020-04-20 14:20:43 +02:00
parent d4404d54c0
commit 491f77cd0f
6 changed files with 17 additions and 4 deletions

View File

@ -37,6 +37,7 @@ class eNodeB(log.Origin, metaclass=ABCMeta):
self._gtp_bind_addr = self._addr
self.set_name('%s_%s' % (name, self._addr))
self._txmode = 0
self._id = None
self._num_prb = 0
self._num_cells = None
self._epc = None
@ -49,6 +50,8 @@ class eNodeB(log.Origin, metaclass=ABCMeta):
for config_specifics in config_specifics_li:
config.overlay(values, dict(enb=self.suite_run.config().get(config_specifics, {})))
config.overlay(values, dict(enb=self._conf))
self._id = int(values['enb'].get('id', None))
assert self._id is not None
self._num_prb = int(values['enb'].get('num_prb', None))
assert self._num_prb
self._txmode = int(values['enb'].get('transmission_mode', None))
@ -78,6 +81,9 @@ class eNodeB(log.Origin, metaclass=ABCMeta):
return values
def id(self):
return self._id
def num_ports(self):
if self._txmode == 1:
return 1

View File

@ -190,8 +190,12 @@ class srsEPC(epc.EPC):
return subscriber_id
def enb_is_connected(self, enb):
# TODO: match against srsENB config: "S1 Setup Request - eNB Name: srsenb01, eNB id: 0x19"
return 'S1 Setup Request - eNB' in (self.process.get_stdout() or '')
# Match against sample line: "S1 Setup Request - eNB Name: srsenb01, eNB id: 0x19"
stdout_lines = (self.process.get_stdout() or '').splitlines()
for l in stdout_lines:
if l.startswith('S1 Setup Request') and l.endswith('eNB id: %s' % hex(enb.id()).lower()):
return True
return False
def running(self):
return not self.process.terminated()

View File

@ -89,6 +89,7 @@ RESOURCES_SCHEMA = {
'enb[].remote_user': schema.STR,
'enb[].addr': schema.IPV4,
'enb[].gtp_bind_addr': schema.IPV4,
'enb[].id': schema.UINT,
'enb[].num_prb': schema.UINT,
'enb[].transmission_mode': schema.LTE_TRANSMISSION_MODE,
'enb[].rf_dev_type': schema.STR,

View File

@ -51,7 +51,7 @@
gtp_addr: "${enb.gtp_bind_addr}",
/* high 20 bits of SIB1.cellIdentifier */
enb_id: 0x19B,
enb_id: ${enb.id},
/* list of cells */
cell_list: [

View File

@ -19,7 +19,8 @@
#
#####################################################################
[enb]
enb_id = 0x19B
# need hex value here for enb_id due to bug: https://github.com/srsLTE/srsLTE/issues/485
enb_id = ${hex(int(enb.id))}
mcc = ${enb.mcc}
mnc = ${enb.mnc}
mme_addr = ${enb.mme_addr}

View File

@ -106,6 +106,7 @@ amarisoft:
license_server_addr: 0.0.0.0
enb:
id: 0x19B
mcc: 901
mnc: 70
transmission_mode: 1