summaryrefslogtreecommitdiffstats
path: root/src/target/trx_toolkit
diff options
context:
space:
mode:
Diffstat (limited to 'src/target/trx_toolkit')
-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