[MERGED] osmocom-bb[fixeria/trx]: fake_trx/ctrl_if_(bb|bts).py: add FAKE_TOA command

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Feb 28 18:05:55 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: fake_trx/ctrl_if_(bb|bts).py: add FAKE_TOA command
......................................................................


fake_trx/ctrl_if_(bb|bts).py: add FAKE_TOA command

FAKE_TOA is an auxilary CTRL command, which may be used to update
the ToA (Timing of Arrival) value of forwarded bursts at runtime.
This is useful for testing the measurement processing
code in OsmoBTS.

The command is implemented for both BTS and BB CTRL interfaces
in two absolute and relative forms:

  CMD FAKE_TOA <BASE> <THRESH>
  CMD FAKE_TOA <+-BASE_DELTA>

The first form overwrites both ToA value and its treshold.
The second one is relative, and applies a delta
to the current ToA value.

The command affects Downlink bursts if sent on BTS CTRL
interface, and Uplink bursts if sent on the BB CTRL.

Change-Id: Ia23becec4104d47e7b22350db67b8834d6f1ad1b
---
M src/target/fake_trx/ctrl_if_bb.py
M src/target/fake_trx/ctrl_if_bts.py
2 files changed, 46 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/target/fake_trx/ctrl_if_bb.py b/src/target/fake_trx/ctrl_if_bb.py
index 74fb242..c4d879c 100644
--- a/src/target/fake_trx/ctrl_if_bb.py
+++ b/src/target/fake_trx/ctrl_if_bb.py
@@ -129,6 +129,29 @@
 			self.burst_fwd.ta = ta
 			return 0
 
+		# Timing of Arrival simulation for Uplink
+		# Absolute form: CMD FAKE_TOA <BASE> <THRESH>
+		elif self.verify_cmd(request, "FAKE_TOA", 2):
+			print("[i] Recv FAKE_TOA cmd")
+
+			# Parse and apply both base and threshold
+			self.burst_fwd.toa256_ul_base = int(request[1])
+			self.burst_fwd.toa256_ul_threshold = int(request[2])
+
+			# TODO: avoid sending response
+			return -1
+
+		# Timing of Arrival simulation for Uplink
+		# Relative form: CMD FAKE_TOA <+-BASE_DELTA>
+		elif self.verify_cmd(request, "FAKE_TOA", 1):
+			print("[i] Recv FAKE_TOA cmd")
+
+			# Parse and apply delta
+			self.burst_fwd.toa256_ul_base += int(request[1])
+
+			# TODO: avoid sending response
+			return -1
+
 		# Wrong / unknown command
 		else:
 			# We don't care about other commands,
diff --git a/src/target/fake_trx/ctrl_if_bts.py b/src/target/fake_trx/ctrl_if_bts.py
index 92a4abb..f27b87d 100644
--- a/src/target/fake_trx/ctrl_if_bts.py
+++ b/src/target/fake_trx/ctrl_if_bts.py
@@ -97,6 +97,29 @@
 			self.burst_fwd.bts_freq = self.tx_freq
 			return 0
 
+		# Timing of Arrival simulation for Downlink
+		# Absolute form: CMD FAKE_TOA <BASE> <THRESH>
+		elif self.verify_cmd(request, "FAKE_TOA", 2):
+			print("[i] Recv FAKE_TOA cmd")
+
+			# Parse and apply both base and threshold
+			self.burst_fwd.toa256_dl_base = int(request[1])
+			self.burst_fwd.toa256_dl_threshold = int(request[2])
+
+			# TODO: avoid sending response
+			return -1
+
+		# Timing of Arrival simulation for Downlink
+		# Relative form: CMD FAKE_TOA <+-BASE_DELTA>
+		elif self.verify_cmd(request, "FAKE_TOA", 1):
+			print("[i] Recv FAKE_TOA cmd")
+
+			# Parse and apply delta
+			self.burst_fwd.toa256_dl_base += int(request[1])
+
+			# TODO: avoid sending response
+			return -1
+
 		# Wrong / unknown command
 		else:
 			# We don't care about other commands,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia23becec4104d47e7b22350db67b8834d6f1ad1b
Gerrit-PatchSet: 4
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>



More information about the gerrit-log mailing list