[PATCH] osmocom-bb[fixeria/trx]: fake_trx/burst_fwd.py: FIX: apply TA value correctly

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Wed Feb 28 18:52:34 UTC 2018


Review at  https://gerrit.osmocom.org/7004

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
---
M src/target/fake_trx/burst_fwd.py
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/04/7004/1

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 @@
 		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
@@ -97,10 +102,6 @@
 
 		# 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
 
@@ -149,6 +150,7 @@
 			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

-- 
To view, visit https://gerrit.osmocom.org/7004
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If43d5823fc33efc2f1649ea941ab6f619bb6f5e7
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>


More information about the gerrit-log mailing list