diff options
-rw-r--r-- | src/target/trx_toolkit/ctrl_if_bb.py | 21 | ||||
-rw-r--r-- | src/target/trx_toolkit/ctrl_if_bts.py | 21 |
2 files changed, 42 insertions, 0 deletions
diff --git a/src/target/trx_toolkit/ctrl_if_bb.py b/src/target/trx_toolkit/ctrl_if_bb.py index 808c8806..3528c98d 100644 --- a/src/target/trx_toolkit/ctrl_if_bb.py +++ b/src/target/trx_toolkit/ctrl_if_bb.py @@ -144,6 +144,27 @@ class CTRLInterfaceBB(CTRLInterface): return 0 + # RSSI simulation for Uplink + # 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_ul_base = int(request[1]) + self.burst_fwd.rssi_ul_threshold = int(request[2]) + + return 0 + + # RSSI simulation for Uplink + # 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_ul_base += int(request[1]) + + return 0 + # Path loss simulation for UL: burst dropping # Syntax: CMD FAKE_DROP <AMOUNT> # Dropping pattern: fn % 1 == 0 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 |