diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2019-11-17 16:36:35 +0700 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2019-11-20 15:05:57 +0000 |
commit | ae8e5ad64841ed437385bfbf298cd9dad6c10af4 (patch) | |
tree | 1c849c9d4d00444f727b880623c3dd4189c440a6 | |
parent | 7108c28c38a136df049e8edef12bd7e71b76a40e (diff) |
trx_toolkit/fake_trx.py: send NOPE.ind in case of path loss simulation
Since TRXD header version 1, we should send NOPE indications to the
L1 side in absence of TRX2L1 bursts, and IDLE indications during
IDLE TDMA frames (basically noise measurements).
This change is the first step towards the goal: if a given burst
is to be dropped due to the path loss simulation (see FAKE_DROP),
mark the carrier TRX2L1 message as NOPE.ind and send anyway.
Change-Id: Iabd0af665e3108d23a908638f943a5b689986e2c
Related: OS#3428, OS#2975
-rwxr-xr-x | src/target/trx_toolkit/fake_trx.py | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/target/trx_toolkit/fake_trx.py b/src/target/trx_toolkit/fake_trx.py index f0dc5a52..f14d1437 100755 --- a/src/target/trx_toolkit/fake_trx.py +++ b/src/target/trx_toolkit/fake_trx.py @@ -110,6 +110,11 @@ class FakeTRX(Transceiver): RSSI_BASE_DEFAULT = -60 CI_BASE_DEFAULT = 90 + # Default values for NOPE / IDLE indications + TOA256_NOISE_DEFAULT = 0 + RSSI_NOISE_DEFAULT = -110 + CI_NOISE_DEFAULT = -30 + def __init__(self, *trx_args, **trx_kwargs): Transceiver.__init__(self, *trx_args, **trx_kwargs) @@ -177,9 +182,6 @@ class FakeTRX(Transceiver): return False def _handle_data_msg_v1(self, src_msg, msg): - # TODO: NOPE indications are not (yet) supported - msg.nope_ind = False - # C/I (Carrier-to-Interference ratio) msg.ci = self.ci @@ -200,6 +202,26 @@ class FakeTRX(Transceiver): # simulates RF path parameters (such as RSSI), # and sends towards the L1 def handle_data_msg(self, src_trx, src_msg, msg): + # Path loss simulation + msg.nope_ind = self.sim_burst_drop(msg) + if msg.nope_ind: + # Before TRXDv1, we simply drop the message + if msg.ver < 0x01: + del msg + return + + # Since TRXDv1, we should send a NOPE.ind + del msg.burst # burst bits are omited + msg.burst = None + + # TODO: shoud we make these values configurable? + msg.toa256 = self.TOA256_NOISE_DEFAULT + msg.rssi = self.RSSI_NOISE_DEFAULT + msg.ci = self.CI_NOISE_DEFAULT + + self.data_if.send_msg(msg) + return + # Complete message header msg.toa256 = self.toa256 msg.rssi = self.rssi @@ -212,10 +234,6 @@ class FakeTRX(Transceiver): if src_trx.ta != 0: msg.toa256 -= src_trx.ta * 256 - # Path loss simulation - if self.sim_burst_drop(msg): - return - # TODO: make legacy mode configurable (via argv?) self.data_if.send_msg(msg, legacy = True) |