summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-07-24 05:46:06 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-07-26 23:48:19 +0700
commit15247989f53026fc412a33498fcbd8a7cab54334 (patch)
treed6914c2ea2c7ba3dc59d052da78a7b0eddecc028
parentf6aada5f5f420d4f6cb36d2736bb1b63ba3bd8bb (diff)
trx_toolkit: do not auto power on/off child MS Transceivers
By default, powering on/off a parent transceiver (child_idx=0) will automatically power on/off its child transceivers (if any). This behavior is desirable for the BTS, but not for the MS Transceivers. Additional MS Transceivers are going to be used by ttcn3-bts-test for spawning multiple DCCH components in parallel. We don't want situations when one component powers off transceivers of the other DCCH components - they must be independent. Change-Id: I0cd6bac616273bed0e246ad48edc44fff484c589
-rwxr-xr-xsrc/target/trx_toolkit/fake_trx.py2
-rw-r--r--src/target/trx_toolkit/transceiver.py15
2 files changed, 12 insertions, 5 deletions
diff --git a/src/target/trx_toolkit/fake_trx.py b/src/target/trx_toolkit/fake_trx.py
index 5bfc9563..0daecb40 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -409,7 +409,7 @@ class Application(ApplicationBase):
self.append_trx(self.argv.bts_addr, self.argv.bts_base_port, name = "BTS")
# Init TRX instance for BB
- self.append_trx(self.argv.bb_addr, self.argv.bb_base_port, name = "MS")
+ self.append_trx(self.argv.bb_addr, self.argv.bb_base_port, name = "MS", child_mgt = False)
# Additional transceivers (optional)
if self.argv.trx_list is not None:
diff --git a/src/target/trx_toolkit/transceiver.py b/src/target/trx_toolkit/transceiver.py
index 168d3db8..385c38d8 100644
--- a/src/target/trx_toolkit/transceiver.py
+++ b/src/target/trx_toolkit/transceiver.py
@@ -65,8 +65,9 @@ class Transceiver:
(trx_2) ctrl=5705, data=5706.
...
- As soon as the first transceiver is powered on / off,
- all child transceivers are also powered on / off.
+ By default, powering on/off a parent transceiver (child_idx=0) will
+ automatically power on/off its child transceivers (if any). This
+ behavior can be disabled by setting "child_mgt" param to False.
== Clock distribution (optional)
@@ -126,6 +127,7 @@ class Transceiver:
self.bind_addr = bind_addr
self.base_port = base_port
self.child_idx = kwargs.get("child_idx", 0)
+ self.child_mgt = kwargs.get("child_mgt", True)
# Meta info
self.name = kwargs.get("name", None)
@@ -222,8 +224,13 @@ class Transceiver:
return None
def power_event_handler(self, poweron: bool) -> None:
- # Update self and child transceivers
- for trx in [self, *self.child_trx_list.trx_list]:
+ # If self.child_mgt is True, automatically power on/off children
+ if self.child_mgt and self.child_idx == 0:
+ trx_list = [self, *self.child_trx_list.trx_list]
+ else:
+ trx_list = [self]
+ # Update self and optionally child transceivers
+ for trx in trx_list:
trx.running = poweron
if not poweron:
trx.disable_fh()