summaryrefslogtreecommitdiffstats
path: root/src/target/fake_trx/fake_trx.py
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-14 08:06:07 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commit32ae64226f90eb5d9c6968185df9e33c612d90d7 (patch)
tree511567c65f1efd866800a7594883d61fef3b8b1b /src/target/fake_trx/fake_trx.py
parent611f222172b33c9c33c428dcbda379c83c7bad03 (diff)
fake_trx: implement power measurement emulation
This change introduces a new class named FakePM, which is intended to generate pseudo-random power levels for base stations and noise levels inactive frequencies. Also, there is a new command in BB CTRL, which instructs transceiver to perform a power measurement on requested frequency. As we work in virtual Um-interface, a FakePM instance is used to provide some fake power levels. Change-Id: If48c12fd0b1ba10e1cf76559b359e17a1256617d
Diffstat (limited to 'src/target/fake_trx/fake_trx.py')
-rwxr-xr-xsrc/target/fake_trx/fake_trx.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/target/fake_trx/fake_trx.py b/src/target/fake_trx/fake_trx.py
index c30382b..724a520 100755
--- a/src/target/fake_trx/fake_trx.py
+++ b/src/target/fake_trx/fake_trx.py
@@ -30,6 +30,7 @@ import sys
from ctrl_if_bts import CTRLInterfaceBTS
from ctrl_if_bb import CTRLInterfaceBB
from burst_fwd import BurstForwarder
+from fake_pm import FakePM
from udp_link import UDPLink
from clck_gen import CLCKGen
@@ -64,6 +65,15 @@ class Application:
self.bb_ctrl = CTRLInterfaceBB(self.bb_addr,
self.bb_base_port + 101, self.bb_base_port + 1)
+ # Power measurement emulation
+ # Noise: -120 .. -105
+ # BTS: -75 .. -50
+ self.pm = FakePM(-120, -105, -75, -50)
+
+ # Share a FakePM instance between both BTS and BB
+ self.bts_ctrl.pm = self.pm
+ self.bb_ctrl.pm = self.pm
+
# BTS <-> BB burst forwarding
self.bts_data = UDPLink(self.bts_addr,
self.bts_base_port + 102, self.bts_base_port + 2)