summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-03-01 01:02:11 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-03-01 01:52:04 +0700
commit6fa80f274ed932b8142a9f04a652820b135483e7 (patch)
treec44fc0ba2881b2034a591e92dab9036d0974bb35
parent5ab622d2b72ac6df9d71d42736a6a65ac76cfab5 (diff)
fake_trx/burst_fwd.py: FIX: apply TA value correctly
If field randomization is disabled, Timing Advance value indicated by MS would be ignored. Let's fix this by separating the TA calculation code. Change-Id: If43d5823fc33efc2f1649ea941ab6f619bb6f5e7
-rw-r--r--src/target/fake_trx/burst_fwd.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/target/fake_trx/burst_fwd.py b/src/target/fake_trx/burst_fwd.py
index d059e13..9f0f84f 100644
--- a/src/target/fake_trx/burst_fwd.py
+++ b/src/target/fake_trx/burst_fwd.py
@@ -70,6 +70,11 @@ class BurstForwarder:
self.bts_link = bts_link
self.bb_link = bb_link
+ # Converts TA value from symbols to
+ # units of 1/256 of GSM symbol periods
+ def calc_ta256(self):
+ return self.ta * 256
+
# Calculates a random ToA value for Downlink bursts
def calc_dl_toa256(self):
# Check if randomization is required
@@ -98,10 +103,6 @@ class BurstForwarder:
# Generate a random ToA value
toa256 = random.randint(toa256_min, toa256_max)
- # Apply TA value indicated by MS
- ta256 = self.ta * 256
- toa256 -= ta256
-
return toa256
# Calculates a random RSSI value for Downlink bursts
@@ -149,6 +150,7 @@ class BurstForwarder:
msg_trx2l1.rssi = self.calc_dl_rssi()
else:
msg_trx2l1.toa256 = self.calc_ul_toa256()
+ msg_trx2l1.toa256 -= self.calc_ta256()
msg_trx2l1.rssi = self.calc_ul_rssi()
return msg_trx2l1