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-11-19 17:35:07 +0700
commit02996abedaa3136163b804cc2335f3aa8cc6ba0a (patch)
treedc48fa1e24ae78f6bee2fd67b4a733a3d92d6531 /src/target/fake_trx/fake_trx.py
parente39bb0f0d1a5615103ab631c0816ff27891fc0e4 (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 c30382b4..724a5207 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)