Change in ...osmocom-bb[master]: trx_toolkit/burst_gen.py: basic TRXD header version 1 support

fixeria gerrit-no-reply at lists.osmocom.org
Tue Jul 23 22:05:41 UTC 2019


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14917


Change subject: trx_toolkit/burst_gen.py: basic TRXD header version 1 support
......................................................................

trx_toolkit/burst_gen.py: basic TRXD header version 1 support

Change-Id: Icd4505d211816dc80e91d65094be92f2aed856bd
---
M src/target/trx_toolkit/burst_gen.py
1 file changed, 27 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/17/14917/1

diff --git a/src/target/trx_toolkit/burst_gen.py b/src/target/trx_toolkit/burst_gen.py
index 6db8219..63c8786 100755
--- a/src/target/trx_toolkit/burst_gen.py
+++ b/src/target/trx_toolkit/burst_gen.py
@@ -5,7 +5,7 @@
 # Auxiliary tool to generate and send random bursts via TRX DATA
 # interface, which may be useful for fuzzing and testing
 #
-# (C) 2017-2018 by Vadim Yanitskiy <axilirator at gmail.com>
+# (C) 2017-2019 by Vadim Yanitskiy <axilirator at gmail.com>
 #
 # All Rights Reserved
 #
@@ -23,7 +23,7 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-APP_CR_HOLDERS = [("2017-2018", "Vadim Yanitskiy <axilirator at gmail.com>")]
+APP_CR_HOLDERS = [("2017-2019", "Vadim Yanitskiy <axilirator at gmail.com>")]
 
 import logging as log
 import signal
@@ -68,9 +68,9 @@
 
 		# Init an empty DATA message
 		if self.argv.conn_mode == "TRX":
-			msg = DATAMSG_L12TRX()
+			msg = DATAMSG_L12TRX(ver = self.argv.hdr_ver)
 		elif self.argv.conn_mode == "L1":
-			msg = DATAMSG_TRX2L1()
+			msg = DATAMSG_TRX2L1(ver = self.argv.hdr_ver)
 
 		# Generate a random frame number or use provided one
 		fn_init = msg.rand_fn() if self.argv.tdma_fn is None \
@@ -102,6 +102,17 @@
 			if self.argv.rssi is not None:
 				msg.rssi = self.argv.rssi
 
+			if msg.ver >= 0x01:
+				# TODO: Only GMSK and TSC set 0 for now
+				msg.mod_type = Modulation.ModGMSK
+				self.tsc_set = 0
+
+				if self.argv.tsc is not None:
+					msg.tsc = self.argv.tsc
+
+				if self.argv.ci is not None:
+					msg.ci = self.argv.ci
+
 			# Generate a random burst
 			if self.argv.burst_type == "NB":
 				burst = burst_gen.gen_nb()
@@ -163,6 +174,10 @@
 		bg_group.add_argument("-c", "--burst-count", metavar = "N",
 			dest = "burst_count", type = int, default = 1,
 			help = "How many bursts to send (default %(default)s)")
+		bg_group.add_argument("-v", "--hdr-version", metavar = "VER",
+			dest = "hdr_ver", type = int,
+			default = 0, choices = DATAMSG.known_versions,
+			help = "TRXD header version (default %(default)s)")
 		bg_group.add_argument("-f", "--frame-number", metavar = "FN",
 			dest = "tdma_fn", type = int,
 			help = "Set TDMA frame number (default random)")
@@ -186,6 +201,14 @@
 			dest = "toa256", type = int,
 			help = "Set Timing of Arrival in 1/256 symbol periods")
 
+		bg_group.add_argument("--tsc", metavar = "TSC",
+			dest = "tsc", type = int, choices = range(0, 8),
+			help = "Set Training Sequence Code (default random)")
+		bg_group.add_argument("--ci", metavar = "CI",
+			dest = "ci", type = int,
+			help = "C/I: Carrier-to-Interference ratio "
+			       "in centiBels (default random)")
+
 		return parser.parse_args()
 
 	def sig_handler(self, signum, frame):

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14917
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Icd4505d211816dc80e91d65094be92f2aed856bd
Gerrit-Change-Number: 14917
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190723/ee2dcfa4/attachment.html>


More information about the gerrit-log mailing list