diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-10-22 19:22:05 +0200 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2018-10-23 00:00:13 +0200 |
commit | 5516f2cad3555ef6de3ebcecf35147190a4dd8f4 (patch) | |
tree | 5396706087aabb6dd4d8e7d8794d3b2d65de212c /src/target/trx_toolkit/ctrl_if_bts.py | |
parent | f6e1429f804d4001dd71491f966f82763e30360f (diff) |
fake_trx: introduce CTRL commands for RSSI simulation
Since FakeTRX is a proxy, it basically emulates transceiver for
both osmo-bts-trx and trxcon, hence there are two separate and
independent control interfaces (usually, ports 6701 and 5701).
All simulation commands (see 'FAKE_*') are usually implemented
on both interfaces separately:
- ctrl_if_bb.py - simulation commands affecting Uplink,
- ctrl_if_bts.py - simulation commands affecting Downlink.
This change introduces the 'FAKE_RSSI' command for both CTRL
interfaces in two variations:
- absolute: CMD FAKE_RSSI <BASE> <THRESH>
- relative: CMD FAKE_RSSI <+-BASE_DELTA>
where 'THRESH' affects optional value randomization.
Change-Id: Ic01c31fb0304345dd7337c3ee1c7ee3c2d3e8460
Diffstat (limited to 'src/target/trx_toolkit/ctrl_if_bts.py')
-rw-r--r-- | src/target/trx_toolkit/ctrl_if_bts.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/target/trx_toolkit/ctrl_if_bts.py b/src/target/trx_toolkit/ctrl_if_bts.py index 72a03711..6ac8ffb5 100644 --- a/src/target/trx_toolkit/ctrl_if_bts.py +++ b/src/target/trx_toolkit/ctrl_if_bts.py @@ -118,6 +118,27 @@ class CTRLInterfaceBTS(CTRLInterface): return 0 + # RSSI simulation for Downlink + # Absolute form: CMD FAKE_RSSI <BASE> <THRESH> + elif self.verify_cmd(request, "FAKE_RSSI", 2): + print("[i] Recv FAKE_RSSI cmd") + + # Parse and apply both base and threshold + self.burst_fwd.rssi_dl_base = int(request[1]) + self.burst_fwd.rssi_dl_threshold = int(request[2]) + + return 0 + + # RSSI simulation for Downlink + # Relative form: CMD FAKE_RSSI <+-BASE_DELTA> + elif self.verify_cmd(request, "FAKE_RSSI", 1): + print("[i] Recv FAKE_RSSI cmd") + + # Parse and apply delta + self.burst_fwd.rssi_dl_base += int(request[1]) + + return 0 + # Path loss simulation for DL: burst dropping # Syntax: CMD FAKE_DROP <AMOUNT> # Dropping pattern: fn % 1 == 0 |