summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-06-24 14:32:05 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-07-16 14:52:24 +0700
commit3d9a1d6e485c46536aad938f8020bd178724dee7 (patch)
treee8b66e5860f67821f893822e6164471d1381b885 /src
parent13ec32d380cc101ed9bce250bd05bc0d5669b3cd (diff)
trx_toolkit/fake_trx.py: introduce a TRXC command for C/I simulation
C/I (Carrier-to-Interference ratio) is a value in cB (centiBels), computed from the training sequence of each received burst, by comparing the "ideal" training sequence with the received one. This change introduces a new command similar to FAKE_TOA and FAKE_RSSI, so it can be used by TTCN-3 test case 'TC_pcu_data_ind_lqual_cb' to verify that the link quality measurements are delivered to the PCU. Change-Id: I7080effbbc1022d1884c6d6f0cb580eba8e514ff Related: OS#1855
Diffstat (limited to 'src')
-rwxr-xr-xsrc/target/trx_toolkit/fake_trx.py31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/target/trx_toolkit/fake_trx.py b/src/target/trx_toolkit/fake_trx.py
index de0e6ff0..69cdd868 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -64,8 +64,16 @@ class FakeTRX(Transceiver):
from (rssi_base - rssi_rand_threshold)
to (rssi_base + rssi_rand_threshold).
- Please note that randomization of both RSSI and ToA is optional,
- and can be enabled from the control interface.
+ - C/I (Carrier-to-Interference ratio) - value in cB (centiBels),
+ computed from the training sequence of each received burst, by
+ comparing the "ideal" training sequence with the actual one.
+ A pair of both base and threshold values defines a range of
+ C/I randomization:
+
+ from (ci_base - ci_rand_threshold)
+ to (ci_base + ci_rand_threshold).
+
+ Please note that the randomization is optional and disabled by default.
== Timing Advance handling
@@ -263,6 +271,25 @@ class FakeTRX(Transceiver):
self.rssi_base += int(request[1])
return 0
+ # C/I simulation
+ # Absolute form: CMD FAKE_CI <BASE> <THRESH>
+ elif self.ctrl_if.verify_cmd(request, "FAKE_CI", 2):
+ log.debug("(%s) Recv FAKE_CI cmd" % self)
+
+ # Parse and apply both base and threshold
+ self.ci_base = int(request[1])
+ self.ci_rand_threshold = int(request[2])
+ return 0
+
+ # C/I simulation
+ # Relative form: CMD FAKE_CI <+-BASE_DELTA>
+ elif self.ctrl_if.verify_cmd(request, "FAKE_CI", 1):
+ log.debug("(%s) Recv FAKE_CI cmd" % self)
+
+ # Parse and apply delta
+ self.ci_base += int(request[1])
+ return 0
+
# Path loss simulation: burst dropping
# Syntax: CMD FAKE_DROP <AMOUNT>
# Dropping pattern: fn % 1 == 0